Faction/Job vehicles
#2

Consider this: all Pawn variables start with the number 0. If the player is not in vehicle, GetPlayerVehicleID will return 0. In that case, they will match.

Try checking if a player is in vehicle first like so
pawn Код:
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER)
{
    if(IsPlayerInAnyVehicle(playerid))
    {
        if(GetPlayerVehicleID(playerid) == sweeper[playerid])
        {
            if(pInfo[playerid][Darbas] == DARBAS_SLAVEJAS || pInfo[playerid][Admin] >= 2)
            {
                //bla bla sweeper
            }
            else
            {
                KickPlayerOutOfVehicle(playerid);
                //bla bla wrong job mate
            }
        }

        else if(GetPlayerVehicleID(playerid) == pizzaboy[playerid]) //pizzaboy
        {
            if(pInfo[playerid][Darbas] == DARBAS_PICININKAS || pInfo[playerid][Admin] >= 2)
            {
                //Bla bla pizzaguy stuff   
            }
            else
            {
                KickPlayerOutOfVehicle(playerid);
                //Bla bla not your car
            }
        }
    }
Reply


Messages In This Thread
Faction/Job vehicles - by siemka321 - 25.11.2014, 13:07
Re: Faction/Job vehicles - by dusk - 25.11.2014, 13:23
Re: Faction/Job vehicles - by siemka321 - 25.11.2014, 13:34
Re: Faction/Job vehicles - by siemka321 - 25.11.2014, 19:31
Re: Faction/Job vehicles - by Steven82 - 25.11.2014, 21:00
Re: Faction/Job vehicles - by siemka321 - 25.11.2014, 21:08
Re: Faction/Job vehicles - by siemka321 - 26.11.2014, 13:29

Forum Jump:


Users browsing this thread: 1 Guest(s)