SA-MP Forums Archive
RemovePlayerFromVehicle - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: RemovePlayerFromVehicle (/showthread.php?tid=342925)



RemovePlayerFromVehicle - [D]ry[D]esert - 15.05.2012

Hi every one
i tried this but does't work it look fine , anyone have idea why this does't work ?
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(gTeam[playerid] == TEAM_HUMANS && HumanClass[playerid] == Driver)
    {
    }
    else
    {
    RemovePlayerFromVehicle(playerid);
    }


    return 1;
}



Re: RemovePlayerFromVehicle - ViniBorn - 15.05.2012

Put this in OnPlayerStateChange

This callback is called before the player enter the vehicle.


Re: RemovePlayerFromVehicle - newbienoob - 15.05.2012

You can use this
pawn Код:
new Float:x, Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
SetPlayerPos(playerid,x,y,z);
Replace it with
RemovePlayerFromVehicle(playerid);


Re: RemovePlayerFromVehicle - KingHual - 15.05.2012

OnPlayerEnterVehicle gets called before the player actually enters the vehicle. Try this:

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER) {
    if(gTeam[playerid] == TEAM_HUMANS && HumanClass[playerid] == Driver)
    {
    }
    else
    {
    RemovePlayerFromVehicle(playerid);
    }
}
return 1;
}