Spawn Vehicles and save to File
#5

Quote:
Originally Posted by Annihalation
I'll give you some tips, but no handouts

get dini.inc if you don't have it, get it here

to get it, click that link, click the "downloads" button in the upper right and find "dini v1.6" (use your browser's find function if you cant find it in the page)

then take this and paste it between the brackets in the "public OnVehicleSpawn" part in your file
Код:
  new file[256], Float:vehX, Float:vehY, Float:vehZ, Float:vehR, model;
  model = GetVehicleModel(vehicleid);
  format(file, sizeof(file), "Vehicles/%s.ini", vehicleid);
  if(dini_Exists(file)) return 1; // car exists in database
  GetVehiclePos(vehicleid, vehX, vehY, vehZ);
  GetVehicleZAngle(vehicleid, vehR);
  dini_IntSet(file, "model", model);
  dini_IntSet(file, "posX", vehX);
  dini_IntSet(file, "posY", vehY);
  dini_IntSet(file, "posZ", vehZ);
  dini_IntSet(file, "angle", vehR);
basically, what that does is save every vehicle in the game as a file, labeled the vehicle's ID. It's not very efficient, and doesn't save mods or colors (however, there is no GetVehicleColor, so that's not possible anyways :P)

you can make the "/createveh" command, that part is extremely easy, the first thing I learned about PAWN was to do "/" commands
Okay, so it will save any vehicle spawned to Vehicles.ini ?
Reply


Messages In This Thread
Spawn Vehicles and save to File - by Memoryz - 24.07.2009, 00:45
Re: Spawn Vehicles and save to File - by Joe Staff - 24.07.2009, 00:54
Re: Spawn Vehicles and save to File - by Memoryz - 24.07.2009, 01:02
Re: Spawn Vehicles and save to File - by Annihalation - 24.07.2009, 05:32
Re: Spawn Vehicles and save to File - by Memoryz - 24.07.2009, 13:15
Re: Spawn Vehicles and save to File - by Memoryz - 24.07.2009, 14:35
Re: Spawn Vehicles and save to File - by Memoryz - 24.07.2009, 21:25

Forum Jump:


Users browsing this thread: 2 Guest(s)