07.06.2010, 22:35
Try using a variable to do it.
Код:
new OnDuty[MAX_PLAYERS];
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/policeduty", true))
{
if(OnDuty[playerid] == 0)
{
OnDuty[playerid] = 1;
new name[MAX_PLAYER_NAME], string[44];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s is now on Police Duty!",name);
SendClientMessageToAll(0x0033CCAA, string);
} else {
OnDuty[playerid] = 0;
new name[MAX_PLAYER_NAME], string[44];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s is now off Police Duty!",name);
SendClientMessageToAll(0x0033CCAA, string);
}
return 1;
}
return 0;
}

