Y_Ini problem - 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: Y_Ini problem (
/showthread.php?tid=279549)
Y_Ini problem -
austin070 - 28.08.2011
Sup guys? I can't seem to figure out why this is not working. Here is my code:
pawn Code:
#define USER_FILE "/Accounts/%s.ini"
stock UserFile(playerid)
{
new file[128];
format(file, sizeof(file), USER_FILE, GetPName(playerid));
return file;
}
switch(dialogid)
{
case 1:
{
if(!response) return Kick(playerid);
print("1");
if(!strlen(inputtext)) return ShowRegister(playerid);
print("2");
new INI:File = INI_Open(UserFile(playerid));
print("3");
INI_SetTag(File,"data");
INI_WriteInt(File,"Password",udb_hash(inputtext));
INI_WriteInt(File,"Cash",0);
INI_WriteInt(File,"Admin",0);
INI_WriteInt(File,"Kills",0);
INI_WriteInt(File,"Deaths",0);
INI_Close(File);
print("4");
}
}
It stops at "print("2");" and I can't figure out why. Any insight?
Re: Y_Ini problem -
dowster - 28.08.2011
What is the stock/function for UserFile?
Re: Y_Ini problem -
austin070 - 28.08.2011
It's the path to the user file.
Re: Y_Ini problem -
Kingunit - 28.08.2011
Try this
pawn Code:
stock UserFile(playerid)
{
new string[128],playername[MAX_PLAYER_NAME];
GetPlayerName(playerid,playername,sizeof(playername));
format(string,sizeof(string),PATH,playername);
return string;
}
Re: Y_Ini problem -
austin070 - 28.08.2011
Quote:
Originally Posted by Kingunit
Try this
pawn Code:
stock UserFile(playerid) { new string[128],playername[MAX_PLAYER_NAME]; GetPlayerName(playerid,playername,sizeof(playername)); format(string,sizeof(string),PATH,playername); return string; }
|
Hmm this worked. Thanks. I don't understand why mine didn't work because I have
pawn Code:
playername[MAX_PLAYER_NAME];
GetPlayerName(playerid,playername,sizeof(playername));
in my own function (GetPName(playerid)).
Re: Y_Ini problem -
Kush - 28.08.2011
And this is the reason you don't strip and replace.