08.07.2012, 10:29
pawn Код:
new OnDuty[MAX_PLAYERS];
new OffDutySkin[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
OnDuty[playerid] = 0;
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/duty", true) == 0)
{
if(OnDuty[playerid] == 0)
{
OffDutySkin[playerid] = GetPlayerSkin(playerid);
SetPlayerSkin(playerid, 280); //Change 280 to whatever Skin ID you want for a cop.
SendClientMessage(playerid, 0x00FF00AA, "You are now ON duty.");
}
else return SendClientMessage(playerid, 0xFF0000AA, "You are already on duty!");
return 1;
}
if(strcmp(cmdtext, "/offduty", true) == 0)
{
if(OnDuty[playerid] == 1)
{
SetPlayerSkin(playerid, OffDutySkin[playerid]);
SendClientMessage(playerid, 0x00FF00AA, "You are now OFF duty.");
}
else return SendClientMessage(playerid, 0xFF0000AA, "You are already off duty!");
return 1;
}
return 1;
}