SA-MP Forums Archive
chat bug - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: chat bug (/showthread.php?tid=437019)



chat bug - alpai - 13.05.2013

Hi guys i have chat bug

Код:
public OnPlayerText(playerid, text[])
{
new string[128];
	    format(string, sizeof(string), "(%d): {FFFFFF}%s", playerid, text[0]);
	    SendPlayerMessageToAll(playerid, string);
	    return 0;
	}
No errors but when i join server and write something its must look like |
NICK (ID): hi all ( with name color )
but its like this
NICK HI ALL ( and its not name color its white ) why the hell ;xx if its from the code help me if isn't from the code i will give all script of gamemode


Re: chat bug - DeMoX - 13.05.2013

pawn Код:
public OnPlayerText(playerid, text[])
{
            new string[128];
        format(string, sizeof(string), "%s (%d): %s"GetPlayerName(playerid),  playerid, text[0]);
        SendPlayerMessageToAll(-1, string);
        return 0;
}
P.S: This will send a white text
If you want to send the text with the color of the player
It must be like this :

pawn Код:
public OnPlayerText(playerid, text[])
{
            new string[128];
        format(string, sizeof(string), "%s (%d): %s", GetPlayerName(playerid), playerid, text[0]);
        SendPlayerMessageToAll(GetPlayerColor(playerid), string);
        return 0;
}



Re: chat bug - alpai - 13.05.2013

warning 202: number of arguments does not match definition


Re: chat bug - DiGiTaL_AnGeL - 13.05.2013

pawn Код:
new name[24];
GetPlayerName(playerid, name, 24);
format(string, sizeof(string), "%s (%d): %s", name, playerid, text[0]);



Re: chat bug - HashFr - 13.05.2013

You just don't know how to format strings, right?

https://sampwiki.blast.hk/wiki/Format


Re: chat bug - alpai - 13.05.2013

Nope its still same... Its from gamemode i think because 1 hour ago was no problem with this code ;xx I make something wrong with gamemode if someone can help me i will give teamviewer id and pass add me skype ben-j_alpi7o0o


Re: chat bug - HashFr - 13.05.2013

Double. Sozz.


Re: chat bug - alpai - 14.05.2013

FIXED // LOCK THEME // BTW I FIX IT WHEN CHANGE SERVER FILES DOWNLOAD NEW SAMP SERVER FILES AND PUT GAMEMODE SCRIPT FILES AND OTHER i think the error was from plugins or other 10X all