TuRisMo Posted December 17, 2012 Posted December 17, 2012 team = createTeam ( "Team", 0, 50, 0 ) function addtoteam(thePlayer) local account = getPlayerAccount(thePlayer) local accName = getAccountName ( account ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then setPlayerTeam(thePlayer, team) setElementModel(thePlayer, 287) setElementData( thePlayer, "Occupation", "Example", true ) outputChatBox("You are now Team.", thePlayer, 0, 255, 0) end end addEvent("setteam", true) addEventHandler("setteam", root, addtoteam) So the point is that if the accountname is in Admin ACL group then he will be Set in the team "Team", and the event setteam will be trigered from a GUI.
Castillo Posted December 17, 2012 Posted December 17, 2012 And what is the problem? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
TuRisMo Posted December 17, 2012 Author Posted December 17, 2012 when I trigger the event from client side, nothing happens
Castillo Posted December 17, 2012 Posted December 17, 2012 Show us how you trigger it. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
TuRisMo Posted December 17, 2012 Author Posted December 17, 2012 function joinTeam() triggerServerEvent("setteam", player) guiSetVisible(windowjob, false) showCursor(false) guiSetInputEnabled(false) end addEventHandler("onClientGUIClick", GUIEditor_Button[1] , joinTeam, false)
AhmadQTR Posted December 17, 2012 Posted December 17, 2012 function joinTeam() triggerServerEvent("setteam", localPlayer) guiSetVisible(windowjob, false) showCursor(false) guiSetInputEnabled(false) end addEventHandler("onClientGUIClick", GUIEditor_Button[1] , joinTeam, false) Nobody is perfect , I'm nobody. Skype : ahmad.nasser37
Castillo Posted December 17, 2012 Posted December 17, 2012 Since he's using a defined argument server side, he must trigger localPlayer twice. triggerServerEvent ( "setteam", localPlayer, localPlayer ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
myonlake Posted December 17, 2012 Posted December 17, 2012 And to fix that, he can replace 'thePlayer' with 'source' instead. If I helped you, please click the like button on the right Thanks!
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