Jump to content

[Help]Why don't work ?


Black2

Recommended Posts

Posted

Hello, I was wondering because if I just change the command the resource does not work? for example the first with "givecash" command works but the second with the command "test" does not work because it happens that someone could explain to me? Thank you :)

1

function consoleGiveCash ( thePlayer, command, amount ) 
    givePlayerMoney ( thePlayer, amount )  
end 
addCommandHandler ( "givecash", consoleGiveCash  ) 

2

function consoleGiveCash ( thePlayer, command, amount ) 
    givePlayerMoney ( thePlayer, amount )  
end 
addCommandHandler ( "test", consoleGiveCash  ) 

Posted
Hello, I was wondering because if I just change the command the resource does not work? for example the first with "givecash" command works but the second with the command "test" does not work because it happens that someone could explain to me? Thank you :)

1

function consoleGiveCash ( thePlayer, command, amount ) 
    givePlayerMoney ( thePlayer, amount )  
end 
addCommandHandler ( "givecash", consoleGiveCash  ) 

2

function consoleGiveCash ( thePlayer, command, amount ) 
    givePlayerMoney ( thePlayer, amount )  
end 
addCommandHandler ( "test", consoleGiveCash  ) 

Because there is command in mta that have the same name

Proof : http://imgur.com/a/reWuN

Posted

Wiki of addCommandHandler:

"This function will attach a scripting function (handler) to a console command, so that whenever a player or administrator uses the command the function is called. Note: You cannot use "list" or "test" as command name."

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...