[NEED HELP] Faction Restricted vehicles
#1

Hey Guys I'm working on a new script i want to know how to faction restrict vehicles please tell me first one to tell me and a EG of codes will get Rep
Reply
#2

You must make a variable for vehicles, new Faction[MAX_VEHICLES].
Then give it a value for the cars you want, for example Faction[2] = 1, it sets vehicle ID 2 to faction 1. Then make a condition in OnPlayerStateChange.
pawn Код:
if (newstate == PLAYER_STATE_DRIVER) {
     if (Faction(GetPlayerVehicleID(playerid) != PlayerFactionVariable[playerid]) RemovePlayerFromVehicle(playerid);
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)