SA-MP Forums Archive
Retriving all Arguments (Using: {Float,_}... ) - 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: Retriving all Arguments (Using: {Float,_}... ) (/showthread.php?tid=543129)



Retriving all Arguments (Using: {Float,_}... ) - zT KiNgKoNg - 24.10.2014

I DO NOT WANT ANYONE POSTING WHO HAS NO IDEA WHAT THEY'RE ON ABOUT

I've actually never bothered using it, so I'd need some insight on how I'd go about retrieving all the arguments and adding them to a Enum

pawn Код:
enum TestFunc
{
      Name[],
      PlotType = 0,
      Float: pPos[]
}

stock TestFunc(Name[], Plot = 0, {Float,_}:...)
{
    if(numargs() == 2)
    {
        printf("Unable to add the runway plot as no points where given");
    } else {

        new paramPos = 2,
        paramCount = numargs();
        while(paramPos < paramCount)
        {

        }
    }
}



Re: Retriving all Arguments (Using: {Float,_}... ) - zT KiNgKoNg - 25.10.2014

Still needed.


AW: Retriving all Arguments (Using: {Float,_}... ) - Nero_3D - 25.10.2014

First of all you need an array to store the information, an enum is just a enumeration of constants
pawn Код:
enum TestFunc
{
    Name[32],
    PlotType = 0,
    Float: pPos[16]
}
new Array[TestFunc];

stock TestFunc(Name[], Plot = 0, {Float,_}:...) {
    if(numargs() == 2) {
        printf("Unable to add the runway plot as no points where given");
    } else {
        strcat((Array[Name][0] = EOS, Array[Name]), Name, 32);

        Array[PlotType] = Plot;

        new
            paramPos = 2,
            paramCount = numargs()
        ;
        while(paramPos < paramCount) {
            Array[paramPos - 2] = getarg(paramPos);
        }
    }
}



Re: Retriving all Arguments (Using: {Float,_}... ) - zT KiNgKoNg - 25.10.2014

Emmet_ has already helped me with this issue.