29.07.2012, 13:10
pawn Код:
new IsPlayerOnWork[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
IsPlayerOnWork[playerid] = 0;
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
IsPlayerOnWork[playerid] = 0;
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
if(IsPlayerOnWork[playerid] == 1)
{
IsPlayerOnWork[playerid] = 0;
SendClientMessage(playerid,-1,"You Are Now Off Duty!");
SetPlayerSkin(playerid, 0);
}
else
{
IsPlayerOnWork[playerid] = 1;
SendClientMessage(playerid,-1,"You Are Now On Duty!");
SetPlayerSkin(playerid, 277);
}
return 1;
}
return 0;
}