OMG HELP
#1

Is this Right cause I am Fireteam 2 But I still get Ejected From the vehicle
pawn Код:
if(newstate == PLAYER_STATE_DRIVER)
    {
        new Vehicle = GetPlayerVehicleID(playerid);
        if( Vehicle == FiremanVehicle1 && PlayerInfo[playerid][pFireTeam] >= 2)
        {
            SendClientMessage(playerid, 0x33AA33AA, "You Are Not On Fire Duty");
            RemovePlayerFromVehicle(playerid >= FiremanVehicle1);
        }
        else
        {
            if(newstate == PLAYER_STATE_PASSENGER)
            {
                format(string, sizeof(string), "You Entered A %s, Owned By AFD", VehicleNames[GetVehicleModel(Vehicle) -400]);
                SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                return 1;
            }
        }
    }
Reply
#2

Quote:
Originally Posted by Buzzbomb
Посмотреть сообщение
Is this Right cause I am Fireteam 2 But I still get Ejected From the vehicle
pawn Код:
if(newstate == PLAYER_STATE_DRIVER)
    {
        new Vehicle = GetPlayerVehicleID(playerid);
        if( Vehicle == FiremanVehicle1 && PlayerInfo[playerid][pFireTeam] >= 2)
        {
            SendClientMessage(playerid, 0x33AA33AA, "You Are Not On Fire Duty");
            RemovePlayerFromVehicle(playerid >= FiremanVehicle1);
        }
        else
        {
            if(newstate == PLAYER_STATE_PASSENGER)
            {
                format(string, sizeof(string), "You Entered A %s, Owned By AFD", VehicleNames[GetVehicleModel(Vehicle) -400]);
                SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                return 1;
            }
        }
    }
pawn Код:
PlayerInfo[playerid][pFireTeam] >= 2
That line, you're checking if their information is greater than or equal to 2. Instead of the " = ", make it " > " only:

pawn Код:
PlayerInfo[playerid][pFireTeam] > 2 // only if their info is greater than 2, you can do >= 3 also
Whats this:

pawn Код:
RemovePlayerFromVehicle(playerid >= FiremanVehicle1);
Should be:

pawn Код:
RemovePlayerFromVehicle(playerid);
Reply
#3

If you only want faction 2 to be able to drive the vehicle, use the 'is not' operator:

PlayerInfo[playerid][pFireTeam] != 2
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)