onplayertext
#1

pawn Code:
public OnPlayerText(playerid, text[])
{
    static string[128];
    GetPlayerName(playerid, string, MAX_PLAYER_NAME); // fix name
    format(string, sizeof(string),"{FFDC00}[%d] {%06x}%s:{FFFFFF} %s",playerid, GetPlayerColor(playerid), string,text); // fix colour :d
    SendClientMessageToAll(GetPlayerColor(playerid),string);
    return 0;
}
this is the code to put player id in yellow behind a players name when he says something.. its not working for my server

also yes i have the fix for the GetPlayerColor
Reply
#2

pawn Code:
public OnPlayerText(playerid, text[])
{
    static string[128], pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname)); // fix name
    format(string, sizeof(string),"{FFDC00}[%d] {%06x}%s:{FFFFFF} %s",playerid, GetPlayerColor(playerid)/* i don't get why are you using it, i never have seen nything like this, so i will leave it as it is.*/, pname,text); // fix colour :d
    SendClientMessageToAll(GetPlayerColor(playerid),string);
    return 0;
}
Reply
#3

pawn Code:
public OnPlayerText(playerid, text[])
{
    new pName[MAX_PLAYER_NAME];
    new string[256];
    GetPlayerName(playerid, pName,sizeof(pName));
    format(string, sizeof(string),"{FFDC00}[%d] {%06x}%s:{FFFFFF} %s",playerid,pName,text);
    SendClientMessageToAll(GetPlayerColor(playerid),string);
    return 0;
}
Replace the whole code with what I gave you,if it's working Rep++,please?(I usually don't ask for rep,but I have 39 points and I want to have 40 :P)
Reply
#4

pawn Code:
public OnPlayerText(playerid, text[])
{
    new string[128], VBName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, VBName, MAX_PLAYER_NAME); // fix name
    format(string, sizeof(string),"{FFDC00}[%d] {%h}%s:{FFFFFF} %s",playerid, GetPlayerColor(playerid) >>> 8, VBName,text); // fix colour :d
    SendClientMessageToAll(-1,string);
    return 0;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)