RemovePlayerFromVehicle(playerid); problem -_-
#2

I guess you didn't read the stuff on samp wiki.

Taken from samp wiki:

Notes:
The exiting animation is not synced for other players.
This function will not work when used in OnPlayerEnterVehicle, because the player isn't in the vehicle when the callback is called. Use OnPlayerStateChange (newstate == 2/PLAYER_STATE_DRIVER) instead.

Link: https://sampwiki.blast.hk/wiki/RemovePlayerFromVehicle

Try this:

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == 2 && pizzabike)
    {
        if(JobStatus[playerid] == 1)
        {
            SendClientMessage(playerid, COLOR_GREY, "Type /startwork to start working!"); //this sends whenever my variable is set to 1
        }
        else
        {
            RemovePlayerFromVehicle(playerid); //when variable is 0, it doesnt kick me from vehicle
            SendClientMessage(playerid, COLOR_GREY, "You don't work for the pizza place!"); //My variable is set to 0, and this sends... so it's as if it's skipping removeplayerfrom.. anyone?
        }
    }
    return 1;
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)