25.06.2014, 20:31
Код:
CMD:startjob(playerid,params[]) { if(lawnmower[playerid] != 0) { SendClientMessage(playerid,0xFFFFFFFF,"You are already on job!"); return 1; } SetPlayerCheckpoint(playerid, size,x,y,z); // first checkpoint SendClientMessage(playerid,0xFFFFFFFF,"You have started the job, go through the checkpoints to recive the paycheck."); lawnmower[playerid] = 1; return 1; } public OnPlayerEnterCheckpoint(playerid) { if(lawnmower[playerid] == 1) { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, size,x,y,z); // checkpoint 2 lawnmower[playerid] += 1; } if(lawnmower[playerid] == 2) // if the player enters the checkpoint 2 { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, size,x,y,z); //checkpoint 3 lawnmower[playerid] += 1; } if(lawnmower[playerid] == 3) // if the player enters the checkpoint 3 { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, size,x,y,z); lawnmower[playerid] += 1; } //now go on like this till it gets to 10 give him the paycheck and set lawnmower[playerid] back to 0 return 1; }