y_ini problems.
#1

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
Reply
#2

Use ParseFile, an example can be found on page 15 of y_ini's topic.
Reply
#3

Quote:
Originally Posted by [L3th4l]
View Post
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!");
Reply
#4

pawn Code:
if(!fexist(str))
{
    return SendClientMessage(playerid, 0xFF0000FF, "This nick is not registered!");
}
else
{
// File does exist
}
Reply
#5

Yes, but is there any way I can use y_ini to do it? I rather not get confused by using 2 file systems.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)