10.03.2014, 17:34
You could make this a lot less lines of code
Why bother checking if the player is connected obviously they are if they just typed the message.
pawn Код:
new string[175];
if((GetPlayerScore(playerid) >= 0) && (GetPlayerScore(playerid) <= 100)) format(string,sizeof(string), "{F5E618}[Corporal]{FFFFFF} %s: {FFFFFF}%s",GetName(playerid),text);
else if((GetPlayerScore(playerid) >= 100) && (GetPlayerScore(playerid) <= 300)) format(string,sizeof(string), "{F5E618}[Lieutenant]{FFFFFF} %s: {FFFFFF}%s",GetName(playerid),text);
.....
SendClientMessageToAll(-1, string);
return 0;
pawn Код:
stock GetName(playerid)
{
new Name[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name, sizeof(Name));
return Name;
}