SA-MP Forums Archive
It's corect? - 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: It's corect? (/showthread.php?tid=644586)



It's corect? - Belengher - 10.11.2017

Hi

It's correct this code?

Quote:

format(string, sizeof(string), "Accounts/%s.ini", params);
if(fexist(string))
{
if(fexist(string)) FIXES_fclose(string), fremove(string);
format(string, sizeof(string), "You deleted the Account (%s.ini)", params);
SendClientMessage(playerid, COLOR_GREY, string);
}

or this is correct?

Quote:

format(string, sizeof(string), "Accounts/%s.ini", params);
if(fexist(string))
{
if(fexist(params)) FIXES_fclose(params), fremove(params);
format(string, sizeof(string), "You deleted the Account (%s.ini)", params);
SendClientMessage(playerid, COLOR_GREY, string);
}




Re: It's corect? - Meller - 10.11.2017

How in the world should we know?


Re: It's corect? - RakeDW - 10.11.2017

if(fexist(string)) will check if Accounts/SOMEFILE.ini exist, <<< TRUE
if(fexist(params)) will check if SOMEFILE exist <<< FALSE WAY


Re: It's corect? - lexurs - 11.11.2017

The first one will get the job done.


Re: It's corect? - Belengher - 11.11.2017

Thanks all.


Re: It's corect? - SyS - 11.11.2017

please note you don't need the second if(fexist(string)) as this condition is evaluated to true in the first check.


Re: It's corect? - FireRage007 - 11.11.2017

Its correct