SA-MP Forums Archive
How can i createvehicle on gamemode start with mods? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How can i createvehicle on gamemode start with mods? (/showthread.php?tid=139841)



How can i createvehicle on gamemode start with mods? - FujiNNN - 06.04.2010

How can i createvehicle on gamemode start with the mods that i wrote..?

thank you..


Re: How can i createvehicle on gamemode start with mods? - Johny_Rocker - 06.04.2010

I cant understand !


Re: How can i createvehicle on gamemode start with mods? - dice7 - 06.04.2010

No third party mods, only these
https://sampwiki.blast.hk/wiki/AddVehicleComponent


Re: How can i createvehicle on gamemode start with mods? - aircombat - 06.04.2010

new modedcar;

modedcar = AddStaticVehicle(etc...);

AddVehicleComponent(modedcar,1010);


Re: How can i createvehicle on gamemode start with mods? - FujiNNN - 06.04.2010

pawn Код:
if(!dini_Exists("Logs_And_History/vehicles.ini")){
    dini_Create("Logs_And_History/vehicles.ini");}
    new loader[128];
    for(new i = 0;i<MAX_BUY_CAR;i++)
    {
    format(loader,sizeof(loader),"veh_model_%d",i);
    VehicleSystem[i][model] = dini_Int("Logs_And_History/vehicles.ini",loader);
    format(loader,sizeof(loader),"veh_x_%d",i);
    VehicleSystem[i][Autox] = dini_Float("Logs_And_History/vehicles.ini",loader);
    format(loader,sizeof(loader),"veh_y_%d",i);
    VehicleSystem[i][Autoy] = dini_Float("Logs_And_History/vehicles.ini",loader);
    format(loader,sizeof(loader),"veh_z_%d",i);
    VehicleSystem[i][Autoz] = dini_Float("Logs_And_History/vehicles.ini",loader);
    format(loader,sizeof(loader),"veh_Farbe1_%d",i);
    VehicleSystem[i][Farbe1] = dini_Int("Logs_And_History/vehicles.ini",loader);
    format(loader,sizeof(loader),"veh_Farbe2_%d",i);
    VehicleSystem[i][Farbe2] = dini_Int("Logs_And_History/vehicles.ini",loader);
    format(loader,sizeof(loader),"veh_a_%d",i);
    VehicleSystem[i][a] = dini_Float("Logs_And_History/vehicles.ini",loader);
    format(loader,sizeof(loader),"veh_owner_%d",i);
    strmid(VehicleSystem[i][owner],dini_Get("Logs_And_History/vehicles.ini",loader),0,128,128);
    format(loader,sizeof(loader),"veh_preis_%d",i);
    VehicleSystem[i][preis] = dini_Int("Logs_And_History/vehicles.ini",loader);
    //
    format(loader,sizeof(loader),"veh_mod1_%d",i);
    VehicleSystem[i][mod1] = dini_Int("Logs_And_History/vehicles.ini",loader);
    format(loader,sizeof(loader),"veh_mod2_%d",i);
    VehicleSystem[i][mod2] = dini_Int("Logs_And_History/vehicles.ini",loader);
    format(loader,sizeof(loader),"veh_mod3_%d",i);
    VehicleSystem[i][mod3] = dini_Int("Logs_And_History/vehicles.ini",loader);
    format(loader,sizeof(loader),"veh_mod4_%d",i);
    VehicleSystem[i][mod4] = dini_Int("Logs_And_History/vehicles.ini",loader);
    format(loader,sizeof(loader),"veh_mod5_%d",i);
    VehicleSystem[i][mod5] = dini_Int("Logs_And_History/vehicles.ini",loader);
    format(loader,sizeof(loader),"veh_mod6_%d",i);
    VehicleSystem[i][mod6] = dini_Int("Logs_And_History/vehicles.ini",loader);
    format(loader,sizeof(loader),"veh_mod7_%d",i);
    VehicleSystem[i][mod7] = dini_Int("Logs_And_History/vehicles.ini",loader);
    format(loader,sizeof(loader),"veh_mod8_%d",i);
    VehicleSystem[i][mod8] = dini_Int("Logs_And_History/vehicles.ini",loader);
    format(loader,sizeof(loader),"veh_mod9_%d",i);
    VehicleSystem[i][mod9] = dini_Int("Logs_And_History/vehicles.ini",loader);
    format(loader,sizeof(loader),"veh_mod10_%d",i);
    VehicleSystem[i][mod10] = dini_Int("Logs_And_History/vehicles.ini",loader);
    format(loader,sizeof(loader),"veh_mod11_%d",i);
    VehicleSystem[i][mod11] = dini_Int("Logs_And_History/vehicles.ini",loader);
    format(loader,sizeof(loader),"veh_mod12_%d",i);
    VehicleSystem[i][mod12] = dini_Int("Logs_And_History/vehicles.ini",loader);
    format(loader,sizeof(loader),"veh_mod13_%d",i);
    VehicleSystem[i][mod13] = dini_Int("Logs_And_History/vehicles.ini",loader);
    format(loader,sizeof(loader),"veh_mod14_%d",i);
    VehicleSystem[i][mod14] = dini_Int("Logs_And_History/vehicles.ini",loader);
    format(loader,sizeof(loader),"veh_mod15_%d",i);
    VehicleSystem[i][mod15] = dini_Int("Logs_And_History/vehicles.ini",loader);
    format(loader,sizeof(loader),"veh_mod16_%d",i);
    VehicleSystem[i][mod16] = dini_Int("Logs_And_History/vehicles.ini",loader);
    format(loader,sizeof(loader),"veh_mod17_%d",i);
    VehicleSystem[i][mod17] = dini_Int("Logs_And_History/vehicles.ini",loader);
    format(loader,sizeof(loader),"veh_paint_%d",i);
    VehicleSystem[i][paintjob] = dini_Int("Logs_And_History/vehicles.ini",loader);
    format(loader,sizeof(loader),"locked_%d",i);
    VehicleSystem[i][locked] = dini_Int("Logs_And_History/vehicles.ini",loader);
how do i use all that to create a tunned vehicle (OnGameModeInit)..

thanks..


Re: How can i createvehicle on gamemode start with mods? - campkz - 06.04.2010

OnGameModeInit << Add

AddStaticVehicle(Vehicle id, posx, posy, posZ, angle, height); << theres also color you have to add etc...


Re: How can i createvehicle on gamemode start with mods? - FujiNNN - 06.04.2010

Quote:
Originally Posted by campkz
OnGameModeInit << Add

AddStaticVehicle(Vehicle id, posx, posy, posZ, angle, height); << theres also color you have to add etc...
dude.. please.. i know that.. but i'm trying to make the vehicles that saved with the mods that i've added.

what i'm trying to make is: when the server is starting then.. it will create the vehicle with all the mods and NOT when playerentervehicle then it pops up the mods to the vehicle..

just to create the vehicle with all the mods.......


Re: How can i createvehicle on gamemode start with mods? - Khelif - 06.04.2010

heres something to start with, hope that helps

pawn Код:
new modedcar[MAX_BUY_CAR];

public OnGameModeinit()
{
  if(!dini_Exists("Logs_And_History/vehicles.ini"))
  {
    dini_Create("Logs_And_History/vehicles.ini");}
    new loader[128];
    for(new i; i < MAX_BUY_CAR; i++)
    {
      format(loader,sizeof(loader),"veh_model_%d",i);
      VehicleSystem[i][model] = dini_Int("Logs_And_History/vehicles.ini",loader);
      format(loader,sizeof(loader),"veh_x_%d",i);
      VehicleSystem[i][Autox] = dini_Float("Logs_And_History/vehicles.ini",loader);
      format(loader,sizeof(loader),"veh_y_%d",i);
      VehicleSystem[i][Autoy] = dini_Float("Logs_And_History/vehicles.ini",loader);
      format(loader,sizeof(loader),"veh_z_%d",i);
      VehicleSystem[i][Autoz] = dini_Float("Logs_And_History/vehicles.ini",loader);
      format(loader,sizeof(loader),"veh_Farbe1_%d",i);
      VehicleSystem[i][Farbe1] = dini_Int("Logs_And_History/vehicles.ini",loader);
      format(loader,sizeof(loader),"veh_Farbe2_%d",i);
      VehicleSystem[i][Farbe2] = dini_Int("Logs_And_History/vehicles.ini",loader);
      format(loader,sizeof(loader),"veh_a_%d",i);
      VehicleSystem[i][a] = dini_Float("Logs_And_History/vehicles.ini",loader);
      format(loader,sizeof(loader),"veh_owner_%d",i);
      strmid(VehicleSystem[i][owner],dini_Get("Logs_And_History/vehicles.ini",loader),0,128,128);
      format(loader,sizeof(loader),"veh_preis_%d",i);
      VehicleSystem[i][preis] = dini_Int("Logs_And_History/vehicles.ini",loader);
      //
      format(loader,sizeof(loader),"veh_mod1_%d",i);
      VehicleSystem[i][mod1] = dini_Int("Logs_And_History/vehicles.ini",loader);
      format(loader,sizeof(loader),"veh_mod2_%d",i);
      VehicleSystem[i][mod2] = dini_Int("Logs_And_History/vehicles.ini",loader);
      format(loader,sizeof(loader),"veh_mod3_%d",i);
      VehicleSystem[i][mod3] = dini_Int("Logs_And_History/vehicles.ini",loader);
      format(loader,sizeof(loader),"veh_mod4_%d",i);
      VehicleSystem[i][mod4] = dini_Int("Logs_And_History/vehicles.ini",loader);
      format(loader,sizeof(loader),"veh_mod5_%d",i);
      VehicleSystem[i][mod5] = dini_Int("Logs_And_History/vehicles.ini",loader);
      format(loader,sizeof(loader),"veh_mod6_%d",i);
      VehicleSystem[i][mod6] = dini_Int("Logs_And_History/vehicles.ini",loader);
      format(loader,sizeof(loader),"veh_mod7_%d",i);
      VehicleSystem[i][mod7] = dini_Int("Logs_And_History/vehicles.ini",loader);
      format(loader,sizeof(loader),"veh_mod8_%d",i);
      VehicleSystem[i][mod8] = dini_Int("Logs_And_History/vehicles.ini",loader);
      format(loader,sizeof(loader),"veh_mod9_%d",i);
      VehicleSystem[i][mod9] = dini_Int("Logs_And_History/vehicles.ini",loader);
      format(loader,sizeof(loader),"veh_mod10_%d",i);
      VehicleSystem[i][mod10] = dini_Int("Logs_And_History/vehicles.ini",loader);
      format(loader,sizeof(loader),"veh_mod11_%d",i);
      VehicleSystem[i][mod11] = dini_Int("Logs_And_History/vehicles.ini",loader);
      format(loader,sizeof(loader),"veh_mod12_%d",i);
      VehicleSystem[i][mod12] = dini_Int("Logs_And_History/vehicles.ini",loader);
      format(loader,sizeof(loader),"veh_mod13_%d",i);
      VehicleSystem[i][mod13] = dini_Int("Logs_And_History/vehicles.ini",loader);
      format(loader,sizeof(loader),"veh_mod14_%d",i);
      VehicleSystem[i][mod14] = dini_Int("Logs_And_History/vehicles.ini",loader);
      format(loader,sizeof(loader),"veh_mod15_%d",i);
      VehicleSystem[i][mod15] = dini_Int("Logs_And_History/vehicles.ini",loader);
      format(loader,sizeof(loader),"veh_mod16_%d",i);
      VehicleSystem[i][mod16] = dini_Int("Logs_And_History/vehicles.ini",loader);
      format(loader,sizeof(loader),"veh_mod17_%d",i);
      VehicleSystem[i][mod17] = dini_Int("Logs_And_History/vehicles.ini",loader);
      format(loader,sizeof(loader),"veh_paint_%d",i);
      VehicleSystem[i][paintjob] = dini_Int("Logs_And_History/vehicles.ini",loader);
      format(loader,sizeof(loader),"locked_%d",i);
      VehicleSystem[i][locked] = dini_Int("Logs_And_History/vehicles.ini",loader);

      modedcar[i] = AddStaticVehicle(VehicleSystem[i][model], VehicleSystem[i][Autox], VehicleSystem[i][Autoy], VehicleSystem[i][Autoz], VehicleSystem[i][a], VehicleSystem[i][Farbe1], VehicleSystem[i][Farbe2]);
      ChangeVehiclePaintjob(modecar[i], VehicleSystem[i][paintjob]);
      AddVehicleComponent(modecar[i], VehicleSystem[i][mod1]);
      AddVehicleComponent(modecar[i], VehicleSystem[i][mod2]);
    }
  }
  return 1;
}



Re: How can i createvehicle on gamemode start with mods? - FujiNNN - 06.04.2010

Done. working great thanks ⒮⒠⒱⒠⒩⒮⒯⒜⒭


Re: How can i createvehicle on gamemode start with mods? - Norn - 06.04.2010

Quote:
Originally Posted by Johny_Rocker
I cant understand !
Mr. Rocker, why would you post if you didn't understand.