Retriving all Arguments (Using: {Float,_}... )
#1

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)
        {

        }
    }
}
Reply
#2

Still needed.
Reply
#3

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);
        }
    }
}
Reply
#4

Emmet_ has already helped me with this issue.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)