[HELP] /policeduty
#4

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;
}
Reply


Messages In This Thread
[HELP] /policeduty - by Emanuel_Rodriguez - 07.06.2010, 20:31
Re: [HELP] /policeduty - by boelie - 07.06.2010, 20:37
Re: [HELP] /policeduty - by Emanuel_Rodriguez - 07.06.2010, 20:44
Re: [HELP] /policeduty - by AK47KILLA - 07.06.2010, 22:35

Forum Jump:


Users browsing this thread: 1 Guest(s)