FuriouZ Posted September 11, 2013 Posted September 11, 2013 Hey, what is wrong with it ? client: local Freeroam = "Freeroam Arena" local freeroamPlayer = getLocalPlayer () - - - - function showVehiclesGui() if not freeroamPlayer then outputChatBox ( "Vehicles are only allowed in Freeroam Arena.", 255, 0, 0, true ) else if ( getTeamName( getPlayerTeam( freeroamPlayer ) ) == Freeroam ) then if guiGetVisible(GUIEditor_Window[1]) == true then guiSetVisible(GUIEditor_Window[1], false) showCursor(false) else guiSetVisible(GUIEditor_Window[1], true) showCursor(true) end end end end function bindVehiclesGui() bindKey("F2", "down", showVehiclesGui) end addEventHandler("onClientResourceStart", resourceRoot, bindVehiclesGui) addEventHandler("onPlayerJoin", resourceRoot, bindVehiclesGui) It works, but only problem is that, if i am in another arena and press F2 then it doesn't appear in chatbox("Vehicles are only allowed in Freeroam Arena."). Thanks Homepage @ http://rageresources.blogspot.com/ Offical Facebook @ https://www.facebook.com/pages/Rage-Scr ... fref=photo
TAPL Posted September 11, 2013 Posted September 11, 2013 function showVehiclesGui() local team = getPlayerTeam(localPlayer) local FreeroamTeam = getTeamFromName("Freeroam Arena") if team and FreeroamTeam and team == FreeroamTeam then if guiGetVisible(GUIEditor_Window[1]) then guiSetVisible(GUIEditor_Window[1], false) showCursor(false) else guiSetVisible(GUIEditor_Window[1], true) showCursor(true) end else outputChatBox("Vehicles are only allowed in Freeroam Arena.", 255, 0, 0, true) end end bindKey("F2", "down", showVehiclesGui)
FuriouZ Posted September 12, 2013 Author Posted September 12, 2013 Thanks ! But if i want add two teams there,who can use cars, then how should i do ? I tryed,but this doesn't work, with it i can use cars in all teams function showVehiclesGui() local team = getPlayerTeam(localPlayer) local FreeroamTeam = getTeamFromName("Freeroam Arena") local StuntageTeam = getTeamFromName("Stuntage Arena") if team and FreeroamTeam or StuntageTeam and team == FreeroamTeam or StuntageTeam then if guiGetVisible(GUIEditor_Window[1]) then guiSetVisible(GUIEditor_Window[1], false) showCursor(false) else guiSetVisible(GUIEditor_Window[1], true) showCursor(true) end else outputChatBox("Vehicles are only allowed in Freeroam and -Stuntage Arena.", 255, 0, 0, true) end end bindKey("F2", "down", showVehiclesGui) Homepage @ http://rageresources.blogspot.com/ Offical Facebook @ https://www.facebook.com/pages/Rage-Scr ... fref=photo
FuriouZ Posted September 13, 2013 Author Posted September 13, 2013 Can someone help ? Homepage @ http://rageresources.blogspot.com/ Offical Facebook @ https://www.facebook.com/pages/Rage-Scr ... fref=photo
Blaawee Posted September 13, 2013 Posted September 13, 2013 function showVehiclesGui() local team = getPlayerTeam(localPlayer) local FreeroamTeam = getTeamFromName("Freeroam Arena") local StuntageTeam = getTeamFromName("Stuntage Arena") if team and FreeroamTeam and StuntageTeam and team == FreeroamTeam or team == StuntageTeam then if guiGetVisible(GUIEditor_Window[1]) then guiSetVisible(GUIEditor_Window[1], false) showCursor(false) else guiSetVisible(GUIEditor_Window[1], true) showCursor(true) end else outputChatBox("Vehicles are only allowed in Freeroam and -Stuntage Arena.", 255, 0, 0, true) end end bindKey("F2", "down", showVehiclesGui)
FuriouZ Posted September 14, 2013 Author Posted September 14, 2013 Thank you ! Homepage @ http://rageresources.blogspot.com/ Offical Facebook @ https://www.facebook.com/pages/Rage-Scr ... fref=photo
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