27.06.2012, 14:12
Why ask if it's correct, why not test it?
If you would have tested it, you would've found out instantly that it was wrong instead of having to wait for a response here!
I believe the correct format for an unspecified number of parameters is this:
Additionally, using ++ increments the integer, so you don't really want to do that inside the getarg function, as that doesn't appear to be what you're intending to do. You appear to be looking for the index + 1, which is what I have edited it to as an example.
Hope that helps.
If you would have tested it, you would've found out instantly that it was wrong instead of having to wait for a response here!
I believe the correct format for an unspecified number of parameters is this:
pawn Код:
GivePlayerWeapons(playerid, ...)
{
new
start = 1,
num = numargs();
for(new i = start; i < num; i++)
{
GivePlayerWeapon(playerid, getarg(i), getarg(i + 1));
}
return 1;
}
Hope that helps.