Help!!![Delete File][YINI] - 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: Help!!![Delete File][YINI] (
/showthread.php?tid=331274)
Help!!![Delete File][YINI] -
Cjgogo - 04.04.2012
Is there a way to delete a file with Y_INI?I mean I've read the tutorial,but I only saw functions like Load,Parse,Create,etc. but not Delete!?
Re: Help!!![Delete File][YINI] -
Cjgogo - 04.04.2012
ALex,I want to delete a file wich contains infos related to a player's house,when the player sets the house for sell,and some1 else buys it,then the file it should destroy as the previous player doesn't own a house anymore :P
Re: Help!!![Delete File][YINI] -
antonio112 - 04.04.2012
So, you saved the house info into PlayerName.ini?
If that's the case, do something like:
pawn Код:
new pName[MAX_PLAYER_NAME], str[50];
GetPlayerName(playerid, pName, sizeof pName);
format(str, sizeof str, "%s.ini", pName);
fremove(str);
// Of course, this is just an example. If you saved the info into "House" folder, you'd have to format the str otherway:
format(str, sizeof str, "/Houses/%s.ini", pName);
fremove(str)
Hope that helped you get an idea of how to do it.