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
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.
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?
Anubhav Posted September 26, 2014 Author Posted September 26, 2014 Problem solved, the problem was: I was replacing the script in other folder LOL
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.
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 )
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.
justn Posted September 27, 2014 Posted September 27, 2014 just put the line out loop . You just copied what everyone said.
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