Automatically exit the player's vehicle and enter it again automatically
#1

Howdy,

O.K., I created this callback called OnPlayerTeleport, and basically - we all know that having many objects will end up to some objects to not load unless you exit your vehicle.

Basically, I have absolutely no idea how will I be able to create this, because there are some teleports that some objects don't load, and if I RemovePlayerFromVehicle, it'll be annoying for the player to re-enter it.

If it is possible, how can I let the player automatically be ejected out of hes vehicle so the objects can load, and then be automatically entered to hes vehicle.

/discuss, and /share.
Reply
#2

Use PutPlayerInVehicle and GetNearestVehicle.
Reply
#3

pawn Code:
stock ResetPlayerIntoVehicle(playerid)
{
    if(!IsPlayerInAnyVehicle(playerid))
        return 0;      
       
    SetTimerEx("PutPlayerInVehicleEx", 500, false, "dd", playerid, GetPlayerVehicleID(playerid));
       
    new Float:fPosition[3];
    GetPlayerPos(playerid, fPosition[0], fPosition[1], fPosition[2]);
    SetPlayerPos(playerid, fPosition[0], fPosition[1], fPosition[2]+3);
}

forward PutPlayerInVehicleEx(playerid, vehicleid);
public PutPlayerInVehicleEx(playerid, vehicleid)
{
    PutPlayerInVehicle(playerid, vehicleid, 0);
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)