Black2 Posted August 30, 2016 Share Posted August 30, 2016 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 ) Link to comment
bebo1king Posted August 30, 2016 Share Posted August 30, 2016 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 Link to comment
Bonsai Posted August 30, 2016 Share Posted August 30, 2016 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." 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