SA-MP Forums Archive
Admin Script - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Admin Script (/showthread.php?tid=255190)



Admin Script - PhantomDot1 - 14.05.2011

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 ?


Re: Admin Script - Biesmen - 14.05.2011

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.


Re: Admin Script - Sascha - 14.05.2011

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;
}



Re: Admin Script - DRIFT_HUNTER - 14.05.2011

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