INI_Load - 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: INI_Load (
/showthread.php?tid=530244)
INI_Load -
Sarra - 06.08.2014
Hello, INI_Load is not working for me, no errors when I compile but I'm not getting the result I'm waiting for
pawn Код:
INI:playername[Password](name[], value[])
{
INI_String("password", userpass, sizeof(userpass));
return printf("pass is %s", userpass);
}
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if (!response) Kick(playerid);
else if (response)
{
new playernameini[MAX_PLAYER_NAME+4];
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
format(playernameini, sizeof(playernameini), "%s.INI", playername);
new INI:data=INI_Open(playernameini);
INI_SetTag(data, "Pass");
INI_WriteString(data, "password", inputtext);
INI_Load(playernameini);
INI_Close(data);
}
return 1;
}
this should print "pass is passexample" on the console after Dialog box response but it doesn't, I tried to print the userpass variable which should contain the password written by the player
pawn Код:
//code....
INI_WriteString(data, "password", inputtext);
INI_Load(playernameini);
print(userpass);
but i discovered that it is a "null" which means the INI_Load is not loading the function, idk where did I make the mstake
(please don't tell me to change userpass and type inputtext instead, I know this is stupid but I need to do it that way, this is just a training on scripting)
Re: INI_Load -
Threshold - 06.08.2014
Oh my god...
Read this:
https://sampforum.blast.hk/showthread.php?tid=175565
READ IT PROPERLY. It has all the answers that you need for the questions you ask.
Now STOP MAKING A NEW THREAD FOR EVERY PROBLEM YOU ENCOUNTER.
Re: INI_Load -
Dignity - 06.08.2014
Did you actually set "userpass" to be something?
Also if you know something is bad, don't do it, even when practicing.
Re: INI_Load -
Sarra - 06.08.2014
I found my mistake thanks anyway