Anubhav Posted September 26, 2014 Posted September 26, 2014 addCommandHandler("duty", function(p) for k,v in ipairs(players) do local acc = getPlayerAccount(p) This is only piece of code. Error: Expect element at argument one, got nil See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
Moderators IIYAMA Posted September 26, 2014 Moderators Posted September 26, 2014 did you checked p before the loop? To be honest it is a strange error, but please check your variables first. Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
Anubhav Posted September 26, 2014 Author Posted September 26, 2014 did you checked p before the loop?To be honest it is a strange error, but please check your variables first. Its realy strange dude, I don't know whats wrong. What do you mean by p was checked? See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
Anubhav Posted September 26, 2014 Author Posted September 26, 2014 Problem solved, the problem was: I was replacing the script in other folder LOL See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
TAPL Posted September 26, 2014 Posted September 26, 2014 It would be better to get the account outside the loop.
Anubhav Posted September 26, 2014 Author Posted September 26, 2014 It would be better to get the account outside the loop. Arnold told me to increase the performance by that and I did it. Anyways thanks to you too. See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
xXMADEXx Posted September 26, 2014 Posted September 26, 2014 It would be better to get the account outside the loop. Arnold told me to increase the performance by that and I did it. Anyways thanks to you too. He was wrong then, it is better performance to get the account outside the loop. addCommandHandler("duty", function(p) local acc = getPlayerAccount(p) for k,v in ipairs(players) do -- loop code end -- rest of your code end ) The Ultimate Lua Tutorial! | MTA PHP SDK
Anubhav Posted September 26, 2014 Author Posted September 26, 2014 Arnold told me to increase the performance by that and I did it. Anyways thanks to you too. He was wrong then, it is better performance to get the account outside the loop. addCommandHandler("duty", function(p) local acc = getPlayerAccount(p) for k,v in ipairs(players) do -- loop code end -- rest of your code end ) Damn you misunderstood that. I was telling TAPL is correct, he told me to take it of loop anyways. See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
#DRAGON!FIRE Posted September 26, 2014 Posted September 26, 2014 just put the line out loop . To Contact Me at Skype : [email protected]
justn Posted September 27, 2014 Posted September 27, 2014 just put the line out loop . You just copied what everyone said. Datastore - Store data to a database quickly. (Useful for saving scripted tables)
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