Hi. I want to do, that when player leave car, it will destroy. Here I have code. It works, but vehicle wont destroy, but respawning...
Code:
if( oldstate == PLAYER_STATE_DRIVER && newstate == PLAYER_STATE_ONFOOT && IsValidVehicle(veho[playerid]))
{
timer[ playerid ] = SetTimerEx( "destroytimer", 120000, false, "i", playerid );
}
Code:
forward destroytimer( playerid );
public destroytimer( playerid )
{
DestroyVehicle(veho[playerid]);
return 1;
}