PDA

View Full Version : PutPlayerInVehicle


Mikep.
23/11/2009, 11:22 PM
When PutPlayerInVehicle is used on a player that's in a vehicle, they stay in that vehicle for other players until that vehicle is destroyed.

Very annoying bug.

Chaprnks
27/11/2009, 12:35 AM
Possible temporary fix, if you don't already use. Also would fix the bug of putting a player in any seat that someone else is already in.

// Has to go before all the PutPlayerInVehicle's, or you can manually rename all them to whatever.
public SafePutPlayerInVehicle(playerid, vehicleid, seatid)
{
foreach(Player, i)
{
if(GetPlayerVehicleID(i) == vehicleid && GetPlayerVehicleSeat(i) == seatid)
{
return 0;
}
}
PutPlayerInVehicle(playerid, vehicleid, seatid);
return 1;
}

#define PutPlayerInVehicle SafePutPlayerInVehicle

Jay_
27/11/2009, 01:31 PM
There's also an issue using PutPlayerInVehicle when using special actions, such as smoking and drinking. It teleports the player out of the vehicle immediately. Note that before someone mentions it, using SPECIAL_ACTION_NONE before the function call does nothing.

Rac3r
27/11/2009, 05:28 PM
We had the same issue, with the new beer and ciggy actions. Players would not be put in their vehicles.
Just a shame we have to remove their actions before putting them in a vehicle.
xInfo[playerid][vehicle]=vehicleid;
SetPlayerSpecialAction(playerid,0);
PutPlayerInVehicle(playerid,vehicleid,seat);
return 1;
}