Admin Script
#1

im now doing the normal admin script on the samp wiki, and it said that using it requires "ReturnUser", "strtok" and "IsNumeric". where can i find these and plz tell me how do i use them ?
Reply
#2

Ehm, do not use them. That's what I suggest you to do.

I suggest you to create your own adminscript via ZCMD/DCMD and SSCANF2.
Reply
#3

here are the IsNumeric and strtok codes..
I don't have the ReturnUser... if you tell me what it does, I'll code it for you..
add this to your script:
pawn Код:
stock IsNumeric(const string[]) {
    new length=strlen(string);
    if (length==0) return false;
    for (new i = 0; i < length; i++) {
        if (
        (string[i] > '9' || string[i] < '0' && string[i]!='-' && string[i]!='+')
        || (string[i]=='-' && i!=0)                                            
        || (string[i]=='+' && i!=0)                                            
        ) return false;
    }
    if (length==1 && (string[0]=='-' || string[0]=='+')) return false;
    return true;
}
stock strtok(const string[], &index,seperator=' ')
{
    new length = strlen(string);
    new offset = index;
    new result[128];
    while ((index < length) && (string[index] != seperator) && ((index - offset) < (sizeof(result) - 1)))
    {
        result[index - offset] = string[index];
        index++;
    }

    result[index - offset] = EOS;
    if ((index < length) && (string[index] == seperator))
    {
        index++;
    }
    return result;
}
Reply
#4

IsNumeric is useful
Strtok is old,slow and replaced with sscanf or sscanf2(sscanf2 is plugin)
ReturnUser never used it so idk what it is about
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)