chat bug
#1

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
Reply
#2

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;
}
Reply
#3

warning 202: number of arguments does not match definition
Reply
#4

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

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

https://sampwiki.blast.hk/wiki/Format
Reply
#6

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
Reply
#7

Double. Sozz.
Reply
#8

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)