09.01.2017, 08:32
Try now.
Код:
CMD:quitjob(playerid, params[]) { if(PlayerInfo[playerid][pDonator] >= 2) { if(isnull(params) || !IsNumeric(params)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /quitjob [jobid]"); SendClientMessage(playerid, COLOR_GREY, "Available: 1, 2"); return 1; } switch(params) { case 1: { SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You have quit your Job."); PlayerInfo[playerid][pJob] = 0; if(GetPVarType(playerid, "NPS") != 0) { SetPlayerSkin(playerid, GetPVarInt(playerid, "NPS")); DeletePVar(playerid,"NPS"); } DestroyProgressBar(LoadTruckBar[playerid]); LoadTruckBar[playerid] = INVALID_BAR_ID; LoadTruckTime[playerid] = 0; DeletePVar(playerid, "TruckDeliver"); TruckUsed[playerid] = INVALID_VEHICLE_ID; gPlayerCheckpointStatus[playerid] = CHECKPOINT_NONE; DisablePlayerCheckpoint(playerid); return 1; } case 2: { SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You have quit your secondary Job."); PlayerInfo[playerid][pJob2] = 0; if(GetPVarType(playerid, "NPS") != 0) { SetPlayerSkin(playerid, GetPVarInt(playerid, "NPS")); DeletePVar(playerid,"NPS"); } DestroyProgressBar(LoadTruckBar[playerid]); LoadTruckBar[playerid] = INVALID_BAR_ID; LoadTruckTime[playerid] = 0; DeletePVar(playerid, "TruckDeliver"); TruckUsed[playerid] = INVALID_VEHICLE_ID; gPlayerCheckpointStatus[playerid] = CHECKPOINT_NONE; DisablePlayerCheckpoint(playerid); return 1; } } } else if(PlayerInfo[playerid][pJob] > 0) { SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You have quit your Job."); PlayerInfo[playerid][pJob] = 0; if(GetPVarType(playerid, "NPS") != 0) { SetPlayerSkin(playerid, GetPVarInt(playerid, "NPS")); DeletePVar(playerid,"NPS"); } DestroyProgressBar(LoadTruckBar[playerid]); LoadTruckBar[playerid] = INVALID_BAR_ID; LoadTruckTime[playerid] = 0; DeletePVar(playerid, "TruckDeliver"); TruckUsed[playerid] = INVALID_VEHICLE_ID; gPlayerCheckpointStatus[playerid] = CHECKPOINT_NONE; DisablePlayerCheckpoint(playerid); return 1; } else return SendClientMessage(playerid, COLOR_GREY, "You don't even have a Job!"); }