Delete ScriptFiles File!
#1

Hi everybody,
i need your help for my vehicle system. I explain:
When a player buy a vehicle, the GM creates a file called: Playername.cfg in a folder into "scriptfiles".

The exactly path is:"GM/scriptfiles/CR_Scriptfiles/Veh1".

The problem is that i need to delete this file when the player sell the car.

The cod of selling is this:

pawn Код:
{
                new vehicleid = GetOwnedVehicleID(playerid);
                if (vehicleid == INVALID_VEHICLE_ID) return SendClientMessage(playerid, RED, "You haven't a vehicle.");
                if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,RED,"You're not in a vehicle.");
                if(strcmp(VehicleInfo[GetPlayerVehicleID(playerid)][vOwner],GetName(playerid))) return SendClientMessage(playerid,RED,"This isn't your vehicle.");
                GivePlayerCash(playerid, GetVehicleCost(vehicleid)/2);
                new string[128];
                format(string, sizeof string, "|- You selled your vehicle to %s and you earned $%d -|", VehicleName[GetVehicleModel(vehicleid)-400], GetVehicleCost(vehicleid)/2);
                SendClientMessage(playerid, GREEN, string);
                DeleteVehicle(playerid);
                TogglePlayerControllable(playerid,1);
                vEngine[vehicleid] = 0;
            }
PS: This file is defined whit this code:

pawn Код:
#define VEH_SAVE_FILE   "/CRP_Scriptfiles/Veh1/%s.cfg"
Reply
#2

pawn Код:
#define VEH_SAVE_FILE   "Veh1/%s.cfg"
make sure the folder is named'scriptfiles".
Reply
#3

it's named 'scriptfiles'...
Reply
#4

Where is the code to Delete file?
Reply
#5

Quote:
Originally Posted by Firo
Посмотреть сообщение
Where is the code to Delete file?
I need it!
Reply
#6

Nobody can help me??
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)