18.09.2012, 00:35
Try it this way:
You don't have to check if the player who types the command is connected. It makes no sense at all.
pawn Код:
CMD:quitjob(playerid,params[])
{
if(PlayerInfo[playerid][pJob] == 0)
return SendClientMessage(playerid, COLOR_GREY, "You do not have a job!");
SendClientMessage(playerid, COLOR_WHITE, "You have quit a job!");
PlayerInfo[playerid][pJob] = 0;
PlayerInfo[playerid][pChar] = 0;
PlayerInfo[playerid][pContractTime] = 0;
SetPlayerToTeamColor(playerid);
return 1;
}