How to? -> RemovePlayerFromVehicle
#1

Hi..
How to remove player from his vehicle with a vehicle ID list ?
ty
Reply
#2

I don't know what u mean with 'Vehicle ID list", but here's the code:
pawn Код:
RemovePlayerFromVehicle(playerid);
Reply
#3

When a player is on a vehicle (exemple 520, 562...) remove him from his car with a timer
Reply
#4

Quote:
Originally Posted by g@k
Hi..
How to remove player from his vehicle with a vehicle ID list ?
ty
Did you check Sa-mp wikki?
Reply
#5

Quote:
Originally Posted by rOlInG
Did you check Sa-mp wikki?
That's not SA:MPs wiki.

This is the correct link - http://wiki.sa-mp.com
Reply
#6

Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	switch(GetVehicleModel(vehicleid))
	{
	  case 520,562: RemovePlayerFromVehicle(playerid);
	}
}
Reply
#7

I have already search on the wiki and i need to add a timer to this function because if i don't put the timer it will not work
Reply
#8

Quote:
Originally Posted by RSX
Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	switch(GetVehicleModel(vehicleid))
	{
	  case 520,562: RemovePlayerFromVehicle(playerid);
	}
}
That won't work because OnPlayerEnterVehicle is called when player presses the vehicle enter key and if he's near any vehicle but he isn't IN the vehicle, so he can't be removed. Use the OnPlayerStateChange and check for states.
Reply
#9

Okay i get to try it and paste my pwn code
Reply
#10

Sorry for double post:

Код:
public OnPlayerStateChange(playerid,vehicleid,newstate,oldstate)
{
switch(GetVehicleModel(vehicleid))
{
case 520,562: RemovePlayerFromVehicle(vehicleid);
}
return 1;
}
Results :

Код:
error 025: function heading differs from prototype
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)