It's corect?
#1

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);
}

Reply
#2

How in the world should we know?
Reply
#3

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

The first one will get the job done.
Reply
#5

Thanks all.
Reply
#6

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

Its correct
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)