[HELP] deleting file
#1

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
Reply
#2

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

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.
Reply
#4

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..
Reply
#5

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

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);
Reply
#7

I try on that way but the file is still there
Reply
#8

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

no it goes /Ownership/Cars/Car_%i.ini
Reply
#10

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


Forum Jump:


Users browsing this thread: 4 Guest(s)