y_ini problems. - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: y_ini problems. (
/showthread.php?tid=192575)
y_ini problems. -
Toni - 23.11.2010
Hello there,
I've decided to make one more script before I actually think on deciding to leave SA:MP or not.
------
I am trying to use y_ini for file writing, but it is
very confusing to me. I already sent a PM to ******, waiting for a reply, but just in case he doesn't actually respond I'll just ask here.
Well, I need help on finding if a file exists or not, and I don't know how.
pawn Code:
public OnPlayerConnect(playerid)
{
format(str, sizeof(str), "/ZeusAdmin/Accounts/%s.ini", pName(playerid));
return 1;
}
Sadly, that's all I have so far. I don't know what function to use to check if the player's file exists or not.
I really do wish there was a wiki page on this file writing / reading system.
I'm not sure what to do, use fexist, or use a function inside y_ini (hopefully).
pawn Code:
public OnPlayerConnect(playerid)
{
format(str, sizeof(str), "/ZeusAdmin/Accounts/%s.ini", pName(playerid));
new INI:handler = INI_Open(str);
if(.....)
return 1;
}
That is what I am thinking of, but the if statement is stumping me. I can't figure what to 'if' about, since there is no actual function to check if the file exists.
Please do help,
The Toni
Re: y_ini problems. - [L3th4l] - 23.11.2010
Use ParseFile, an example can be found on page 15 of y_ini's topic.
Re: y_ini problems. -
Toni - 23.11.2010
Quote:
Originally Posted by [L3th4l]
Use ParseFile, an example can be found on page 15 of y_ini's topic.
|
That's not exactly what I meant, all I want right now is to find a way if the file exists or not.
i.e if(!dini_Exist(str)) return SendClientMessage(playerid, 0xFF0000FF, "This nick is not registered!");
Re: y_ini problems. - [L3th4l] - 23.11.2010
pawn Code:
if(!fexist(str))
{
return SendClientMessage(playerid, 0xFF0000FF, "This nick is not registered!");
}
else
{
// File does exist
}
Re: y_ini problems. -
Toni - 23.11.2010
Yes, but is there any way I can use y_ini to do it? I rather not get confused by using 2 file systems.