10.10.2011, 09:19
Try this mate:
pawn Код:
CMD:aduty(playerid, params[])
{
new string[128];
new uName[128];
GetPlayerName(playerid, uName, sizeof(uName));
if(PlayerInfo[playerid][pAdmin] < 1) { return SendClientMessage(playerid, COLOR_GRAY, "You're not an admin!"); }
if(PlayerInfo[playerid][pAdminDuty] == 0)
{
format(string, sizeof(string), "%s has just went on Admin Duty", uName);
SendClientMessageToAll(COLOR_GREEN, string);
SetPlayerHealth(playerid, 500000);
SetPlayerColor(playerid, COLOR_CYAN);
PlayerInfo[playerid][pAdminDuty] = 1;
}
else if (PlayerInfo[playerid][pAdminDuty] == 1)
{
format(string, sizeof(string), "%s has just went off admin duty!", uName);
SendClientMessageToAll(playerid, COLOR_RED, string);
Player[playerid][pAdminDuty] = 0;
}
return 1;
}