Spawn car always tunned
#3

You will still need to keep the code OnGameModeInit, since this isn't called on creation. The 2 second timer is cause OnVehicleSpawn seems to be called a bit earlier than we need to mod vehicles. Sometimes spawns without or desyncs for some people.


pawn Код:
public OnVehicleSpawn(vehicleid)
{
  SetTimerEx("RemodVehicle", 2000, 0, "i", vehicleid);
  return 1;
}

forward RemodVehicle(vehicleid);
public RemodVehicle(vehicleid)
{
  if(vehicleid == tun1)
  {
    ChangeVehiclePaintjob(tun1,1);
    AddVehicleComponent(tun1,1034);
    AddVehicleComponent(tun1,1036);
    AddVehicleComponent(tun1,1038);
    AddVehicleComponent(tun1,1040);
    AddVehicleComponent(tun1,1049);
    AddVehicleComponent(tun1,1073);
    SetVehicleNumberPlate(tun1, "SOBANDTS");
  }
  return 1;
}
Reply


Messages In This Thread
Spawn car always tunned - by [SOB]Chris - 30.08.2009, 20:07
Re: Spawn car always tunned - by Tr1viUm - 30.08.2009, 20:18
Re: Spawn car always tunned - by Chaprnks - 30.08.2009, 20:21

Forum Jump:


Users browsing this thread: 1 Guest(s)