show rank when player texts
#10

Quote:
Originally Posted by Eminem 2ka9
Посмотреть сообщение
@Realcop - I added your RankName stock instead of mine, and replaced your OnPlayerText with mine, but my compiler crashed.

I put back my original stock, and only added your OnPlayerText, and i only got 1 warning.

pawn Код:
warning 219: local variable "text" shadows a variable at a preceding level
This is the line:
pawn Код:
text[128],
You're getting that warning because you're using the variable 'text' twice.

pawn Код:
public OnPlayerText(playerid, text[]) //In the callback header here
{
    SetPlayerChatBubble(playerid, text, C_WHITE, 100.0, 10000);

    new
        text[128], //And you're also defining it here, how will the compiler know which one from which?
        string[128]
    ;
   
    format(string, sizeof(string), "** %s %s [%d]: %s", RankName(playerid), Name(playerid), playerid, text);
    SendClientMessageToAll(C_WHITE, string);
    return 0;
}
Since you're not using it, the best solution is to remove it.

pawn Код:
public OnPlayerText(playerid, text[]) //In the callback header here
{
    SetPlayerChatBubble(playerid, text, C_WHITE, 100.0, 10000);

    new
        string[128]
    ;
   
    format(string, sizeof(string), "** %s %s [%d]: %s", RankName(playerid), Name(playerid), playerid, text);
    SendClientMessageToAll(C_WHITE, string);
    return 0;
}
Reply


Messages In This Thread
show rank when player texts - by Eminem 2ka9 - 16.03.2013, 21:41
Re: show rank when player texts - by Scenario - 16.03.2013, 21:47
Re: show rank when player texts - by Eminem 2ka9 - 16.03.2013, 21:53
Re: show rank when player texts - by Jstylezzz - 16.03.2013, 21:55
Re: show rank when player texts - by Eminem 2ka9 - 16.03.2013, 22:03
Re: show rank when player texts - by Vince - 16.03.2013, 22:05
Re: show rank when player texts - by Scenario - 16.03.2013, 22:05
Re: show rank when player texts - by Eminem 2ka9 - 16.03.2013, 22:16
Re: show rank when player texts - by Eminem 2ka9 - 16.03.2013, 22:22
Re: show rank when player texts - by Bicentric - 16.03.2013, 22:38

Forum Jump:


Users browsing this thread: 1 Guest(s)