SA-MP Forums Archive
For Loop help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: For Loop help (/showthread.php?tid=612286)



For Loop help - Tass007 - 16.07.2016

Hi I'm new to for loops (trying it for the first time) and I'm getting warning 202: number of arguments does not match definition.

Line is
PHP код:
    for(new 1!= 311i++) AddPlayerClass(i, -1968.9745,137.8568,27.6875,88.85340,0000); 
I know that my AddPlayerClass is correct so it's something within my loop but I'm not quite sure.

As always person whom offers to help will get +1 Rep.

Thanks for your time.


Re: For Loop help - Stinged - 16.07.2016

Actually AddPlayerClass is incorrect, there's nothing wrong with the loop.

Add a zero to the end. It's supposed to be:
Код:
AddPlayerClass(skinid, x, y, z, a, weapon_1, ammo_1, weapon_2, ammo_2, weapon_3, ammo_3);



Re: For Loop help - Sawalha - 16.07.2016

you forgot the last parameter of weapon3's ammo in AddPlayerClass function

edit: too late


Re: For Loop help - Konstantinos - 16.07.2016

This warning is shown to functions only, for loop has nothing to do with it. It is actually not correct, you are missing 1 parameter (weapon3_ammo).


Re: For Loop help - Tass007 - 16.07.2016

Quote:
Originally Posted by Sawalha
Посмотреть сообщение
you forgot the last parameter of weapon3's ammo in AddPlayerClass function

edit: too late
Quote:
Originally Posted by Stinged
Посмотреть сообщение
Actually AddPlayerClass is incorrect, there's nothing wrong with the loop.

Add a zero to the end. It's supposed to be:
Код:
AddPlayerClass(skinid, x, y, z, a, weapon_1, ammo_1, weapon_2, ammo_2, weapon_3, ammo_3);
Awesome thanks guys. SOLVED!