K4stic Posted March 24, 2013 Posted March 24, 2013 -- Disabled the seasparrow weapons for player not in staff or military forces team addEventHandler("onClientVehicleStartEnter", root, function(thePlayer, seat) if ( thePlayer == localPlayer ) then if ( getElementModel ( source ) == 447 ) or ( getElementModel ( source ) == 425 ) or ( getElementModel ( source ) == 520 ) then if (getTeamName(getPlayerTeam(thePlayer)) == "Staff") or (getTeamName(getPlayerTeam(thePlayer)) == "Armed Forces") then toggleControl ( "vehicle_fire", true ) toggleControl ( "vehicle_secondary_fire", true ) else toggleControl ( "vehicle_fire", false ) toggleControl ( "vehicle_secondary_fire", false ) end end end end ) -- Enable the weapons again when the player leaves the vehicle addEventHandler("OnClientVehicleStartExit", root, function(thePlayer, seat) if thePlayer == localPlayer then if ( getElementModel ( source ) == 447 ) or ( getElementModel ( source ) == 425 ) or ( getElementModel ( source ) == 520 ) then if not (getTeamName(getPlayerTeam(thePlayer)) == "Staff") or not (getTeamName(getPlayerTeam(thePlayer)) == "Armed Forces") then toggleControl ( "vehicle_fire", true ) toggleControl ( "vehicle_secondary_fire", true ) end end end end ) it no disable the weapon for other teams i wonna to player can shoot with that vehicles only if he Staff or Armed Forces but it no disable it Giving a Fuck? Nope, That isn't in My Skill Set
Castillo Posted March 24, 2013 Posted March 24, 2013 local vehicles = { [ 447 ] = true, [ 425 ] = true, [ 520 ] = true } local teams = { [ "Staff" ] = true, [ "Armed Forces" ] = true } -- Disabled the seasparrow weapons for player not in staff or military forces team addEventHandler ( "onClientVehicleStartEnter", root, function ( thePlayer, seat ) if ( thePlayer == localPlayer ) then if ( vehicles [ getElementModel ( source ) ] ) then local team = getPlayerTeam ( thePlayer ) if ( team and teams [ getTeamName ( team ) ] ) then toggleControl ( "vehicle_fire", true ) toggleControl ( "vehicle_secondary_fire", true ) else toggleControl ( "vehicle_fire", false ) toggleControl ( "vehicle_secondary_fire", false ) end end end end ) -- Enable the weapons again when the player leaves the vehicle addEventHandler ( "onClientVehicleStartExit", root, function ( thePlayer, seat ) if ( thePlayer == localPlayer ) then if ( vehicles [ getElementModel ( source ) ] ) then local team = getPlayerTeam ( thePlayer ) if ( not team or not teams [ getTeamName ( team ) ] ) then toggleControl ( "vehicle_fire", true ) toggleControl ( "vehicle_secondary_fire", true ) end end end end ) Try that. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
K4stic Posted March 24, 2013 Author Posted March 24, 2013 no work and no errors Giving a Fuck? Nope, That isn't in My Skill Set
Castillo Posted March 24, 2013 Posted March 24, 2013 Try making the script server side. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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