SA-MP Forums Archive
Fremove not work - 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: Fremove not work (/showthread.php?tid=597454)



Fremove not work - cuchipkg - 31.12.2015

hello forum samp, help me this script i can't delete file, thanks all and happy new year
Код HTML:
forward test(playerid,password[]);
public test(playerid,password[])
{
   	new string2[128];
	format(string2, sizeof(string2), "User/%s.ini",password);
        if(dini_Exists(string2))
	{
            fremove("string2");
            SendClientMessage(playerid, COLOR_WHITE, "success");
        return 1;
	}
	SendClientMessage(playerid, COLOR_WHITE, "fail");
	return 1;
}



Re: Fremove not work - Kucin666 - 31.12.2015

How want erased no specified file, what you want to delete?


Re: Fremove not work - cuchipkg - 31.12.2015

i delete file is format after if (sorry my bad english) you can help me how delete specified file for format? dear Kucin666 i want delete file in format name "User/%s.ini",password);


Re: Fremove not work - Kucin666 - 31.12.2015

I have not tried this code , but you might like to delete a file , but I suggest using y_ini , because dini old

Код:
CMD:delplayeroff(playerid,params[])
{
    new name[24];
    if(!sscanf(params, "s[24]", name))
    {
        new string2[128];
        format(string2, sizeof(string2), "User/%s.ini",name);
        if(!dini_Exists(string2)) return SendClientMessage(playerid, -1, "Invalid player name.");
		fremove("string2");
		SendClientMessage(playerid, -1, "success");
    } else return SendClientMessage(playerid, -1, "USAGE: /delplayeroff [playername]");
    return 1;
}



Re: Fremove not work - cuchipkg - 31.12.2015

Quote:
Originally Posted by Kucin666
Посмотреть сообщение
I have not tried this code , but you might like to delete a file , but I suggest using y_ini , because dini old

Код:
CMD:delplayeroff(playerid,params[])
{
    new name[24];
    if(!sscanf(params, "s[24]", name))
    {
        new string2[128];
        format(string2, sizeof(string2), "User/%s.ini",name);
        if(!dini_Exists(string2)) return SendClientMessage(playerid, -1, "Invalid player name.");
		fremove("string2");
		SendClientMessage(playerid, -1, "success");
    } else return SendClientMessage(playerid, -1, "USAGE: /delplayeroff [playername]");
    return 1;
}
thanks Kucin666 for help but it not delete file


Re: Fremove not work - IceBilizard - 01.01.2016

try this

PHP код:
CMD:delplayeroff(playerid,params[])
{
    new 
name[24];
    if(!
sscanf(params"s[24]"name))
    {
        new 
string2[128];
        
format(string2sizeof(string2), "User/%s.ini",name);
        if(!
dini_Exists(string2)) return SendClientMessage(playerid, -1"Invalid player name.");
        
dini_Remove(string);
        
SendClientMessage(playerid, -1"success");
    } else return 
SendClientMessage(playerid, -1"USAGE: /delplayeroff [playername]");
    return 
1;