Need Help with Tag
#5

Quote:
Originally Posted by Stinged
Посмотреть сообщение
Cannary2048's code will work (Note change player message to client mesage)
But making a function that gets the tag from the score would be easier if you want to use them somewhere else.

pawn Код:
public OnPlayerText(playerid, text[])
{
    new pText[160];
    new pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName,sizeof(pName));
    if(GetPlayerScore(playerid) >= 1000)
    {
        format(pText, sizeof (pText), "{%06x}%s (ID: %d) [{FF0000}%s{FFFFFF}]: {FFFFFF}%s", GetPlayerColor(playerid) >>> 8, pName, playerid, GetTagFromScore(playerid), text);
        SendClientMessageToAll(-1, pText);
    }
    else
    {
        format(pText, sizeof (pText), "{%06x}%s (ID: %d): {FFFFFF}%s", GetPlayerColor(playerid) >>> 8, pName, playerid, text);
        SendClientMessageToAll(-1, pText); // CLIENT message not PLAYER message.
        // Player messages are "Name: your formatted string"
        // Client messages are "your formatted string"
    }
    return 0;
}

GetTagFromScore(playerid)
{
    new string[32];
    switch(GetPlayerScore(playerid))
    {
        case 1000: format(string, sizeof (string), "Deadly");
        case 2000: format(string, sizeof (string), "what ever you want");
        // ...
    }
    return string;
}
Ah, yes, I copied from the wiki and it's SendPlayerMessageToAll
Reply


Messages In This Thread
Need Help with Tag - by Iloveimpulse - 20.08.2014, 07:20
Re: Need Help with Tag - by AzaMx - 20.08.2014, 08:03
Re: Need Help with Tag - by Cannary2048 - 20.08.2014, 08:04
Re: Need Help with Tag - by Stinged - 20.08.2014, 08:15
Re: Need Help with Tag - by Cannary2048 - 20.08.2014, 08:18
Re: Need Help with Tag - by Iloveimpulse - 20.08.2014, 18:32
Re: Need Help with Tag - by Stinged - 20.08.2014, 18:35
Re: Need Help with Tag - by Iloveimpulse - 20.08.2014, 19:00
Re: Need Help with Tag - by Stinged - 20.08.2014, 19:03

Forum Jump:


Users browsing this thread: 1 Guest(s)