05.06.2012, 15:20
(
Последний раз редактировалось MarcoWesley; 05.06.2012 в 16:22.
)
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:
PS: This file is defined whit this code:
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;
}
pawn Код:
#define VEH_SAVE_FILE "/CRP_Scriptfiles/Veh1/%s.cfg"