whats wrong with it?
#1

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.
Reply
#2

Have you forwarded the timer?

forward DestroyCar;

and added

Public DestroyCar etc
Reply
#3

change "e" in settimerex to "i"
Reply
#4

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;
}
Reply
#5

Still doesn't work D:
Reply
#6

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;
}
Reply
#7

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.
Reply
#8

Quote:
Originally Posted by MrDeath
View Post
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:
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)