INI_Load
#1

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 Код:
new userpass[25];
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)
Reply
#2

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

Did you actually set "userpass" to be something?

Also if you know something is bad, don't do it, even when practicing.
Reply
#4

I found my mistake thanks anyway
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)