[Pomoc] Chat


Započeo Bugi, Februar 24, 2013, 20:48:08 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim: Od 0
Detaljan opis problema: Zanima me kako da napravim da pise ono npr Filip_Filipovic kaze: blablblabl da pise to kaze a ne samo Filip_Filipovic: balbalablabl , i onaj ooc chat isto ne kapiram kako ide, necu da svi vide sta se pise u IC i OOC chatu, nego samo oni u blizini, znate na sta mislim!?
Dio skripte:  8) dacu sta treba
Neke slike/video za lakse dobivanje pomoci(neobavezno):  :'(  :'(  :'(  :'(
RESPECT: Blaeks, Yui_Sang, Gagi, Kapetan Husein, Luksa, Slay, Denis_Lapi, Zoran(Dude)

Programski jezici koje koristim: C, C#, Visual Basic, HTML, CSS, PHP (tek ucim).


Evo ovako:

YCMD:b(playerid, params[], help)
{
    if(isnull(params)) return SCM(playerid,COLOR_RED," /b [Text]"); // Kucanje komande
    new string[128]; // Oznacis string koji dolje koristimo
    format(string,sizeof(string), "ooc chat | %s:(( %s ))", GetName(playerid), params); // salje poruku
    ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); // Znaci da vidi sam tvoje okruzenje 
    return 1;
}


A običan local chat radiš preko publica "OnPlayerText" ..

Poslednja Izmena: Februar 24, 2013, 21:38:47 POSLE PODNE od FlasH
BIG RESPEKT: Blaeks,  [CRP] Joey_, David (Sabljak) A.k.A SABO(T), joXy_, Dimi, Sexserghy ♥, TerminuS, H1TM4N

Citat: FlasH poslato Februar 24, 2013, 21:35:56 POSLE PODNE
Evo ovako:

YCMD:b(playerid, params[], help)
{
    if(isnull(params)) return SCM(playerid,COLOR_RED," /b [Text]"); // Kucanje komande
    new string[128]; // Oznacis string koji dolje koristimo
    format(string,sizeof(string), "ooc chat | %s:(( %s ))", GetName(playerid), params); // salje poruku
    ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); // Znaci da vidi sam tvoje okruzenje 
    return 1;
}


A običan local chat radiš preko publica "OnPlayerText" ..

Ti si moje <3 fala kralju :D
RESPECT: Blaeks, Yui_Sang, Gagi, Kapetan Husein, Luksa, Slay, Denis_Lapi, Zoran(Dude)

Programski jezici koje koristim: C, C#, Visual Basic, HTML, CSS, PHP (tek ucim).


E a sta je ovo sad? D:\LifeZone RP by Bugi\buginob\samp03x_svr_R1-2_win32\gamemodes\lzrp1.pwn(1513) : error 035: argument type mismatch (argument 2)
D:\LifeZone RP by Bugi\buginob\samp03x_svr_R1-2_win32\gamemodes\lzrp1.pwn(1515) : error 017: undefined symbol "GetName"
D:\LifeZone RP by Bugi\buginob\samp03x_svr_R1-2_win32\gamemodes\lzrp1.pwn(1516) : error 017: undefined symbol "ProxDetector"
RESPECT: Blaeks, Yui_Sang, Gagi, Kapetan Husein, Luksa, Slay, Denis_Lapi, Zoran(Dude)

Programski jezici koje koristim: C, C#, Visual Basic, HTML, CSS, PHP (tek ucim).


Stavi ovo u GM.

forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);

public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
{
	new Float:posx, Float:posy, Float:posz;
	new Float:oldposx, Float:oldposy, Float:oldposz;
	new Float:tempposx, Float:tempposy, Float:tempposz;
	GetPlayerPos(playerid, oldposx, oldposy, oldposz);
	for(new i = 0; i <= MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i) == 1)
		{
			{
			GetPlayerPos(i, posx, posy, posz);
			tempposx = (oldposx -posx);
			tempposy = (oldposy -posy);
			tempposz = (oldposz -posz);
			if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
			{
				SCM(i, col1, string);
			}
			else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
			{
				SCM(i, col2, string);
			}
			else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
			{
				SCM(i, col3, string);
			}
			else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
			{
				SCM(i, col4, string);
			}
			else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
			{
				SCM(i, col5, string);
			}
			}
		}
	}
	return 1;
}

stock GetName(playerid)
{
	new pName[MAX_PLAYER_NAME];
	GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
	strreplace(pName, '_', ' ');
	return pName;
}
BIG RESPEKT: Blaeks,  [CRP] Joey_, David (Sabljak) A.k.A SABO(T), joXy_, Dimi, Sexserghy ♥, TerminuS, H1TM4N

Citat: FlasH poslato Februar 24, 2013, 21:55:01 POSLE PODNE
Stavi ovo u GM.

forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);

public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
{
	new Float:posx, Float:posy, Float:posz;
	new Float:oldposx, Float:oldposy, Float:oldposz;
	new Float:tempposx, Float:tempposy, Float:tempposz;
	GetPlayerPos(playerid, oldposx, oldposy, oldposz);
	for(new i = 0; i <= MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i) == 1)
		{
			{
			GetPlayerPos(i, posx, posy, posz);
			tempposx = (oldposx -posx);
			tempposy = (oldposy -posy);
			tempposz = (oldposz -posz);
			if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
			{
				SCM(i, col1, string);
			}
			else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
			{
				SCM(i, col2, string);
			}
			else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
			{
				SCM(i, col3, string);
			}
			else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
			{
				SCM(i, col4, string);
			}
			else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
			{
				SCM(i, col5, string);
			}
			}
		}
	}
	return 1;
}

stock GetName(playerid)
{
	new pName[MAX_PLAYER_NAME];
	GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
	strreplace(pName, '_', ' ');
	return pName;
}


D:\LifeZone RP by Bugi\buginob\samp03x_svr_R1-2_win32\gamemodes\lzrp1.pwn(207) : error 017: undefined symbol "strreplace"
D:\LifeZone RP by Bugi\buginob\samp03x_svr_R1-2_win32\gamemodes\lzrp1.pwn(1565) : error 035: argument type mismatch (argument 2)
D:\LifeZone RP by Bugi\buginob\samp03x_svr_R1-2_win32\gamemodes\lzrp1.pwn(1568) : error 017: undefined symbol "COLOR_PURPLE"

LINIJE!
207:
strreplace(pName, '_', ' ');


1568:
    ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); // Znaci da vidi sam tvoje okruzenje


1565:
    if(isnull(params)) return SCM(playerid,COL_RED," /b [Text]"); // Kucanje komande
RESPECT: Blaeks, Yui_Sang, Gagi, Kapetan Husein, Luksa, Slay, Denis_Lapi, Zoran(Dude)

Programski jezici koje koristim: C, C#, Visual Basic, HTML, CSS, PHP (tek ucim).


Definiraj boje i dodaj stock..

#define COLOR_GREY 				0xAFAFAFAA
#define COLOR_GREEN 			0x9EC73DAA
#define COLOR_LIGHTRED 			0xFF6347AA
#define COLOR_LIGHTBLUE 		0x33CCFFAA
#define COLOR_LIGHTGREEN 		0x9ACD32AA
#define COLOR_YELLOW 			0xFFFF00AA
#define COLOR_MEDIUMAQUA 		0x83BFBFAA
#define COLOR_ORANGE 			0xFF9900AA
#define COLOR_RED 				0xAA3333AA
#define COLOR_YELLOW 			0xFFFF00AA
#define COLOR_WHITE 			0xFFFFFFAA
#define COLOR_BLUE 				0x0000BBAA
#define COLOR_PURPLE    		0xC2A2DAAA
#define COLOR_GRAD2  			0xBFC0C2FF
#define COLOR_GRAD1 			0xB4B5B7FF
#define COLOR_GRAD2 			0xBFC0C2FF
#define COLOR_GREY 				0xAFAFAFAA
#define COLOR_GRAD3 			0xCBCCCEFF
#define COLOR_GRAD4 			0xD8D8D8FF
#define COLOR_FADE2 			0xC8C8C8C8
#define COLOR_FADE3 			0xAAAAAAAA
#define COLOR_FADE4 			0x8C8C8C8C
#define COLOR_FADE5 			0x6E6E6E6E
#define COLOR_GRAD5 			0xE3E3E3FF
#define COLOR_FADE1 			0xE6E6E6E6
#define COLOR_GRAD6 			0xF0F0F0FF

stock strreplace(string[], find, replace)
{
    for(new i=0; string[i]; i++)
    {
        if(string[i] == find)
        {
            string[i] = replace;
        }
    }
}
BIG RESPEKT: Blaeks,  [CRP] Joey_, David (Sabljak) A.k.A SABO(T), joXy_, Dimi, Sexserghy ♥, TerminuS, H1TM4N

Citat: FlasH poslato Februar 24, 2013, 22:06:27 POSLE PODNE
Definiraj boje i dodaj stock..

#define COLOR_GREY 				0xAFAFAFAA
#define COLOR_GREEN 			0x9EC73DAA
#define COLOR_LIGHTRED 			0xFF6347AA
#define COLOR_LIGHTBLUE 		0x33CCFFAA
#define COLOR_LIGHTGREEN 		0x9ACD32AA
#define COLOR_YELLOW 			0xFFFF00AA
#define COLOR_MEDIUMAQUA 		0x83BFBFAA
#define COLOR_ORANGE 			0xFF9900AA
#define COLOR_RED 				0xAA3333AA
#define COLOR_YELLOW 			0xFFFF00AA
#define COLOR_WHITE 			0xFFFFFFAA
#define COLOR_BLUE 				0x0000BBAA
#define COLOR_PURPLE    		0xC2A2DAAA
#define COLOR_GRAD2  			0xBFC0C2FF
#define COLOR_GRAD1 			0xB4B5B7FF
#define COLOR_GRAD2 			0xBFC0C2FF
#define COLOR_GREY 				0xAFAFAFAA
#define COLOR_GRAD3 			0xCBCCCEFF
#define COLOR_GRAD4 			0xD8D8D8FF
#define COLOR_FADE2 			0xC8C8C8C8
#define COLOR_FADE3 			0xAAAAAAAA
#define COLOR_FADE4 			0x8C8C8C8C
#define COLOR_FADE5 			0x6E6E6E6E
#define COLOR_GRAD5 			0xE3E3E3FF
#define COLOR_FADE1 			0xE6E6E6E6
#define COLOR_GRAD6 			0xF0F0F0FF

stock strreplace(string[], find, replace)
{
    for(new i=0; string[i]; i++)
    {
        if(string[i] == find)
        {
            string[i] = replace;
        }
    }
}


Sad su se sklonila ona dva, al ovaj jebeni ostaje, P.S. kralj si :D

D:\LifeZone RP by Bugi\buginob\samp03x_svr_R1-2_win32\gamemodes\lzrp1.pwn(1582) : error 035: argument type mismatch (argument 2)
RESPECT: Blaeks, Yui_Sang, Gagi, Kapetan Husein, Luksa, Slay, Denis_Lapi, Zoran(Dude)

Programski jezici koje koristim: C, C#, Visual Basic, HTML, CSS, PHP (tek ucim).


Daj tu liniju ..
BIG RESPEKT: Blaeks,  [CRP] Joey_, David (Sabljak) A.k.A SABO(T), joXy_, Dimi, Sexserghy ♥, TerminuS, H1TM4N

ETO JE :D

    if(isnull(params)) return SCM(playerid,COL_RED," /b [Text]"); // Kucanje komande
RESPECT: Blaeks, Yui_Sang, Gagi, Kapetan Husein, Luksa, Slay, Denis_Lapi, Zoran(Dude)

Programski jezici koje koristim: C, C#, Visual Basic, HTML, CSS, PHP (tek ucim).


Napravio ovako:

Ako nemaš dodaj include sscanf trebat će ti i u buduće ..

Na vrh:

#include <sscanf2>

i u cmd:

if(sscanf(params, "u", id)) return SCM(playerid, COLOR_RED, "/b [text]");
BIG RESPEKT: Blaeks,  [CRP] Joey_, David (Sabljak) A.k.A SABO(T), joXy_, Dimi, Sexserghy ♥, TerminuS, H1TM4N