~DarkRacer~ Posted June 26, 2013 Posted June 26, 2013 Hey all, i'm having problem with adding an Object to an ACL group, i don't know why but when i use aclGroupAddObject it always returns FALSE maybe my code is wrong.. P.S.: i added the group the the acl and the resource has admin rights. here's the code: -- Server Side Script function addToGroup(group) group = aclGetGroup(group) if not (group == false) and not (group == nil) then account = getPlayerAccount(source) if not isGuestAccount(account) then name = getAccountName(account) add = aclGroupAddObject(group, "user"..name) if add then outputChatBox("The object has been added successfully to the group",getRootElement(),0,255,0,true) triggerClientEvent(source,"hideall",source) else outputChatBox("This object is already in the group",source,255,0,0,true) end else outputChatBox("You have to be registered before",source,255,0,0,true) end else outputChatBox("The group doesn't exist in the ACL group",source,255,0,0,true) end end addEvent("addToGroup",true) addEventHandler("addToGroup",getRootElement(), addToGroup) -- Client Side Script addEventHandler("onClientGUIClick",getRootElement(), function() if source == GUIEditor.button[1] then group = "V.I.P" triggerServerEvent("addToGroup", getLocalPlayer(), group) end end )
-.Paradox.- Posted June 26, 2013 Posted June 26, 2013 Debugscript 3 If you're looking for a cheap paid scripter, don't hesitate to contact me. Great minds discuss ideas, Average minds discuss events and small minds discuss people.
iPrestege Posted June 26, 2013 Posted June 26, 2013 aclGroupAddObject ( aclGetGroup( tostring ( group ) ),"user."..name)
~DarkRacer~ Posted June 26, 2013 Author Posted June 26, 2013 aclGroupAddObject ( aclGetGroup( tostring ( group ) ),"user."..name) It didn't work.. Debugscript 3 no errors
PaiN^ Posted June 26, 2013 Posted June 26, 2013 Try this one : -- Server Side Script function addToGroup( group ) group = aclGetGroup( group ) if group == false or group == nil then error( "The value of the 'group' is nil or false !" ) end account = getPlayerAccount( source ) if not isGuestAccount( account ) then local name = getAccountName( account ) local add = aclGroupAddObject( group, "user."..name ) if add then outputChatBox( "The object has been added successfully to the group", root, 0, 255, 0, true ) triggerClientEvent( source, "hideall", source ) else outputChatBox( "This object is already in the group", source, 255, 0, 0, true ) end else outputChatBox( "You have to be registered before", source, 255, 0, 0, true ) end else outputChatBox( "The group doesn't exist in the ACL group", source, 255, 0, 0, true ) end addEvent( "addToGroup", true ) addEventHandler( "addToGroup", root, addToGroup ) " Keep Thinking Different . " - Steve Jops -------------------- Don't send me PMs asking for help, I Won't reply !
~DarkRacer~ Posted June 27, 2013 Author Posted June 27, 2013 Try this one : -- Server Side Script function addToGroup( group ) group = aclGetGroup( group ) if group == false or group == nil then error( "The value of the 'group' is nil or false !" ) end account = getPlayerAccount( source ) if not isGuestAccount( account ) then local name = getAccountName( account ) local add = aclGroupAddObject( group, "user."..name ) if add then outputChatBox( "The object has been added successfully to the group", root, 0, 255, 0, true ) triggerClientEvent( source, "hideall", source ) else outputChatBox( "This object is already in the group", source, 255, 0, 0, true ) end else outputChatBox( "You have to be registered before", source, 255, 0, 0, true ) end else outputChatBox( "The group doesn't exist in the ACL group", source, 255, 0, 0, true ) end addEvent( "addToGroup", true ) addEventHandler( "addToGroup", root, addToGroup ) Thanks it's working but i don't understand what did you do?
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