AddVehicleComponent
#1

Hi, my OnVehicleRespawn


Код:
public OnVehicleSpawn(vehicleid)
{
  if(vehicleid==Tuned)
  {
     	AddVehicleComponent(Tuned,1026);
		  	AddVehicleComponent(Tuned,1027);
		  	AddVehicleComponent(Tuned,1028);
		  AddVehicleComponent(Tuned,1032);
		  AddVehicleComponent(Tuned,1080);
		  AddVehicleComponent(Tuned,1138);
		  AddVehicleComponent(Tuned,1141);
		  AddVehicleComponent(Tuned,1171);
		  ChangeVehiclePaintjob(Tuned,2);
  }
  if(vehicleid==Tuned1)
  {
     	AddVehicleComponent(Tuned1,1026);
		  	AddVehicleComponent(Tuned1,1027);
		  	AddVehicleComponent(Tuned1,1028);
		  AddVehicleComponent(Tuned1,1032);
		  AddVehicleComponent(Tuned1,1080);
		  AddVehicleComponent(Tuned1,1138);
		  AddVehicleComponent(Tuned1,1141);
		  AddVehicleComponent(Tuned1,1171);
		  ChangeVehiclePaintjob(Tuned1,2);
  }
  if(vehicleid==Tuned2)
  {
     	AddVehicleComponent(Tuned2,1026);
		  	AddVehicleComponent(Tuned2,1027);
		  	AddVehicleComponent(Tuned2,1028);
		  AddVehicleComponent(Tuned2,1032);
		  AddVehicleComponent(Tuned2,1080);
		  AddVehicleComponent(Tuned2,1138);
		  AddVehicleComponent(Tuned2,1141);
		  AddVehicleComponent(Tuned2,1171);
		  ChangeVehiclePaintjob(Tuned2,2);
  }
  if(vehicleid==Tuned3)
  {
     	AddVehicleComponent(Tuned3,1026);
		  	AddVehicleComponent(Tuned3,1027);
		  	AddVehicleComponent(Tuned3,1028);
		  AddVehicleComponent(Tuned3,1032);
		  AddVehicleComponent(Tuned3,1080);
		  AddVehicleComponent(Tuned3,1138);
		  AddVehicleComponent(Tuned3,1141);
		  AddVehicleComponent(Tuned3,1171);
		  ChangeVehiclePaintjob(Tuned3,2);
  }
  if(vehicleid==Tuned4)
  {
     	AddVehicleComponent(Tuned4,1026);
		  	AddVehicleComponent(Tuned4,1027);
		  	AddVehicleComponent(Tuned4,1028);
		  AddVehicleComponent(Tuned4,1032);
		  AddVehicleComponent(Tuned4,1080);
		  AddVehicleComponent(Tuned4,1138);
		  AddVehicleComponent(Tuned4,1141);
		  AddVehicleComponent(Tuned4,1171);
		  ChangeVehiclePaintjob(Tuned4,2);
  }
  if(vehicleid==Tuned5)
  {
     	AddVehicleComponent(Tuned5,1026);
		  	AddVehicleComponent(Tuned5,1027);
		  	AddVehicleComponent(Tuned5,1028);
		  AddVehicleComponent(Tuned5,1032);
		  AddVehicleComponent(Tuned5,1080);
		  AddVehicleComponent(Tuned5,1138);
		  AddVehicleComponent(Tuned5,1141);
		  AddVehicleComponent(Tuned5,1171);
		  ChangeVehiclePaintjob(Tuned5,2);
  }
  if(vehicleid==Tuned6)
  {
     	AddVehicleComponent(Tuned6,1026);
		  	AddVehicleComponent(Tuned6,1027);
		  	AddVehicleComponent(Tuned6,1028);
		  AddVehicleComponent(Tuned6,1032);
		  AddVehicleComponent(Tuned6,1080);
		  AddVehicleComponent(Tuned6,1138);
		  AddVehicleComponent(Tuned6,1141);
		  AddVehicleComponent(Tuned6,1171);
		  ChangeVehiclePaintjob(Tuned,2);
  }
  return 1;
}
Why doesnt my vehicle get modded after it spawns?
Reply
#2

I believe that OnVehicleSpawn has a bug - it's not called when the vehicle spawns for the first time, only when it's respawned.
Reply
#3

Use OnVehicleStreamIn
Reply
#4

Well i used ongamemodeinit and the createvehicle thing but that only worked until the vehicle died.
I am trying OnVehicleStreamIn now.

Reply
#5

Код:
public OnVehicleStreamIn(vehicleid)
{
  if(vehicleid==Tuned)
  {
     	AddVehicleComponent(Tuned,1026);
		  	AddVehicleComponent(Tuned,1027);
		  	AddVehicleComponent(Tuned,1028);
		  AddVehicleComponent(Tuned,1032);
		  AddVehicleComponent(Tuned,1080);
		  AddVehicleComponent(Tuned,1138);
		  AddVehicleComponent(Tuned,1141);
		  AddVehicleComponent(Tuned,1171);
		  ChangeVehiclePaintjob(Tuned,2);
  }
  if(vehicleid==Tuned1)
  {
     	AddVehicleComponent(Tuned1,1026);
		  	AddVehicleComponent(Tuned1,1027);
		  	AddVehicleComponent(Tuned1,1028);
		  AddVehicleComponent(Tuned1,1032);
		  AddVehicleComponent(Tuned1,1080);
		  AddVehicleComponent(Tuned1,1138);
		  AddVehicleComponent(Tuned1,1141);
		  AddVehicleComponent(Tuned1,1171);
		  ChangeVehiclePaintjob(Tuned1,2);
  }
  if(vehicleid==Tuned2)
  {
     	AddVehicleComponent(Tuned2,1026);
		  	AddVehicleComponent(Tuned2,1027);
		  	AddVehicleComponent(Tuned2,1028);
		  AddVehicleComponent(Tuned2,1032);
		  AddVehicleComponent(Tuned2,1080);
		  AddVehicleComponent(Tuned2,1138);
		  AddVehicleComponent(Tuned2,1141);
		  AddVehicleComponent(Tuned2,1171);
		  ChangeVehiclePaintjob(Tuned2,2);
  }
  if(vehicleid==Tuned3)
  {
     	AddVehicleComponent(Tuned3,1026);
		  	AddVehicleComponent(Tuned3,1027);
		  	AddVehicleComponent(Tuned3,1028);
		  AddVehicleComponent(Tuned3,1032);
		  AddVehicleComponent(Tuned3,1080);
		  AddVehicleComponent(Tuned3,1138);
		  AddVehicleComponent(Tuned3,1141);
		  AddVehicleComponent(Tuned3,1171);
		  ChangeVehiclePaintjob(Tuned3,2);
  }
  if(vehicleid==Tuned4)
  {
     	AddVehicleComponent(Tuned4,1026);
		  	AddVehicleComponent(Tuned4,1027);
		  	AddVehicleComponent(Tuned4,1028);
		  AddVehicleComponent(Tuned4,1032);
		  AddVehicleComponent(Tuned4,1080);
		  AddVehicleComponent(Tuned4,1138);
		  AddVehicleComponent(Tuned4,1141);
		  AddVehicleComponent(Tuned4,1171);
		  ChangeVehiclePaintjob(Tuned4,2);
  }
  if(vehicleid==Tuned5)
  {
     	AddVehicleComponent(Tuned5,1026);
		  	AddVehicleComponent(Tuned5,1027);
		  	AddVehicleComponent(Tuned5,1028);
		  AddVehicleComponent(Tuned5,1032);
		  AddVehicleComponent(Tuned5,1080);
		  AddVehicleComponent(Tuned5,1138);
		  AddVehicleComponent(Tuned5,1141);
		  AddVehicleComponent(Tuned5,1171);
		  ChangeVehiclePaintjob(Tuned5,2);
  }
  if(vehicleid==Tuned6)
  {
     	AddVehicleComponent(Tuned6,1026);
		  	AddVehicleComponent(Tuned6,1027);
		  	AddVehicleComponent(Tuned6,1028);
		  AddVehicleComponent(Tuned6,1032);
		  AddVehicleComponent(Tuned6,1080);
		  AddVehicleComponent(Tuned6,1138);
		  AddVehicleComponent(Tuned6,1141);
		  AddVehicleComponent(Tuned6,1171);
		  ChangeVehiclePaintjob(Tuned,2);
  }
  return 1;
}
Didn't Work.
Reply
#6

Are you even using the correct callback, and if so, why doesn't it error on compile, since your header differs from the prototype
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)