DRW Posted May 16, 2015 Share Posted May 16, 2015 addEvent ("team7", true) addEventHandler ("team7", getRootElement(), function(thePlayer) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) -- get his account name if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then setPlayerTeam (source, admins) setElementPosition (source,-183,2629,63.3) triggerClientEvent (source, "amosnose", source) elseif isObjectInACLGroup ("user."..accName, aclGetGroup ( "Moderator" ) ) then setPlayerTeam (source, mods) triggerClientEvent (source, "amosnose", source) setElementPosition (source,-183,2629,63.3) elseif isObjectInACLGroup ("user."..accName, aclGetGroup ( "SuperModerator" ) ) then setPlayerTeam (source, mods) triggerClientEvent (source, "amosnose", source) setElementPosition (source,-183,2629,63.3) elseif isObjectInACLGroup ("user."..accName, aclGetGroup ( "cmanager" ) ) then setPlayerTeam (source, mods) triggerClientEvent (source, "amosnose", source) setElementPosition (source,-183,2629,63.3) else outputChatBox ("No eres de ningún equipo de Staff.") end end) Errors: attempt to concatenate local "accname" (a boolean value) Bad argument @getPlayerAccount [Expected element at argument 1, got nil] Bad argument @getAccountName [Expected account at argument 1, got boolean] It's not working, why? Link to comment
Walid Posted May 16, 2015 Share Posted May 16, 2015 show me the client side function. Try this it should work addEvent ("team7", true) addEventHandler ("team7", getRootElement(), function() local account = getPlayerAccount (source) if not isGuestAccount(account) then local accName = getAccountName (account) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then setPlayerTeam (source, admins) setElementPosition (source,-183,2629,63.3) triggerClientEvent (source, "amosnose", source) elseif isObjectInACLGroup ("user."..accName, aclGetGroup ( "Moderator" ) ) then setPlayerTeam (source, mods) triggerClientEvent (source, "amosnose", source) setElementPosition (source,-183,2629,63.3) elseif isObjectInACLGroup ("user."..accName, aclGetGroup ( "SuperModerator" ) ) then setPlayerTeam (source, mods) triggerClientEvent (source, "amosnose", source) setElementPosition (source,-183,2629,63.3) elseif isObjectInACLGroup ("user."..accName, aclGetGroup ( "cmanager" ) ) then setPlayerTeam (source, mods) triggerClientEvent (source, "amosnose", source) setElementPosition (source,-183,2629,63.3) else outputChatBox ("No eres de ningún equipo de Staff.") end end end) Link to comment
DRW Posted May 16, 2015 Author Share Posted May 16, 2015 show me the client side function.Try this it should work addEvent ("team7", true) addEventHandler ("team7", getRootElement(), function() local account = getPlayerAccount (source) if not isGuestAccount(account) then local accName = getAccountName (account) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then setPlayerTeam (source, admins) setElementPosition (source,-183,2629,63.3) triggerClientEvent (source, "amosnose", source) elseif isObjectInACLGroup ("user."..accName, aclGetGroup ( "Moderator" ) ) then setPlayerTeam (source, mods) triggerClientEvent (source, "amosnose", source) setElementPosition (source,-183,2629,63.3) elseif isObjectInACLGroup ("user."..accName, aclGetGroup ( "SuperModerator" ) ) then setPlayerTeam (source, mods) triggerClientEvent (source, "amosnose", source) setElementPosition (source,-183,2629,63.3) elseif isObjectInACLGroup ("user."..accName, aclGetGroup ( "cmanager" ) ) then setPlayerTeam (source, mods) triggerClientEvent (source, "amosnose", source) setElementPosition (source,-183,2629,63.3) else outputChatBox ("No eres de ningún equipo de Staff.") end end end) Thank you so much! Link to comment
Walid Posted May 16, 2015 Share Posted May 16, 2015 Thank you so much! you are welcome 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