maky55 Posted July 6, 2017 Share Posted July 6, 2017 Hello, scripting newb here! I'm trying to make a test script that output True or False depending if the user is on the specified account (2kjoe2k), here is the script: function getPlayerAccountName(playerSource, commandName) local accname = getAccountName(getPlayerAccount(playerSource)) if accname == "2kjoe2k" then outputChatBox("True") else outputChatBox("False") end end addCommandHandler("test", getPlayerAccountName) It's probably because I'm a newb but I can't get it to work. It doesn't post anything to chat and I get no errors with debugscript 3. Can anyone help? Thanks. Link to comment
pa3ck Posted July 6, 2017 Share Posted July 6, 2017 Yea... the command "test" cannot be used in MTA, your code looks fine and will work as soon as you change the command to something else, like "myaccount". 1 Link to comment
maky55 Posted July 6, 2017 Author Share Posted July 6, 2017 4 minutes ago, pa3ck said: Yea... the command "test" cannot be used in MTA, your code looks fine and will work as soon as you change the command to something else, like "myaccount". Thank you, I can't believe I didn't think to change the name of the command! Link to comment
pa3ck Posted July 6, 2017 Share Posted July 6, 2017 Who would actually think that the problem might be with the command name..? I found out the hard way as well... You're welcome. 2 Link to comment
koragg Posted July 6, 2017 Share Posted July 6, 2017 I wasted hours fixing a completely perfect script of mine until I just went YOLO and changed the command because there was nothing else left to do Fun times... (not) 1 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