JoZeFSvK Posted October 12, 2013 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
Mittell Buurman Posted October 12, 2013 Posted October 12, 2013 addEvent( "onHeadshot", true ) addEventHandler( "onHeadshot", root, function() playSound("noob.mp3", false) --boolean prevents looping, just to make sure. end )
JoZeFSvK Posted October 12, 2013 Author 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
Castillo Posted October 12, 2013 Posted October 12, 2013 local accountname = getAccountName (getPlayerAccount(player)) That has to go inside "noob" function.
JoZeFSvK Posted October 13, 2013 Author 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
mint3d Posted October 13, 2013 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
JoZeFSvK Posted October 13, 2013 Author 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
mint3d Posted October 13, 2013 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
JoZeFSvK Posted October 13, 2013 Author Posted October 13, 2013 try if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) or isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Supermoderator " ) ) then wrong
TAPL Posted October 13, 2013 Posted October 13, 2013 try if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) or isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Supermoderator " ) ) then wrong A bracket is missing.
mint3d Posted October 13, 2013 Posted October 13, 2013 if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" )) or isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Supermoderator " ) ) then
JoZeFSvK Posted October 13, 2013 Author Posted October 13, 2013 if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" )) or isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Supermoderator " ) ) then Thank you so much work
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