Xeno Posted September 11, 2011 Share Posted September 11, 2011 I'm making a GUI for a certain team on marker hit, and only that team can use it. It all works expect for when I hit the marker it shows up for everyone in the team, heres the code... function onMarkerHitGiveVehicle() if getPlayerTeam(lp) == getTeamFromName("Teamname") then showCursor(true) guiSetVisible(window,true) end end for i,marker in ipairs(markers) do addEventHandler("onClientMarkerHit",marker,onMarkerHitGiveVehicle) end Please help me? Link to comment
Castillo Posted September 12, 2011 Share Posted September 12, 2011 You are not checking if the player who hit it is the localPlayer, must be that. function onMarkerHitGiveVehicle(hitPlayer) if (hitPlayer == localPlayer) then if getPlayerTeam(hitPlayer) == getTeamFromName("Teamname") then showCursor(true) guiSetVisible(window,true) end end end for i,marker in ipairs(markers) do addEventHandler("onClientMarkerHit",marker,onMarkerHitGiveVehicle) end Try it. Link to comment
Xeno Posted September 12, 2011 Author Share Posted September 12, 2011 You are not checking if the player who hit it is the localPlayer, must be that. function onMarkerHitGiveVehicle(hitPlayer) if (hitPlayer == localPlayer) then if getPlayerTeam(hitPlayer) == getTeamFromName("Teamname") then showCursor(true) guiSetVisible(window,true) end end end for i,marker in ipairs(markers) do addEventHandler("onClientMarkerHit",marker,onMarkerHitGiveVehicle) end I THINK it works, I have to wait till a USSA person comes on to test it with me. Ill let you know tonight Thanks for your help! Try it. Link to comment
Xeno Posted September 12, 2011 Author Share Posted September 12, 2011 I get an error when using it... "End expected to close function at line 26" Link to comment
JR10 Posted September 12, 2011 Share Posted September 12, 2011 His code is fine, and no missing ends, so it must be something else in the rest of the code. Post it. Link to comment
Xeno Posted September 12, 2011 Author Share Posted September 12, 2011 His code is fine, and no missing ends, so it must be something else in the rest of the code.Post it. Your absolutely right. I missed an end Hah. Thank you Castillo for your help. And thank you JR10 For your advice ;3 1 more thing... How do you get something to check ACL? Like... How would I make it so it checks ACL on marker hit? Link to comment
Castillo Posted September 13, 2011 Share Posted September 13, 2011 You welcome. And... https://wiki.multitheftauto.com/wiki/Has ... rmissionTo -- To check if a player has permission to that function. https://wiki.multitheftauto.com/wiki/IsObjectInACLGroup -- To check if an account is in the ACL group inserted. P.S: These functions are only server side. 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