21.12.2013, 22:36
Ok i have WEIRED bug in my "blank" script...
Here is the thing
And here is what debug prints...(Please pay atention at lenght of the tmpPasStr2)
tmpPasStr2 is not mentioned anywhere except in these few lines and as i can see it has no connection with inputtext what so ever
Even more annoying thing is that it works perfect in dialog id 14 !
Oh and if i set tmpPasStr2 lenth to 11 its all fine...
Here is the thing
pawn Код:
if(dialogid == 14)
{
if(!response) return SelectTextDraw(playerid, red);
if(strlen(inputtext) < 4) return ShowPlayerDialog(playerid, 14, DIALOG_STYLE_INPUT, "Login - Password", embed_red"[GRESKA]"embed_grey"Password mora da ima makar 4 karaktera\nPassword:", "U redu", "Nazad");
SetPVarString(playerid, "RegisterPassword", inputtext);
SetPVarString(playerid, "RegisterPasswordRepeat", "");
new tmpPassStr[10];
for(new i = 0; i < strlen(inputtext) && i < 10; i++)
{
tmpPassStr[i] = ']';
}
SetPlayerTextDrawInputValue3(playerid, tmpPassStr);
SetPlayerTextDrawInputValue4(playerid, " ");//Clearing Repeat password
SelectTextDraw(playerid, red);
return 1;
}
if(dialogid == 15)
{
if(!response) return SelectTextDraw(playerid, red);
if(strlen(inputtext) < 4) return ShowPlayerDialog(playerid, 15, DIALOG_STYLE_INPUT, "Login - Password", embed_red"[GRESKA]"embed_grey"Password mora da ima makar 4 karaktera\nPonoviti password:", "U redu", "Nazad");
new string[24]; GetPVarString(playerid, "RegisterPassword", string);
if(strcmp(inputtext, string) != 0 || strlen(string) == 0) return ShowPlayerDialog(playerid, 15, DIALOG_STYLE_INPUT, "Login - Password", embed_red"[GRESKA]"embed_grey"Passwordi se ne poklapaju\nPonoviti password:", "U redu", "Nazad");
SetPVarString(playerid, "RegisterPasswordRepeat", inputtext);
//Start of the problem
new tmpPassStr2[10];
for(new i = 0; i < strlen(inputtext) && i < 10; i++)
{
tmpPassStr2[i] = ']';
SendDebugEx(playerid, "tmpPassStr[%d] = '%s'", i,tmpPassStr2);
}
//At these point tmpPassStr2 already have ] * sizeof inputtext + inputtext characters
SendDebugEx(playerid, "END - '%s'", tmpPassStr2);
SetPlayerTextDrawInputValue4(playerid, tmpPassStr2);
SelectTextDraw(playerid, red);
return 1;
}
Код:
[00:34:33] [DEBUG]{C0C0C0}tmpPassStr[0] = ']' [00:34:33] [DEBUG]{C0C0C0}tmpPassStr[1] = ']]' [00:34:33] [DEBUG]{C0C0C0}tmpPassStr[2] = ']]]' [00:34:33] [DEBUG]{C0C0C0}tmpPassStr[3] = ']]]]' [00:34:33] [DEBUG]{C0C0C0}tmpPassStr[4] = ']]]]]' [00:34:33] [DEBUG]{C0C0C0}tmpPassStr[5] = ']]]]]]' [00:34:33] [DEBUG]{C0C0C0}tmpPassStr[6] = ']]]]]]]' [00:34:33] [DEBUG]{C0C0C0}tmpPassStr[7] = ']]]]]]]]' [00:34:33] [DEBUG]{C0C0C0}tmpPassStr[8] = ']]]]]]]]]' [00:34:33] [DEBUG]{C0C0C0}tmpPassStr[9] = ']]]]]]]]]]' [00:34:33] [DEBUG]{C0C0C0}tmpPassStr[10] = ']]]]]]]]]]]wewewewewewe' [00:34:33] [DEBUG]{C0C0C0}END - ']]]]]]]]]]]wewewewewewe'
Even more annoying thing is that it works perfect in dialog id 14 !
Oh and if i set tmpPasStr2 lenth to 11 its all fine...