Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

OnPlayerStateChange, locking vehicles

$
0
0
Code:

public OnPlayerStateChange(playerid, newstate, oldstate)
{
        new vehicleID = GetPlayerVehicleID(playerid);
        if(newstate == PLAYER_STATE_DRIVER && PlayerInfo[playerid][pFac] != 1)
        {
                if(vehicleID == 596 || 597 || 598 || 599 || 523)
                {
                        RemovePlayerFromVehicle(playerid);
                        SendClientMessage(playerid, COLOR_RED, "You have to be a Police officer to drive this vehicle!");
                }
                else if(vehicleID == 490 && PlayerInfo[playerid][pFacRank] < 3)
                {
                        RemovePlayerFromVehicle(playerid);
                        SendClientMessage(playerid, COLOR_RED, "You need to be a police officer at rank 3 or above to drive this vehicle!");
                }
        }
        return 1;
}


That's the above code and all the vehicle IDS are locked when not in faction 1... but you can be any 'FacRank' when entering ID 490... why is that?

Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>