SA-MP Forums Archive
[HELP] deleting file - 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] deleting file (/showthread.php?tid=468840)



[HELP] deleting file - Luca12 - 10.10.2013

Hello how can I make when I sell my car them I want that file of my car in folder is delete if you know what I mean


Re: [HELP] deleting file - SilentSoul - 10.10.2013

i will give you small example
pawn Код:
new str[50];
format(str, sizeof str, "/CARS/%s.ini", pName);
fremove(str)



Re: [HELP] deleting file - Luca12 - 10.10.2013

btw I use yini and the cars is not from the name it go like this car_0 car_1 and inside the file is all data.


Re: [HELP] deleting file - Restriction - 10.10.2013

You can use fremove to remove a file when you are in game .. Using y-ini you can owerrite value .. Open and close , for removing a file you need to use fremove..


Re: [HELP] deleting file - SilentSoul - 10.10.2013

https://sampforum.blast.hk/showthread.php?tid=175565
Scrol down to : Deleting.


Re: [HELP] deleting file - EiresJason - 10.10.2013

What is your variable to save player's vehicles? Replace 'PlayerInfo[playerid][VehicleId]' with your variable.
pawn Код:
new str[50];
format(str, sizeof str, "/CARS/car_%i.ini", PlayerInfo[playerid][VehicleId]);
fremove(str);



Re: [HELP] deleting file - Luca12 - 10.10.2013

I try on that way but the file is still there


Re: [HELP] deleting file - EiresJason - 10.10.2013

Is the name of your vehicle's folder "CARS"?


Re: [HELP] deleting file - Luca12 - 10.10.2013

no it goes /Ownership/Cars/Car_%i.ini


Re: [HELP] deleting file - EiresJason - 10.10.2013

pawn Код:
new str[50];
format(str, sizeof str, "/Ownership/Cars/car_%i.ini", PlayerInfo[playerid][VehicleId]);
fremove(str);