Need Help - Newbie Scripter dont expect much
I'm working on my first plugin, and its desiged to stack multiple people on the admin that gave the command. Heres my product, it compiles fine but the problem is it just does work, plain and simple. I have a feeling its a problem with the loop more than anything, but I'm stumped. Help is much appriciated.
Also 1 more question. I'm having trouble figuring out the difference between the commands Code:
Code:
Thanks for all your help eXist. Code:
|
There is no difference, the last parameter specifies the minimal amount of arguments, but every command has at least one argument (namely the command name itself), so 0 and 1 will have the same effect. I think.
You should learn how to indent code properly ;) Code:
Your problem was in the loop control structure. You had: Code:
The program will do this on the for loop: Code:
1) Execute the initializer 2) Check condition; if it's false, don't continue 3) Execute the loop body 4) Execute the increment part 5) Jump to 2 In your case, it will do this: 1) Execute the initializer: set a to 0 2) Check condition: Firstly, you'll need to know something about the comma operator: If you write: a,b a will be evaluated first, and the value of the expression will be b, which will be evaluated second So, you have this condition: a<playercount,a++ a<playercount will be evaluated first, but it's value gets lost, so it doesn't matter Then, a++ will be evaluated. The value of the whole a<playercount,a++ expression will be the value of a++ (as it's the right part of the comma operator). a++ increments a, but its value is still a (as opposed to ++a, which increments a, and its value is the already incremented a). So, a will be set to 1, and the value of a++ will be the original a, which is 0, so that the value of a<playercount,a++ will be also 0. 0 means false, so the loop is not continued, because the condition is false. So your loop body is never entered. When you change it to: Code:
|
Thank you very much for the complete and thurough reply. It is working correctly now and the funny thing is I meant to put a semi colen there, but hit comma by accident and at that point I didnt know what a comma was, finally in the end I learned what is was from you post. (sorry i ramble alot)
Thanks alot eXist` |
Code:
The first is the command itself. :) |
Good work V3x
thanks |
| All times are GMT -4. The time now is 10:00. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.