[HELP]If player leave/destroyed defined vehicle, timer will be killed - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [HELP]If player leave/destroyed defined vehicle, timer will be killed (
/showthread.php?tid=353381)
[HELP]If player leave/destroyed defined vehicle, timer will be killed -
RadekB0Y - 23.06.2012
I kinda need help. I need kill timer for defined vehicle.
Example:
rhino1 = createvehicle(.......
public OnVehicleExit....
}
If vehicle is rhino1
}
Kill(rhino1timer);
return 1;
}
public OnVehicleDeath(....)
}
If vehicle is rhino1
}
KillTimer(rhino1timer);
return 1;
}
Can someone help me with this, i got 9 rhinos and i need only them to kill timer when players exits from vehicle or vehicle gets destroyed. My idea on these rhinos are: they will be available to drive only for 5 minutes, after timer expire, they will be automatically ejected and rhino will respawn. I need to check defined car (rhino1 ....) and kill timer that is for rhino1. Some help?
P.S. : I hope you guys understand this, if not ask me, i try to explain it closely.
Re: [HELP]If player leave/destroyed defined vehicle, timer will be killed -
[MM]RoXoR[FS] - 23.06.2012
pawn Code:
new rhino[9];
new rtimer[9];
rhino[0] = CreateVehicle(....);
public OnPlayerEnterVehicle(playerid,vehicleid,ispassenger)
{
if(vehicleid == rhino[0])
rtimer[0] = SetTimerEx("DRhino",300000,false,"i",rhino[0]);
//And so on for other
}
public OnPlayerExitVehicle(playerid,vehicleid)
{
if(vehicleid == rhino[0]
{ KillTimer(rtimer[0]);
SetVehicleToRespawn(rhino[0]);}
//And so on for other
}
forward DRhino(id);
public DRhino(id)
{
SetVehicleToRespawn(id);
return 1;
}
Re: [HELP]If player leave/destroyed defined vehicle, timer will be killed -
RadekB0Y - 23.06.2012
Ok its nice, time to test it.
Just little problem was here in coding, you missed ")". But it wasnt deal.
Code:
if(vehicleid == rhino[0]) //in OnPlayerExitVehicle
Thx for help
. I will tell results soon.