03.06.2010, 14:09
How to add a timer, into OnPlayerExitVehicle if he leaves a car for 5 seconds, it gets destroyed
Originally Posted by DJDhan
Under OnPlayerExitVehicle(playerid,vehicleid)
Код:
SetTimer("DestroyVehicle",5000,0); |
public OnPlayerExitVehicle(playerid, vehicleid) { SetTimerEx("DeleteVehicle", 5000, false, "d", vehicleid); return 1; } forward DeleteVehicle(vehicleid); public DeleteVehicle(vehicleid) { DestroyVehicle(vehicleid); }
public OnPlayerExitVehicle(playerid, vehicleid)
{
SetTimerEx("delcar", 5000, 0, "i", vehicleid)
return 1;
}
forward delcar(vehicleid);
public delcar(vehicleid)
{
DestroyVehicle(vehicleid);
//or
SetVehicleToRespawn(vehicleid);
return 1;
}
SetTimerEx("DestroyVeh",5000,0,"dd",playerid,vehicleid);
forward DestroyVeh(p,v); public DestroyVeh(p,v) { if(!IsPlayerInVehicle(p,v)){ DestroyVehicle(v); } return 1; }
Originally Posted by Shady91
wrong, I would do something like
pawn Код:
|
Originally Posted by Jefff
exit
Код:
SetTimerEx("DestroyVeh",5000,0,"dd",playerid,vehicleid); Код:
forward DestroyVeh(p,v); public DestroyVeh(p,v) { if(!IsPlayerInVehicle(p,v)){ DestroyVehicle(v); } return 1; } |
Originally Posted by WackoX
Quote:
* He said the car has te be destroyed, you destroy and respawn them. * You don't have to destroy a car that would be respawned, unuseless. * You have no idea of identation. EDIT: Still i stay with my point of view. --- Quote:
|
Originally Posted by WackoX
Quote:
* He said the car has te be destroyed, you destroy and respawn them. * You don't have to destroy a car that would be respawned, unuseless. * You have no idea of identation. EDIT: Still i stay with my point of view. |
Originally Posted by WackoX
Quote:
* He said the car has te be destroyed, you destroy and respawn them. * You don't have to destroy a car that would be respawned, unuseless. * You have no idea of identation. EDIT: Still i stay with my point of view. --- Quote:
|