How can i createvehicle on gamemode start with mods?
#1

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

thank you..
Reply
#2

I cant understand !
Reply
#3

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

new modedcar;

modedcar = AddStaticVehicle(etc...);

AddVehicleComponent(modedcar,1010);
Reply
#5

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..
Reply
#6

OnGameModeInit << Add

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

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.......
Reply
#8

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;
}
Reply
#9

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)