2 errors easy to help!
#1

Hey guys, please help me, i fixed all my errors, just can't fix this 2...

Код:
C:\Users\Ricardo\Desktop\Radmin.pwn(279) : error 047: array sizes do not match, or destination array is too small
C:\Users\Ricardo\Desktop\Radmin.pwn(282) : error 047: array sizes do not match, or destination array is too small
C:\Users\Ricardo\Desktop\Radmin.pwn(304) : warning 203: symbol is never used: "ret_memcpy"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
The lines are in this cmd:
pawn Код:
dcmd_password(playerid, params[])
{
    if(gPlayerInfo[playerid][PLAYER_REGGED] != 1)
        return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: You must register first to do that! Use /register [password] to register and login.");
    else if(gPlayerInfo[playerid][PLAYER_LOGGED] == 0)
    return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: You must be logged-in to do that! Use /login [password] to login.");
    else
    {
    new tmp[30],
        tmp2[30],
        index;
    tmp = strtok(params, index);
    if(!strlen(tmp))
            return SendClientMessage(playerid, COLOUR_ORANGE, "USAGE: /password [password] [new password]");
    tmp2 = strtok(params, index);
    if(!strlen(tmp2))
    return SendClientMessage(playerid, COLOUR_ORANGE, "USAGE: /password [password] [new password]");
    new oldpassword = num_hash(tmp), newpassword = num_hash(tmp2);
    if(gPlayerInfo[playerid][PLAYER_PASS] == oldpassword)
    {
        if(oldpassword == newpassword)
            return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: Your old password can not be the same as your new password.");
            else if(strlen(tmp2) < gSettings[PASS_MIN] || strlen(tmp2) > gSettings[PASS_MAX])
            {
                new string[100]; format(string, sizeof(string), "ERROR: Your new password must be between %d and %d characters long!", gSettings[PASS_MIN], gSettings[PASS_MAX]);
                return SendClientMessage(playerid, COLOUR_ORANGE, string);
            }
        gPlayerInfo[playerid][PLAYER_PASS] = newpassword;
        new string[128]; format(string, sizeof(string), "You have successfully changed your password from \'%s\' to \'%s\'.", tmp, tmp2);
        return SendClientMessage(playerid, COLOUR_LIGHTBLUE, string);
    }
    else
        return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: Incorrect password.");
    }
}
And they are:

Line 279:
pawn Код:
tmp = strtok(params, index);
Line 282:
pawn Код:
tmp2 = strtok(params, index);
THANKS
Reply
#2

probably you have a old strtok so tmp and tmp2 should be sized 256, if it doesn't work try 128
Reply
#3

Done, Thanks man!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)