06.08.2014, 07:48
Hello, INI_Load is not working for me, no errors when I compile but I'm not getting the result I'm waiting for
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
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)
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;
}
pawn Код:
//code....
INI_WriteString(data, "password", inputtext);
INI_Load(playernameini);
print(userpass);
(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)