23.12.2014, 10:24
Sorry for my bad english
Then I created a vehicle that works well .. I was trying to create a command that deletes a vehicle and its file in scriptfiles. Now the command works almost fine, but I make an example. If I create a vehicle and try to use the command, it does not work because it can not find the file of the vehicle. If I create the vehicle and close the gamemode and restart ... the command works. Y_ini creates files only on exit of the gamemode? I think that's the problem ...
ignored the language code
Then I created a vehicle that works well .. I was trying to create a command that deletes a vehicle and its file in scriptfiles. Now the command works almost fine, but I make an example. If I create a vehicle and try to use the command, it does not work because it can not find the file of the vehicle. If I create the vehicle and close the gamemode and restart ... the command works. Y_ini creates files only on exit of the gamemode? I think that's the problem ...
ignored the language code
Код:
CMD:cancellaveicolo(playerid, params[]) { new vehicleID; if(!IsPlayerAdmin(playerid)) return MandaErrore(playerid, "Devi essere un admin di livello 6 per usare questo comando"); if(sscanf(params, "i", vehicleID)) return MandaUsa(playerid, "/cancellaveicolo [vehicleid]"); if(fexist(FileVeicolo(vehicleID))) { ResetVeicolo(vehicleID); DestroyVehicle(vehicleID); fremove(FileVeicolo(vehicleID)); format(stringa, sizeof(stringa), "Veicolo cancellato con successo | ID: %d", vehicleID); MandaInfo(playerid, stringa); } else MandaErrore(playerid, "ID Veicolo non valido"); return 1; }