Dialog password always returns true. -
Luicy. - 13.05.2016
Hey, I've been trying to figure out how to fix this:
PHP код:
if(!strcmp(inputtext, PlayerInfo[playerid][pPassword], false))
What ever I type in the dialog, it returns true.
Re: Dialog password always returns true. -
Konstantinos - 13.05.2016
strcmp returns true (strings are not equal even if they are) or the statement is always true (any password you input, it says it is equal to
PlayerInfo[playerid][pPassword])?
Re: Dialog password always returns true. -
Dayrion - 13.05.2016
Hello.
I don't know if this way can work but try it :
PHP код:
if(!strcmp(inputtext, PlayerInfo[playerid][pPassword], false, strlen(PlayerInfo[playerid][pPassword])))
Re: Dialog password always returns true. -
Luicy. - 13.05.2016
The problem was that the file was empty, but it's fixed, But I got another problem, This wont work:
SetPlayerPos(playerid, PlayerInfo[playerid][pPosX], PlayerInfo[playerid][pPosY], PlayerInfo[playerid][pPosZ]);
The positions is saved in the file, But it wont load, neither want the skin.
Re: Dialog password always returns true. -
Dayrion - 13.05.2016
Show us your enum PlayerInfo and your load function.
Re: Dialog password always returns true. -
Luicy. - 13.05.2016
Loading:
http://pastebin.com/Amvhc6KT
Log in:
http://pastebin.com/viT5gZEL
Disconnected:
http://pastebin.com/NqnCza8T
Full GM:
http://pastebin.com/nFQJq3mp
Re: Dialog password always returns true. -
Dayrion - 13.05.2016
398...400
PHP код:
SetSpawnInfo(playerid, 0, 0, PlayerInfo[playerid][pPosX], PlayerInfo[playerid][pPosY], PlayerInfo[playerid][pPosZ], 359.2573, 0, 0, 0, 0, 0, 0);
SpawnPlayer(playerid);
SetPlayerPos(playerid, PlayerInfo[playerid][pPosX], PlayerInfo[playerid][pPosY], PlayerInfo[playerid][pPosZ]);
You set 2 times the pos of the player. I don't think it's the problem come from here.
Put some print to know where the problem come from ;
PHP код:
if(!strcmp(inputtext, PlayerInfo[playerid][pPassword], false))
{
TogglePlayerSpectating(playerid, 0);
INI_ParseFile(Path(playerid),"CheckAndLoad_%s",.bExtra = true, .extra = playerid);
print("Loaded player's data ...");
SendClientMessage(playerid,-1,"{FFFFFF}[{82CAFF}NCRP{FFFFFF}] Welcome back to NCRP, Enjoy your stay here!");
SetSpawnInfo(playerid, 0, 0, PlayerInfo[playerid][pPosX], PlayerInfo[playerid][pPosY], PlayerInfo[playerid][pPosZ], 359.2573, 0, 0, 0, 0, 0, 0);
SpawnPlayer(playerid);
SetPlayerPos(playerid, PlayerInfo[playerid][pPosX], PlayerInfo[playerid][pPosY], PlayerInfo[playerid][pPosZ]);
printf("X: %.2f - Y: %.2f - Z: %.2f", PlayerInfo[playerid][pPosX], PlayerInfo[playerid][pPosY], PlayerInfo[playerid][pPosZ]);
SetPlayerInterior(playerid, PlayerInfo[playerid][pInterior]);
printf("Interior : %i", PlayerInfo[playerid][pInterior]);
SetPlayerVirtualWorld(playerid, PlayerInfo[playerid][pWorld]);
printf("VirtualWorld : %i", PlayerInfo[playerid][pWorld]);
SetPlayerScore(playerid, PlayerInfo[playerid][pPlayerLevel]);
printf("Level : %i", PlayerInfo[playerid][pPlayerLevel]);
GivePlayerMoney(playerid, PlayerInfo[playerid][pMoney]);
printf("Money : %i", PlayerInfo[playerid][pMoney]);
SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
printf("Skin : %i", PlayerInfo[playerid][pSkin]);
}
Test it and post what the console return.
Re: Dialog password always returns true. -
Luicy. - 14.05.2016
http://prntscr.com/b3s3ei
Re: Dialog password always returns true. -
Dayrion - 14.05.2016
Delete your saved player's file. Register again. Disconnect and try to log you.
Re: Dialog password always returns true. -
Luicy. - 14.05.2016
After reg and log out:
http://prntscr.com/b3u9dj
After login:
http://prntscr.com/b3u9pe