[HELP]Enter vehicle
#1

Hi. How can i make, that when the player tryes to enter a vehicle, but he can't do it.
On my GM, it's now, when i press enter, i enter the car, and then exit from it automaticly. How can i make, that the player won't be able to enter the car, without permissions. Thanks
Reply
#2

Should the player in a Fraction?
Reply
#3

Yes
Reply
#4

Which Fraction number?
Reply
#5

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if( newstate == PLAYER_STATE_DRIVER )
    {
        if( /* to check if the player ISNT alowed */ )
        {
            RemovePlayerFromVehicle( playerid );
            SendClientMessage( playerid, -1, "You are not allowed to enter this vehicle. " );
        }
        else
        {
            SendClientMessage( playerid, -1, "Welcome to the vehicle!" );
        }
    }
    return 1;
}
That will do the trick. Just change the if statement
Reply
#6

Lets take for example faction number 1

EDIT:

Wesley221 - I want to make it without RemovePlayerFromVehicle
Reply
#7

You want that the vehicle is locked, so he cant enter at all?
Reply
#8

No. Lets take for ex. police car. It's a faction car. So the player, who isn't working at police station, he wont be even able to enter the car. Like he press F (enter), and nothing happens. Do you get it ?
Reply
#9

I think thats impossible :/
Reply
#10

If you think so, you very wrong. I saw this on many servers. I knew how to make it, but i forgot it... lol

Any helpers over here ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)