Loading String Problem
#1

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 ?
Reply
#2

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

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 :/
Reply
#4

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

still having this problem
Reply
#6

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);
Reply
#7

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 ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)