SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 08/11/2011, 07:21 PM   #1
park4bmx
High-roller
 
park4bmx's Avatar
 
Join Date: Dec 2009
Location: Samokov,Bulgaria
Posts: 2,626
Reputation: 229
Default Loading String Problem

im loading the players password as a string and trying to show it on a Dialog
like this
pawn Code:
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
Code:
Pass ||
do i need to format the loaded string into something else ?
park4bmx is online now   Reply With Quote
Old 08/11/2011, 07:32 PM   #2
Kingunit
High-roller
 
Kingunit's Avatar
 
Join Date: Dec 2010
Location: The Netherlands
Posts: 1,495
Reputation: 120
Default Re: Loading String Problem

Are you using enums? And lower your string to 128 or something. 24 will be also enough I think so.
__________________
Kingunit is offline   Reply With Quote
Old 08/11/2011, 07:38 PM   #3
park4bmx
High-roller
 
park4bmx's Avatar
 
Join Date: Dec 2009
Location: Samokov,Bulgaria
Posts: 2,626
Reputation: 229
Default Re: Loading String Problem

Quote:
Originally Posted by Kingunit View Post
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 :/
park4bmx is online now   Reply With Quote
Old 08/11/2011, 07:49 PM   #4
park4bmx
High-roller
 
park4bmx's Avatar
 
Join Date: Dec 2009
Location: Samokov,Bulgaria
Posts: 2,626
Reputation: 229
Default Re: Loading String Problem

when i use if(!strcmp( it works fine it does detect it but i cant get the string into Dialog or into SendClientMessage
park4bmx is online now   Reply With Quote
Old 09/11/2011, 05:22 PM   #5
park4bmx
High-roller
 
park4bmx's Avatar
 
Join Date: Dec 2009
Location: Samokov,Bulgaria
Posts: 2,626
Reputation: 229
Default Re: Loading String Problem

still having this problem
park4bmx is online now   Reply With Quote
Old 09/11/2011, 05:51 PM   #6
Y_Less
Beta Tester
 
Y_Less's Avatar
 
Join Date: Jun 2008
Location: 629 - git.io/Y
Posts: 18,325
Reputation: 2583
Default Re: Loading String Problem

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.
Y_Less is offline   Reply With Quote
Old 09/11/2011, 05:57 PM   #7
park4bmx
High-roller
 
park4bmx's Avatar
 
Join Date: Dec 2009
Location: Samokov,Bulgaria
Posts: 2,626
Reputation: 229
Default Re: Loading String Problem

Quote:
Originally Posted by Y_Less View Post
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 Code:
//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 Code:
new INI:Acc = INI_Open(file);
            {
                INI_WriteString(Acc,"Password", inputtext);
park4bmx is online now   Reply With Quote
Old 10/11/2011, 01:35 AM   #8
Y_Less
Beta Tester
 
Y_Less's Avatar
 
Join Date: Jun 2008
Location: 629 - git.io/Y
Posts: 18,325
Reputation: 2583
Default Re: Loading String Problem

Loading doesn't seem to work that well with data not in sections (I'm not sure why).
Y_Less is offline   Reply With Quote
Old 11/11/2011, 07:42 PM   #9
park4bmx
High-roller
 
park4bmx's Avatar
 
Join Date: Dec 2009
Location: Samokov,Bulgaria
Posts: 2,626
Reputation: 229
Default Re: Loading String Problem

Quote:
Originally Posted by Y_Less View Post
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 ?
park4bmx is online now   Reply With Quote
Old 12/11/2011, 01:19 PM   #10
Y_Less
Beta Tester
 
Y_Less's Avatar
 
Join Date: Jun 2008
Location: 629 - git.io/Y
Posts: 18,325
Reputation: 2583
Default Re: Loading String Problem

No, just put the data in sections.
Y_Less is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with string loading from sql / chat prefix 666 Help Archive 7 20/08/2011 10:11 AM
Loading a string with Dini? lawonama Help Archive 9 18/07/2011 09:10 PM
Loading Problem zxc1 Help Archive 3 27/04/2011 02:21 PM
Loading string from a file and inserting it into other string Ivan_Pantovic Help Archive 0 06/02/2011 08:22 PM
Loading a string from a file? kevin433 Help Archive 2 15/02/2009 02:00 PM


All times are GMT. The time now is 01:16 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.