Z-Dash Posted July 28, 2013 Share Posted July 28, 2013 Hello,My small cient sided script isn't working script job:Air Force team can enter vehicles other teams cant.. function AFVeh(thePlayer) if getTeamName(getPlayerTeam(getLocalPlayer())) =~ "Air Force" then outputChatBox("This vehicle is for the Air Force Team!", 0, 100, 0 ) cancelEvent() end end end addEventHandler("onClientVehicleStartEnter", getRootElement(), AFVeh) Link to comment
hassan.k.s.a Posted July 28, 2013 Share Posted July 28, 2013 addEventHandler("onClientVehicleStartEnter",getRootElement(),function() local plrTeam = getPlayerTeam(getLocalPlayer()) if ( plrTeam ) then if ( getTeamName(plrTeam) ~= "Air Force" ) then outputChatBox("This vehicle is for the Air Force Team!", 0, 100, 0 ,true) cancelEvent() end end end) Link to comment
Castillo Posted July 28, 2013 Share Posted July 28, 2013 With that, the message will appear to the local player even if a remote player tries to enter, as far as I know. addEventHandler ( "onClientVehicleStartEnter", root, function ( thePlayer ) if ( thePlayer == localPlayer ) then local plrTeam = getPlayerTeam ( localPlayer ) if ( plrTeam ) then if ( getTeamName ( plrTeam ) ~= "Air Force" ) then outputChatBox ( "This vehicle is for the Air Force Team!", 0, 100, 0 ,true ) cancelEvent ( ) end end 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