num hash problem
#1

pawn Код:
CMD:register(playerid,params[])
{
    if(gPlayerInfo[playerid][PLAYER_REGGED] == 1)
    return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: You have already registered!");
    else if(!params[0])
    return SendClientMessage(playerid, COLOUR_ORANGE, "USAGE: /register [password]");
    /*else if(strlen(params) < gSettings[PASS_MIN] || strlen(params) > gSettings[PASS_MAX])
    {
    new string[128];
        format(string, sizeof(string), "ERROR: Password must be between %d and %d characters long!", gSettings[PASS_MIN], gSettings[PASS_MAX]);
    return SendClientMessage(playerid, COLOUR_ORANGE, string);
    }*/

    else
    {
    new password = num_hash(params);
    gPlayerInfo[playerid][PLAYER_PASS] = password;
    gPlayerInfo[playerid][PLAYER_REGGED] = 1;
    gPlayerInfo[playerid][PLAYER_LOGGED] = 1;
    GetPlayerIp(playerid, gPlayerInfo[playerid][PLAYER_IP], 16);
    new string[128]; format(string, sizeof(string), "You have successfully registered your account with the password \'%s\'. You have been automatically logged in.", params);
    return SendClientMessage(playerid, COLOUR_LIGHTBLUE, string);
    }
}
This is command


problem
pawn Код:
D:\Server\filterscripts\script.pwn(181) : error 017: undefined symbol "num_hash"
D:\Server\filterscripts\script.pwn(200) : error 017: undefined symbol "num_hash"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.
Reply
#2

Wait that's another hash thingy.. never mind :/ I'm such a noob xD
Reply
#3

pawn Код:
stock num_hash(buf[])
{
    new length = strlen(buf),s1 = 1,s2 = 0,n;
    for(n = 0; n < length; n++)
    {
        s1 = (s1 + buf[n]) % 65521;
        s2 = (s2 + s1)     % 65521;
    }
    return (s2 << 16) + s1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)