Jamie_Mews Posted July 17, 2011 Share Posted July 17, 2011 Ive got the SQL database running and everything. How can i stop random people just stealing the faction vehicles. I know there is a way to script a small lookup to see if the user in that group. I dont really know where to start. Please Help thanks Link to comment
JasperNL=D Posted July 22, 2011 Share Posted July 22, 2011 I suppose the factions are sorted in teams, you can try this Add this somewhere in your code. When you want to set a vehicle to be part of one of the teams, you have to do something like this setVehicleTeamVehicle (car,theteam) or if you only know the teamname: setVehicleTeamVehicle (car,getTeamFromName("teamname")) I hope that works :> the code is below. addEventHandler("onVehicleStartEnter",getRootElement(), function(player,seat,jacked,door) if getElementData (vehicle,"teamvehicle") then if getPlayerTeam (player) == getElementData (vehicle,"teamvehicle") then outputChatBox ("You entered a vehicle of your team!",player,255,0,0,false) return else outputChatBox ("This vehicle isn't part of your team!",player,255,0,0,false) cancelEvent () return end end end) function setVehicleTeamVehicle (vehicle,team) if vehicle and team and isElement (vehicle) and isElement (team) and getElementType (vehicle) == "vehicle" and getElementType (team) == "team" then setElementData (vehicle,"teamvehicle",team) return true else return false end end Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now