SA-MP Forums

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

 
 
Thread Tools Display Modes
Old 26/12/2010, 04:53 PM   #1
Gforcez
Gangsta
 
Gforcez's Avatar
 
Join Date: Jul 2010
Location: The Netherlands.
Posts: 767
Reputation: 435
Default [HELP] Y_files Error, Please help!

Hello, I have a little problem, I want to make something, That checks if the directory already is made,
Now i have this:

pawn Code:
new Dir[128];
    format(AccountFile, sizeof(AccountFile), "/Accounts/%s", AccountInfo[playerid][pAccountName]);

    if(dfind(AccountFile, Dir, sizeof(Dir), 0))
        // Rest of code

But this is giving error: argument type mismatch.
Does one of you guys know how to fix this?

Greetings
Gforcez

Last edited by Gforcez; 26/12/2010 at 05:59 PM.
Gforcez is offline  
Old 26/12/2010, 06:11 PM   #2
Gforcez
Gangsta
 
Gforcez's Avatar
 
Join Date: Jul 2010
Location: The Netherlands.
Posts: 767
Reputation: 435
Default Re: [HELP] Y_files

Sorry for bump, But i Really need it!
Gforcez is offline  
Old 26/12/2010, 08:27 PM   #3
Sascha
High-roller
 
Sascha's Avatar
 
Join Date: Jul 2009
Location: Germany
Posts: 1,494
Reputation: 70
Default Re: [HELP] Y_files

just use "fexist" so like:
Code:
format(AccountFile, sizeof(AccountFile), "/Accounts/%s", AccountInfo[playerid][pAccountName]);
if(fexist(AccountFile)){
code for the case that the file exists, here
}
if(!fexist(AccountFile)){
code for the case that it doesn't exist here
}
I hope this is what you need:P
__________________
Don't bother to contact me, I'm out of SA-MP
Sascha is offline  
Old 26/12/2010, 08:34 PM   #4
[L3th4l]
Guest
 
Posts: n/a
Default Re: [HELP] Y_files

pawn Code:
if(fexist(file))
{
    // File does exist
}
else
{
    // File does not exist
}
 
 

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



All times are GMT. The time now is 03:50 AM.


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