whats wrong with it? - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: whats wrong with it? (
/showthread.php?tid=188446)
whats wrong with it? -
[TGR]beastboy[ES] - 07.11.2010
Ok guys, here's my code.
pawn Code:
//under onplayerexitvehicle
SetTimerEx("DestroyCar", 10000, 0,"e",playerid);
pawn Code:
DestroyCar(playerid)
{
DestroyVehicle(GetPlayerVehicleID(vehicleid));
return 1;
}
but when I exit the vehicle it doesn't disappear in 10 seconds...
Please help me if you can.
Re: whats wrong with it? -
Haydz - 07.11.2010
Have you forwarded the timer?
forward DestroyCar;
and added
Public DestroyCar etc
Re: whats wrong with it? -
gr56 - 07.11.2010
change "e" in settimerex to "i"
Re: whats wrong with it? -
Bessensap - 07.11.2010
Putting the previous posts together:
pawn Code:
//under onplayerexitvehicle
SetTimerEx("DestroyCar", 10000, 0,"i",playerid);
pawn Code:
forward DestroyCar(playerid);
public DestroyCar(playerid)
{
DestroyVehicle(GetPlayerVehicleID(vehicleid));
return 1;
}
Re: whats wrong with it? -
[MWR]Blood - 08.11.2010
Still doesn't work D:
Re: whats wrong with it? -
MrDeath537 - 09.11.2010
When the player get off the vehicle, he isn't in a vehicle, that's why you can delete his vehicle.
Try it:
pawn Code:
// OnPlayerExitVehicle
SetTimerEx("DestroyPVehicle", 10000, false, "i", GetPlayerVehicleID(playerid));
forward DestroyPVehicle(vehicleid);
public DestroyPVehicle(vehicleid)
{
DestroyVehicle(vehicleid);
return 1;
}
Re: whats wrong with it? -
-Rebel Son- - 09.11.2010
Are you trying to destroy the vehicle when they exit it?
if so.
pawn Code:
public OnPlayerExitVehicle(playerid, vehicleid){
DestroyVehicle(vehicleid);
return 1;}
>> this destroys the vehicle after they exit it.
Re: whats wrong with it? -
[MWR]Blood - 10.11.2010
Quote:
Originally Posted by MrDeath
When the player get off the vehicle, he isn't in a vehicle, that's why you can delete his vehicle.
Try it:
pawn Code:
// OnPlayerExitVehicle SetTimerEx("DestroyPVehicle", 10000, false, "i", GetPlayerVehicleID(playerid));
forward DestroyPVehicle(vehicleid); public DestroyPVehicle(vehicleid) { DestroyVehicle(vehicleid); return 1; }
|
Still doesn't work D: