SA-MP Forums Archive
Loading String Problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Loading String Problem (/showthread.php?tid=295915)



Loading String Problem - park4bmx - 08.11.2011

im loading the players password as a string and trying to show it on a Dialog
like this
pawn Код:
new password[20+1];
INI_ParseFile(file, "PlayerPassword", false, true, playerid, true, false );
GetPVarString(playerid, "Password", password, sizeof password);
new Str[400];format(Str,sizeof(Str),"Pass |%s|",password);
ShowPlayerDialog(playerid, SQLogin, DIALOG_STYLE_INPUT, "Your Pass", Str, "Ok", "");
The problem is that the loaded string does even show :X
this is what it shows
Код:
Pass ||
do i need to format the loaded string into something else ?


Re: Loading String Problem - Kingunit - 08.11.2011

Are you using enums? And lower your string to 128 or something. 24 will be also enough I think so.


Re: Loading String Problem - park4bmx - 08.11.2011

Quote:
Originally Posted by Kingunit
Посмотреть сообщение
Are you using enums? And lower your string to 128 or something. 24 will be also enough I think so.
no im i didnt include the password in the enum (but ill try it now)
and i used that big string becouse first i thought it was to small :X
EDIT
still nothing :/


Re: Loading String Problem - park4bmx - 08.11.2011

when i use if(!strcmp( it works fine it does detect it but i cant get the string into Dialog or into SendClientMessage


Re: Loading String Problem - park4bmx - 09.11.2011

still having this problem


Re: Loading String Problem - park4bmx - 09.11.2011

Quote:
Originally Posted by ******
Посмотреть сообщение
You are using y_ini, can you post your "PlayerPassword" callback please? And how do you save the data? Do you use ini sections? If you are using YSI I suggest you get the latest version and use the user system built in.
i did get the new YSI but still the same
here take a look
pawn Код:
//First try was like this
forward PlayerPassword(playerid, name[], value[]);
public PlayerPassword(playerid, name[], value[])
{
if(!strcmp(name,"Password"))SetPVarString(playerid,"Password", value);
}
//then i tried like this
forward PlayerPassword(playerid, name[], value[]);
public PlayerPassword(playerid, name[], value[])
{
if(!strcmp(name,"Password")){format(PlayerInfo[playerid][Password], 30, "%s", value);}
}
//Tried it with enum [EDIT]
GetPVarString(playerid, "Password", PlayerInfo[playerid][Password], 30;
still nothing :X
EDIT
ohh and there is no problem with the saving it save perfectly in the file
pawn Код:
new INI:Acc = INI_Open(file);
            {
                INI_WriteString(Acc,"Password", inputtext);



Re: Loading String Problem - park4bmx - 11.11.2011

Quote:
Originally Posted by ******
Посмотреть сообщение
Loading doesn't seem to work that well with data not in sections (I'm not sure why).
is there any other method i can use to load it ?