[SOLVED] dini!!!
#1

Hey,
Here's my code:
pawn Код:
new pin[255]; // I tried changing this value to MAX_STRING, but I get same error...
if(CheckPlayerPIN(pName,pin) == 0) ErrorMsg(playerid,"Your PIN code is incorrect!"); //ERROR HERE
And CheckPlayerPIN(...):
pawn Код:
stock CheckPlayerPIN(Owner[],pin[])
{
    if(!dini_Exists(Owner)) return -1;
    new tmp[255];
    tmp = dini_Get(Owner,"AccountPass");
    if(!strcmp(tmp,pin,true)) return 1;
    return 0;
}
error 048: array dimensions do not match
Reply
#2

Change
pawn Код:
new tmp[255];
to
pawn Код:
new tmp[127];
Change
pawn Код:
new pin[255];
to
pawn Код:
new pin[128];
Then lastly change
pawn Код:
tmp = dini_Get(Owner,"AccountPass");
to
pawn Код:
format(tmp, sizeof(tmp), "%s", dini_Get(Owner,"AccountPass"));
The last is not necaserry, only if you still get errors.
Reply
#3

Quote:
Originally Posted by lrZ^ aka LarzI
Change
pawn Код:
new tmp[255];
to
pawn Код:
new tmp[127];
Change
pawn Код:
new pin[255];
to
pawn Код:
new pin[128];
Then lastly change
pawn Код:
tmp = dini_Get(Owner,"AccountPass");
to
pawn Код:
format(tmp, sizeof(tmp), "%s", dini_Get(Owner,"AccountPass"));
The last is not necaserry, only if you still get errors.
Oops... I just noticed that the error was with pName... cause I use it as global variable and the right array is pName[playerid]...
Thanks for reply and sorry for my stupidity..

Reply
#4

Lol, giant failure by me x)
Good thing you did solve it though
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)