Jump to content

[Admingivecash] Why doesn't it work?


Recommended Posts

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 ) 
        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 ) 
        outputChatBox ( "Admingivecash: You don't have permissions to use this command.", playerSource ) 
         if ( setmoney ) then 
            outputChatBox ( "Money set!", source , 66, 237, 251 ) 
            outputChatBox ( "Money was NOT set!", source , 66, 237, 251 ) 

Link to comment

Make a new group for it, so it'll be like

      "aGiveCash" /> 
      "resource.command" /> 

      "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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...