Dialog password always returns true.
#1

Hey, I've been trying to figure out how to fix this:
PHP код:
if(!strcmp(inputtextPlayerInfo[playerid][pPassword], false)) 
What ever I type in the dialog, it returns true.
Reply
#2

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])?
Reply
#3

Hello.
I don't know if this way can work but try it :
PHP код:
if(!strcmp(inputtextPlayerInfo[playerid][pPassword], falsestrlen(PlayerInfo[playerid][pPassword]))) 
Reply
#4

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.
Reply
#5

Show us your enum PlayerInfo and your load function.
Reply
#6

Loading: http://pastebin.com/Amvhc6KT
Log in: http://pastebin.com/viT5gZEL
Disconnected: http://pastebin.com/NqnCza8T

Full GM: http://pastebin.com/nFQJq3mp
Reply
#7

398...400
PHP код:
                SetSpawnInfo(playerid00PlayerInfo[playerid][pPosX], PlayerInfo[playerid][pPosY], PlayerInfo[playerid][pPosZ], 359.2573000000);
                
SpawnPlayer(playerid);
                
SetPlayerPos(playeridPlayerInfo[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(inputtextPlayerInfo[playerid][pPassword], false))
            {
                
TogglePlayerSpectating(playerid0);
                
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(playerid00PlayerInfo[playerid][pPosX], PlayerInfo[playerid][pPosY], PlayerInfo[playerid][pPosZ], 359.2573000000);
                
SpawnPlayer(playerid);
                
SetPlayerPos(playeridPlayerInfo[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(playeridPlayerInfo[playerid][pInterior]);
                
printf("Interior : %i"PlayerInfo[playerid][pInterior]);
                
SetPlayerVirtualWorld(playeridPlayerInfo[playerid][pWorld]);
                
printf("VirtualWorld : %i"PlayerInfo[playerid][pWorld]);
                
SetPlayerScore(playeridPlayerInfo[playerid][pPlayerLevel]);
                
printf("Level : %i"PlayerInfo[playerid][pPlayerLevel]);
                
GivePlayerMoney(playeridPlayerInfo[playerid][pMoney]);
                
printf("Money : %i"PlayerInfo[playerid][pMoney]);
                
SetPlayerSkin(playeridPlayerInfo[playerid][pSkin]);
                
printf("Skin : %i"PlayerInfo[playerid][pSkin]);
            } 
Test it and post what the console return.
Reply
#8

http://prntscr.com/b3s3ei
Reply
#9

Delete your saved player's file. Register again. Disconnect and try to log you.
Reply
#10

After reg and log out: http://prntscr.com/b3u9dj
After login: http://prntscr.com/b3u9pe
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)