Add timers if you leave vehicles, how?
#1

How to add a timer, into OnPlayerExitVehicle if he leaves a car for 5 seconds, it gets destroyed
Reply
#2

Ooh i thought it would work :P
Reply
#3

Quote:
Originally Posted by DJDhan
Under OnPlayerExitVehicle(playerid,vehicleid)

Код:
SetTimer("DestroyVehicle",5000,0);
It doesn't get destroyed
Reply
#4

Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
  SetTimerEx("DeleteVehicle", 5000, false, "d", vehicleid);
  return 1;
}

forward DeleteVehicle(vehicleid);
public DeleteVehicle(vehicleid)
{
  DestroyVehicle(vehicleid);
}
Reply
#5

wrong, I would do something like

pawn Код:
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;
}
EDIT: I wasn't talking to you WackoX, You posted a few seconds before me I didn't see your post.
Reply
#6

exit
Код:
SetTimerEx("DestroyVeh",5000,0,"dd",playerid,vehicleid);
Код:
forward DestroyVeh(p,v);
public DestroyVeh(p,v)
{
	if(!IsPlayerInVehicle(p,v)){
		DestroyVehicle(v);
	}
	return 1;
}
Reply
#7

Quote:
Originally Posted by Shady91
wrong, I would do something like

pawn Код:
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;
}
You are wrong;
* 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 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;
}
WTF, if he get's out of a vehicle how the hell would he be in it.
Reply
#8

Quote:
Originally Posted by WackoX
Quote:
Originally Posted by Shady91
wrong, I would do something like

pawn Код:
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;
}
You are wrong;
* 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 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;
}
WTF, if he get's out of a vehicle how the hell would he be in it.
! means the opposite. In this case, if the player is out of a vehicle, then the vehicle gets destroyed if he leaves it
Reply
#9

Quote:
Originally Posted by WackoX
Quote:
Originally Posted by Shady91
wrong, I would do something like

pawn Код:
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;
}
You are wrong;
* 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.
Dude, can you see " //or " he typed between the Destroy and Set to respawn commands?
Reply
#10

Quote:
Originally Posted by WackoX
Quote:
Originally Posted by Shady91
wrong, I would do something like

pawn Код:
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;
}
You are wrong;
* 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 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;
}
WTF, if he get's out of a vehicle how the hell would he be in it.
Err are you blind? can you not see //or

depending on what he wants to do so you wrong for not reading what I wrote

and when you post code in [[pawn]] format it mess's up the indentation also why would I care about fixing indentation on a post on a forum?? he has a brain he could do that him self.

also you spelt indentation wrong.
Reply
#11

None of the timers worked
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)