10.02.2016, 18:13
I made a drug dealer job and i have a problem with him. I made a timer(3 minutes) and i put it on OnPlayerExitVehicle
The public of the timer:
And this is the /work command:
When i exit the vehicle it said "You lose the race because you get out of the car" the timer works but the problem is when i spawn another car to ride with it and i get out it said "You lose the race because you get out of the car"..
How can i solve this?
Код:
public OnPlayerExitVehicle(playerid, vehicleid) { if(drugdj[playerid] == 1) { SetTimerEx("drugsss", 180000, 0, "i", playerid); vehEngine[vehicleid] = 0; GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective); SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective); SetPVarInt(playerid, "Engine", 0); DestroyVehicle(vehicleid); SendClientMessage(playerid,COLOR_LIGHTBLUE,"JOB: You lose the race because you get out of the car!"); DisablePlayerCheckpoint(playerid); } return 1; }
Код:
forward drugsss(playerid); public drugsss(playerid) { drugdj[playerid] = 0; SendClientMessage(playerid,COLOR_WHITE,"{FFB870}Now you can make another race!"); return 1; }
Код:
CMD:work(playerid, params[]) { new rand = random(sizeof(CursaRandomDrug)); if(IsPlayerInRangeOfPoint(playerid,7.0,-2546.0862,9.2330,16.4219)) { if(PlayerInfo[playerid][pJob] >= 1) { if(drugdj[playerid] == 1) return SendClientMessage(playerid,COLOR_WHITE,"{FFB870}Wait 3 minutes to start another race!"); { new Float:x, Float:y, Float:z, Float:a; GetPlayerPos(playerid, x,y,z); GetPlayerFacingAngle(playerid, a); new vehicleid = CreateVehicle(459, x+3,y,z, a, -1, -1, -1); SetPlayerCheckpoint(playerid, CursaRandomDrug[rand][0], CursaRandomDrug[rand][1], CursaRandomDrug[rand][2], CursaRandomDrug[rand][3]); PutPlayerInVehicle(playerid, vehicleid, 0); SendClientMessage(playerid, COLOR_LIGHTBLUE, "JOB: Deliver the drugs to set destination on the map!"); drugdj[playerid] = 1; } } } return 1; }
How can i solve this?