CJGrove Posted January 16, 2008 Share Posted January 16, 2008 I scripted this but it doesn't work. It says that i dont have the rights but i have added this and this on moderator on the acl file... function admingivecash ( source, commandName, ammount ) local playeraccount = getClientAccount ( source ) if ( playeraccount ) then if ( ammount ~= "" and ammount ~= nil ) then if ( hasObjectPermissionTo ( playerSource, "function.admingivecash", false ) ) then if ( hasObjectPermissionTo ( getThisResource (), "function.admingivecash", true ) ) then setmoney = setPlayerMoney ( source, ammount, 0 ) else outputChatBox ( "Admingivecash: The admin resource is not able to give cash to players. Please give this resource access to 'function.admingivecash' in the ACL to use this function.", playerSource ) end else outputChatBox ( "Admingivecash: You don't have permissions to use this command.", playerSource ) end if ( setmoney ) then outputChatBox ( "Money set!", source , 66, 237, 251 ) else outputChatBox ( "Money was NOT set!", source , 66, 237, 251 ) end end end end Link to comment
Jumba' Posted January 16, 2008 Share Posted January 16, 2008 Make a new group for it, so it'll be like "admingivecash"> "aGiveCash" /> "resource.command" /> "aGiveCash"> "function.admingivecash" access="true"/> try that, maybe that works, and its better than putting it in moderator, if something malfunctions all it can do is set money = / Link to comment
CJGrove Posted January 16, 2008 Author Share Posted January 16, 2008 I'm getting an error now -.-' [21:16:59] WARNING: command.lua: Bad argument @ 'hasObjectPermissionTo' - Line: 483 stupid script... line 483 would be: if ( hasObjectPermissionTo ( playerSource, "function.admingivecash", false ) ) then Edit: error fixed it's working now thank you i used playerSource instead of source so... i'm going to post this as a snippet now... Link to comment
eAi Posted January 16, 2008 Share Posted January 16, 2008 You should really be using the ACL resource.YOURRESOURCENAME.admingivecash - thats the standard. 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