SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 23/11/2010, 01:39 AM   #1
Toni
High-roller
 
Toni's Avatar
 
Join Date: Aug 2009
Location: United States
Posts: 1,464
Reputation: 162
Default y_ini problems.

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
__________________
Toni is offline  
Old 23/11/2010, 01:43 AM   #2
[L3th4l]
Guest
 
Posts: n/a
Default Re: y_ini problems.

Use ParseFile, an example can be found on page 15 of y_ini's topic.
 
Old 23/11/2010, 01:52 AM   #3
Toni
High-roller
 
Toni's Avatar
 
Join Date: Aug 2009
Location: United States
Posts: 1,464
Reputation: 162
Default Re: y_ini problems.

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!");
__________________
Toni is offline  
Old 23/11/2010, 01:55 AM   #4
[L3th4l]
Guest
 
Posts: n/a
Default Re: y_ini problems.

pawn Code:
if(!fexist(str))
{
    return SendClientMessage(playerid, 0xFF0000FF, "This nick is not registered!");
}
else
{
// File does exist
}
 
Old 23/11/2010, 02:18 AM   #5
Toni
High-roller
 
Toni's Avatar
 
Join Date: Aug 2009
Location: United States
Posts: 1,464
Reputation: 162
Default Re: y_ini problems.

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

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Y_Ini. Zh3r0 Help Archive 1 15/10/2010 09:00 PM
Im having some problems John_Cooper Help Archive 3 17/07/2010 07:56 PM
[FS]CarOwnership problems, GM Problems coole210 Help Archive 8 17/06/2009 09:27 PM
Big Problems T.I. Help Archive 0 17/04/2009 09:51 PM


All times are GMT. The time now is 08:57 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.