Vehicle Restriction
#1

So yesterday i asked about it and everything worked today i noticed with my friends that it removes me from all vehicles so i changed it to OnPlayerUpdate cause i saw some people using this method for rp servers and i tryed it to
but it dosent remove me from vehicle at all

pawn Код:
public OnPlayerUpdate(playerid)
{
    new playerState = GetPlayerState(playerid);
    if(IsPlayerInVehicle(playerid, 432) && playerState == PLAYER_STATE_DRIVER)
    {
        if(Engineer[playerid] != 1)
           return RemovePlayerFromVehicle(playerid);
    }
    if(IsPlayerInVehicle(playerid, 520 || 425) && playerState == PLAYER_STATE_DRIVER)
    {
        if(Pilot[playerid] != 1)
           return RemovePlayerFromVehicle(playerid);
    }
    return 1;
}
Reply
#2

so here's how I do it.
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{

    //Army Permissions
    if(GetVehicleModel(vehicleid) == 432 || GetVehicleModel(vehicleid) == 520 || GetVehicleModel(vehicleid) == 425)
    {
       if(InAdminMode[playerid] == 0)
       {
         if(gTeam[playerid] != TEAM_ARMY)
         {
            SendClientMessage(playerid, COLOR_RED,"[ERROR] You must be an army officer in order to use this vehicle.");
            ClearAnimations(playerid,1);
            return 1;
         }
       }
    }
return 1;
}
Reply
#3

You're aware that you're checking for a vehicle model not a vehicle ID, am I right?
Reply
#4

Quote:
Originally Posted by DaniceMcHarley
Посмотреть сообщение
You're aware that you're checking for a vehicle model not a vehicle ID, am I right?
Actually i am not cause i am new to scripting for vehicles never tried to change anything there

@Vanter thanks it helped you have been +REPED
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)