Question Info: Function, [...] is correct ? - SOLVED
#2

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:

pawn Код:
GivePlayerWeapons(playerid, ...)
{
    new
        start = 1,
        num = numargs();
    for(new i = start; i < num; i++)
    {
        GivePlayerWeapon(playerid, getarg(i), getarg(i + 1));
    }
    return 1;
}
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.
Reply


Messages In This Thread
Question Info: Function, [...] is correct ? - SOLVED, Thanks. - by Speed++ - 27.06.2012, 14:07
Re: Question Info: Function, [...] is correct ? - by JaTochNietDan - 27.06.2012, 14:12
Re: Question Info: Function, [...] is correct ? - by Speed++ - 27.06.2012, 14:16
Re: Question Info: Function, [...] is correct ? - SOLVED - by Speed++ - 28.06.2012, 23:35
Re: Question Info: Function, [...] is correct ? - SOLVED - by JaTochNietDan - 28.06.2012, 23:48

Forum Jump:


Users browsing this thread: 1 Guest(s)