Small problem regarding RemovePlayerFromVehicle
#1

Resolved.
Reply
#2

Umm, i was having same prob few weeks ago, wait, let me check my script
Reply
#3

Try to putting it under OnPlayerStateChange instead.
This callback is called before the player enter the vehicle.
Reply
#4

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER)
    {
        new vehicle = GetPlayerVehicleID(playerid);
        if(vehicle == 511)
        {
            RemovePlayerFromVehicle(playerid);
            return 1;
        }
    }
    return 1;
}
It's still not working.
Reply
#5

Or you can use
pawn Код:
new Float:x, Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
SetPlayerPos(playerid,x,y,z);
Replace it with "RemovePlayerFromVehicle(playerid)
Reply
#6

If that doesn't work,
Try either
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(vehicleid == pilotjobvehicle)
    {
        if(pilotjob[playerid] == 0)
        {
            new Float:x, Float:y,Float:z;
            GetPlayerPos(playerid,x,y,z);
            SetPlayerPos(playerid,x,y,z);
            return 1;
        }
    }
    return 1;
}
OR
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER)
    {
        new vehicle = GetPlayerVehicleID(playerid);
        if(vehicle == 511)
        {
            new Float:x, Float:y,Float:z;
            GetPlayerPos(playerid,x,y,z);
            SetPlayerPos(playerid,x,y,z);
            return 1;
        }
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)