JoZeFSvK Posted October 12, 2013 Share Posted October 12, 2013 (edited) Client addEvent( "onNoob", true ) addEventHandler( "onNoob", root, function() local sound = playSound("noob.mp3") end ) Server rRoot = getResourceRootElement(getThisResource()) local accountname = getAccountName (getPlayerAccount(player)) if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then function noob (player, command) outputChatBox( "Player "..getPlayerName(player).." : say you are NOOB! ", root, 255, 255, 255, true ) triggerClientEvent("onNoob", root) else outputChatBox ( "You dont have permission for this command", player, 255, 0, 0, true ) return end end addCommandHandler("noob", noob) Ehm it is good ? with alc ? and when i will want acl Admin and Supermoderator i must add new line or ? Edited October 12, 2013 by Guest Link to comment
Mittell Buurman Posted October 12, 2013 Share Posted October 12, 2013 addEvent( "onHeadshot", true ) addEventHandler( "onHeadshot", root, function() playSound("noob.mp3", false) --boolean prevents looping, just to make sure. end ) Link to comment
JoZeFSvK Posted October 12, 2013 Author Share Posted October 12, 2013 Ehm i think acl it good ? Link to comment
Castillo Posted October 12, 2013 Share Posted October 12, 2013 No, you must put it inside the function. Link to comment
JoZeFSvK Posted October 12, 2013 Author Share Posted October 12, 2013 rRoot = getResourceRootElement(getThisResource()) local accountname = getAccountName (getPlayerAccount(player)) function noob (player, command) if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then outputChatBox( "Player "..getPlayerName(player).." : say you are NOOB! ", root, 255, 255, 255, true ) triggerClientEvent("onNoob", root) else outputChatBox ( "You dont have permission for this command", player, 255, 0, 0, true ) return end end addCommandHandler("noob", noob) I can not like this but I have problem of bind more functions Link to comment
Castillo Posted October 12, 2013 Share Posted October 12, 2013 local accountname = getAccountName (getPlayerAccount(player)) That has to go inside "noob" function. Link to comment
JoZeFSvK Posted October 13, 2013 Author Share Posted October 13, 2013 local accountname = getAccountName (getPlayerAccount(player)) That has to go inside "noob" function. Aha thank you so much. and when i will want 2 groups ? Admin and Supermoderator ? i must duplicate this line or can edit this line ? if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then Link to comment
mint3d Posted October 13, 2013 Share Posted October 13, 2013 (edited) you can simply do if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) or isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Supermoderator " ) ) then Edited October 13, 2013 by Guest Link to comment
TAPL Posted October 13, 2013 Share Posted October 13, 2013 @mint3d, IF statement not needed after 'or'. Link to comment
JoZeFSvK Posted October 13, 2013 Author Share Posted October 13, 2013 you can simply do if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) or isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Supermoderator " ) ) then When i add this on script then i see message end expected to close function at line near and when i add "or if isObject" then i see unexpected symbol near if in debugscript 3 Link to comment
mint3d Posted October 13, 2013 Share Posted October 13, 2013 (edited) try if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) or isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Supermoderator " ) ) then Edited October 13, 2013 by Guest Link to comment
Castillo Posted October 13, 2013 Share Posted October 13, 2013 That doesn't make any sense. Link to comment
JoZeFSvK Posted October 13, 2013 Author Share Posted October 13, 2013 try if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) or isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Supermoderator " ) ) then wrong Link to comment
TAPL Posted October 13, 2013 Share Posted October 13, 2013 try if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) or isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Supermoderator " ) ) then wrong A bracket is missing. Link to comment
mint3d Posted October 13, 2013 Share Posted October 13, 2013 if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" )) or isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Supermoderator " ) ) then Link to comment
JoZeFSvK Posted October 13, 2013 Author Share Posted October 13, 2013 if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" )) or isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Supermoderator " ) ) then Thank you so much work 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