RemovePlayerFromVehicle(playerid); problem -_-
#1

Fixed.. loool
Reply
#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
#3

ooooooooooooooooooooooooh, no i didn't because I already read it but ages ago... but not all of it... and so no, i didn't read the wiki xD thanks tho man..
Reply
#4

what you could do is set the doors to locked, and under OnPlayerEnterVehicle if the pllayer has the correct job, automatically unlock
Reply
#5

is there a way, not to freeze the player but freeze the bike so the bike wont go, unless you have types /startwork?
Reply
#6

Jup , but you can freeze player if he is on the bike he shouldn't be, remove from vehicle, and again on PlayerStateChange, if old state was 2, and old vehicle is that pizza bike, unfreeze.
Reply
#7

No i know how to do that, but I want to make it so when you work for the pizza stack, you get on the vehicle, it won't move... until you type /startwork
Reply
#8

pawn Код:
new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    SetPlayerPos(playerid, x, y, z+5);
Reply
#9

Quote:
Originally Posted by ross8839
Посмотреть сообщение
No i know how to do that, but I want to make it so when you work for the pizza stack, you get on the vehicle, it won't move... until you type /startwork
You can set vehicle engine to 0/false and then when player type command to set it to 1/true.
Reply
#10

Okay so I got that working and now I have another problem, I have updated the topic with another problem instead of making a new thread, would really appreciate any help!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)