15.09.2011, 04:53
(
Последний раз редактировалось matanm; 15.09.2011 в 11:36.
)
well, i build a command that start your work as a pizza boy, now the job is to go checkpoint and by that you'll get money, i do a timer that freeze you on each checkpoint you go on, and the unfreeze in the timer works only for id 0, please help me, it's the command :
and the timer :
and there is the timer :
Quote:
if(strcmp(cmdtext, "/pwork", true) == 0) { if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 44 { if(PlayerInfo[playerid][pJob] == 20) { if(PWork[playerid] == 0) { SetPlayerCheckpoint(playerid, 1849.4888,-1917.8407,15.0228, 3.0); CP[playerid] = 2332; PWork[playerid] = 1; } else if(PWork[playerid] == 1) { SendClientMessage(playerid, COLOR_YELLOW, "You are already in a work"); } } else { SendClientMessage(playerid, COLOR_YELLOW, "You are not a Pizza boy"); } } else { SendClientMessage(playerid, COLOR_YELLOW, "You are not in the Pizza bike"); } return 1; } |
Код:
else if(CP[playerid] == 2332) // Pizza CP 1 { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, 2147.5068,-1367.4108,25.6418, 3.0); CP[playerid] = 2333; PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash]+money; GivePlayerMoney(playerid, money); SetTimer("PCP", 6000, false, "i", playerid); TogglePlayerControllable(playerid, 0); PlayerFrozen[playerid] = 1; SendClientMessage(playerid, COLOR_YELLOW, "Wait 6 seconds while you giving the stack !"); SendClientMessage(playerid, COLOR_YELLOW, "Good, now drive to the next checkpoint."); } else if(CP[playerid] == 2333) // Pizza CP 2 { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, 2571.0601,-1090.4257,66.6734, 3.0); CP[playerid] = 2334; PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash]+money; GivePlayerMoney(playerid, money); SetTimer("PCP", 6000, false, "i", playerid); TogglePlayerControllable(playerid, 0); PlayerFrozen[playerid] = 1; SendClientMessage(playerid, COLOR_YELLOW, "Wait 6 seconds while you giving the stack !"); SendClientMessage(playerid, COLOR_YELLOW, "Good, now drive to the next checkpoint."); } else if(CP[playerid] == 2334) // Pizza CP 3 { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, 1905.8390,-1117.2526,25.6641, 3.0); CP[playerid] = 2335; PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash]+money; GivePlayerMoney(playerid, money); SetTimer("PCP", 6000, false, "i", playerid); TogglePlayerControllable(playerid, 0); PlayerFrozen[playerid] = 1; SendClientMessage(playerid, COLOR_YELLOW, "Wait 6 seconds while you giving the stack !"); SendClientMessage(playerid, COLOR_YELLOW, "Good, now drive to the next checkpoint."); } else if(CP[playerid] == 2335) // Pizza CP 4 { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, 1151.6740,-1068.5717,28.5509, 3.0); CP[playerid] = 2336; PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash]+money; GivePlayerMoney(playerid, money); SetTimer("PCP", 6000, false, "i", playerid); TogglePlayerControllable(playerid, 0); PlayerFrozen[playerid] = 1; SendClientMessage(playerid, COLOR_YELLOW, "Wait 6 seconds while you giving the stack !"); SendClientMessage(playerid, COLOR_YELLOW, "Good, now drive to the next checkpoint."); } else if(CP[playerid] == 2336) // Pizza CP 5 { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, 852.4227,-1419.6780,13.3432, 3.0); CP[playerid] = 2337; PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash]+money; GivePlayerMoney(playerid, money); SetTimer("PCP", 6000, false, "i", playerid); TogglePlayerControllable(playerid, 0); PlayerFrozen[playerid] = 1; SendClientMessage(playerid, COLOR_YELLOW, "Wait 6 seconds while you giving the stack !"); SendClientMessage(playerid, COLOR_YELLOW, "Good, now drive to the next checkpoint."); } else if(CP[playerid] == 2337) // Pizza CP 6 { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, 695.8505,-1645.9476,3.4811, 3.0); CP[playerid] = 2338; PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash]+money; GivePlayerMoney(playerid, money); SetTimer("PCP", 6000, false, "i", playerid); TogglePlayerControllable(playerid, 0); PlayerFrozen[playerid] = 1; SendClientMessage(playerid, COLOR_YELLOW, "Wait 6 seconds while you giving the stack !"); SendClientMessage(playerid, COLOR_YELLOW, "Good, now drive to the next checkpoint."); } else if(CP[playerid] == 2338) // Pizza CP 7 { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, 316.0054,-1771.3463,4.6873, 3.0); CP[playerid] = 2339; PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash]+money; GivePlayerMoney(playerid, money); SetTimer("PCP", 6000, false, "i", playerid); TogglePlayerControllable(playerid, 0); PlayerFrozen[playerid] = 1; SendClientMessage(playerid, COLOR_YELLOW, "Wait 6 seconds while you giving the stack !"); SendClientMessage(playerid, COLOR_YELLOW, "Good, now drive to the next checkpoint."); } else if(CP[playerid] == 2339) // Pizza CP 8 { PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash]+money; GivePlayerMoney(playerid, money); SetTimer("PCP", 6000, false, "i", playerid); TogglePlayerControllable(playerid, 0); PlayerFrozen[playerid] = 1; DisablePlayerCheckpoint(playerid); SendClientMessage(playerid, COLOR_YELLOW, "You have done your work !"); PWork[playerid] = 0; }
Код:
forward PCP(playerid); public PCP(playerid) { PlayerFrozen[playerid] = 0; TogglePlayerControllable(playerid, 1); return 1; }