Pedro Colto Posted March 13, 2015 Share Posted March 13, 2015 tipo coloquei só para um cargo na acl poder digitar o comando mais n funciona o comando function giveAdminRights (playerSource, commandName, accountName) --add the function giveAdminRights and specify its arguments if accountName then --if there was an accountName entered then if isObjectInACLGroup ( 'user.'..getAccountName( getPlayerAccount( accountName ) ), aclGetGroup( 'Policia Militar' ) ) then aclGroupAddObject (aclGetGroup("VIP"), "user."..accountName) --add an ACL object using the form "user.[accountName]" to the ACL group "Admin" outputChatBox ("Account '"..accountName.."' succesfully added to the admin group", playerSource) --output a notification to the player who entered the command that the acocunt was successfully added else --else output an error message and the correct syntax of the command to the player who entered it outputChatBox ("No account name specified.", playerSource) outputChatBox ("Correct syntax: /giveAccountAdminRights [accountName]", playerSource) end end end addCommandHandler ("giveAccountAdminRights", giveAdminRights) --add a command "giveAccountAdminRights" and attch the function "giveAdminRights" to it Link to comment
Besta Posted March 13, 2015 Share Posted March 13, 2015 function giveAdminRights (playerSource, commandName, accountName) --add the function giveAdminRights and specify its arguments local accountName = getPlayerFromName(accountName) if accountName then --if there was an accountName entered then if isObjectInACLGroup ( 'user.'..getAccountName( getPlayerAccount( accountName ) ), aclGetGroup( 'Policia Militar' ) ) then aclGroupAddObject (aclGetGroup("VIP"), "user."..accountName) --add an ACL object using the form "user.[accountName]" to the ACL group "Admin" outputChatBox ("Account '"..accountName.."' succesfully added to the admin group", playerSource) --output a notification to the player who entered the command that the was successfully added else --else output an error message and the correct syntax of the command to the player who entered it outputChatBox ("No account name specified.", playerSource) outputChatBox ("Correct syntax: /giveAccountAdminRights [accountName]", playerSource) end end end addCommandHandler("giveAccountAdminRights", giveAdminRights) --add a command Obs:E lembre-se de colocar o resource na ACL de Admin Link to comment
Pedro Colto Posted March 14, 2015 Author Share Posted March 14, 2015 Besta tentei esse mais não funcionou ainda, oque poderia ser? Link to comment
xeon17 Posted March 14, 2015 Share Posted March 14, 2015 function giveAdminRights (playerSource, commandName, accountName) --add the function giveAdminRights and specify its arguments local theAccount = getPlayerFromName(accountName) if theAccount then --if there was an accountName entered then if isObjectInACLGroup ( 'user.'..getAccountName( getPlayerAccount( theAccount ) ), aclGetGroup( 'Policia Militar' ) ) then aclGroupAddObject (aclGetGroup("VIP"), "user."..theAccount) --add an ACL object using the form "user.[accountName]" to the ACL group "Admin" outputChatBox ("Account '"..theAccount.."' succesfully added to the admin group", playerSource) --output a notification to the player who entered the command that the was successfully added else --else output an error message and the correct syntax of the command to the player who entered it outputChatBox ("No account name specified.", playerSource) outputChatBox ("Correct syntax: /giveAccountAdminRights [accountName]", playerSource) end end end addCommandHandler("giveAccountAdminRights", giveAdminRights) --add a command Tente agora, não se esqueça de verificar /debugscript 3 quando você inicia o recurso ou use o comando. Link to comment
Pedro Colto Posted March 14, 2015 Author Share Posted March 14, 2015 Ainda não está funcionando Link to comment
Besta Posted March 15, 2015 Share Posted March 15, 2015 Besta tentei esse mais não funcionou ainda, oque poderia ser? Você colocou o resource na ACL de Admin? Link to comment
Death Posted March 15, 2015 Share Posted March 15, 2015 function giveAdminRights (playerSource, commandName, accountName) --add the function giveAdminRights and specify its arguments local theAccount = getPlayerFromName(accountName) if theAccount then --if there was an accountName entered then if isObjectInACLGroup ( 'user.'..getAccountName( getPlayerAccount( playerSource ) ), aclGetGroup( 'Policia Militar' ) ) then aclGroupAddObject (aclGetGroup("VIP"), "user."..theAccount) --add an ACL object using the form "user.[accountName]" to the ACL group "Admin" outputChatBox ("Account '"..theAccount.."' succesfully added to the admin group", playerSource) --output a notification to the player who entered the command that the was successfully added else --else output an error message and the correct syntax of the command to the player who entered it outputChatBox ("No account name specified.", playerSource) outputChatBox ("Correct syntax: /giveAccountAdminRights [accountName]", playerSource) end end end addCommandHandler("giveAccountAdminRights", giveAdminRights) --add a command se for o script q você pediu no outro topico essa é a solução 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