24.07.2011, 20:33
1. Disconnected player cant type commands
2.
3.
2.
pawn Код:
if(!strcmp(cmdtext, "/radio", true, 6))
pawn Код:
if(!strcmp(cmdtext, "/radio", true, 6))
{
if(!(GetPlayerSkin(playerid) == 61))
return SendClientMessage(playerid, -1, "You are not a pilot !");
if(!cmdtext[7])
return SendClientMessage(playerid, -1, "USAGE: /radio [text]");
#if !defined string
new string[128];
#endif
#if !defined pName
new pName[MAX_PLAYER_NAME];
#endif
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(string, sizeof(string), "[Pilot %s]: %s", pName, cmdtext[7]);
for(new i,g=GetMaxPlayers(); i < g; i++)
if(GetPlayerSkin(i) == 61) // this checks IsPlayerConnected too
SendClientMessage(i, 0xFF000000, string);
return 1;
}