vehicle help
#1

Let's say I make something like this at OnPlayerEnterVehicle.

pawn Код:
if(IsACopVehicle(vehicleid))
    {
        new Float:playerposx, Float:playerposy, Float:playerposz;
        GetPlayerPos(playerid, playerposx, playerposy, playerposz);
        if(PlayerInfo[playerid][pCop] == 0)
        {
            SetPlayerPos(playerid,playerposx, playerposy, playerposz);
        }
    }
How do I do if I want the passangers to be allowed to enter the cop vehicles?
Reply
#2

You lacked the && !ispassenger, which judges whether the player that is entering is entering as driver, or as passenger.
pawn Код:
if(IsACopVehicle(vehicleid) && !ispassenger)
    {
        new Float:playerposx, Float:playerposy, Float:playerposz;
        GetPlayerPos(playerid, playerposx, playerposy, playerposz);
        if(PlayerInfo[playerid][pCop] == 0)
        {
            SetPlayerPos(playerid,playerposx, playerposy, playerposz);
        }
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)