What's get string using GetArg ?
#1

Exemple:

pawn Код:
AddBadWords(text,  "Char", "Red");


// Function ( not completed )
stock AddBadWorld(string[], ...)
{
    for(new percorrer, argumentos = numargs(); percorrer != argumentos; ++percorrer)
    {
        {
            printf("%s", getarg(percorrer, 0));
        }
    }
   
    #pragma unused string
    return 1;
}
i Need show's:

Код:
"Char"
"Red"
Thks.
Reply
#2

Try this... works for me and ignore the warning ( i don't know how to fix it)
pawn Код:
stock AddBadWords(string[], ...)
{
    new temp[2];
    for(new percorrer, argumentos = numargs(); percorrer != argumentos; ++percorrer)
    {
        new str[128],x=0;
        while(1){
            new chari=getarg(percorrer,x);
            format(temp,sizeof(temp),"%s",chari);
            strcat(str,temp);
            x++;
            if(chari==0) break;
        }
        printf("%s", str);
    }

    #pragma unused string
    return 1;
}
Reply
#3

Quote:
Originally Posted by Crazymax
Посмотреть сообщение
Try this... works for me and ignore the warning ( i don't know how to fix it)
pawn Код:
stock AddBadWords(string[], ...)
{
    new temp[2];
    for(new percorrer, argumentos = numargs(); percorrer != argumentos; ++percorrer)
    {
        new str[128],x=0;
        while(1){
            new chari=getarg(percorrer,x);
            format(temp,sizeof(temp),"%s",chari);
            strcat(str,temp);
            x++;
            if(chari==0) break;
        }
        printf("%s", str);
    }

    #pragma unused string
    return 1;
}
I fixed this width post of RyDer's.

Anything, http://pastebin.com/LQQEL3SS.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)