SA-MP Forums Archive
Quick question about vehicles and VirtualWorlds - 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: Quick question about vehicles and VirtualWorlds (/showthread.php?tid=71211)



Quick question about vehicles and VirtualWorlds - Outbreak - 30.03.2009

Heres the code i've done...

pawn Код:
public OnVehicleSpawn(vehicleid)
{
  for(new i=0;i<8;i++)
    {
      if(vehicleid == BJveh[i])
      {
        SetVehicleVirtualWorld(BJveh[i], 121);
        }
    }
   
    for(new j=0;j<11;j++)
    {
      if(vehicleid == BJveh2[j])
      {
        SetVehicleVirtualWorld(BJveh2[j], 121);
      }
    }
   
return 1;
}

They dont spawn straight away, like if i goto the location and world 121, they're not there. only apear when i do a respawning vehicles command..

Then i tried doing this.. Aswell as the above


pawn Код:
stock SpawnStuntVehicles()
{
    for(new vehicleid=0;vehicleid<19;vehicleid++)
    {
  for(new i=0;i<8;i++)
    {
      if(vehicleid == BJveh[i])
      {
        SetVehicleVirtualWorld(BJveh[i], 121);
      }
    }

    for(new j=0;j<11;j++)
    {
      if(vehicleid == BJveh2[j])
      {
        SetVehicleVirtualWorld(BJveh2[j], 121);
        }
    }
    }
return 1;
}
And added it below the vehicles, under OnGameModeInit, still it didnt work.


Re: Quick question about vehicles and VirtualWorlds - ICECOLDKILLAK8 - 30.03.2009

Use
pawn Код:
SetVehicleVirtualWorld(...,...);
SetVehicleToRespawn(...);



Re: Quick question about vehicles and VirtualWorlds - Outbreak - 31.03.2009

Tried that, still didn't work...

I still have to go ingame and do a vehicle respawn command..


Anyone able to tell me how to spawn vehicles in a VW.

So i could start up the server. and some vehicles i choose would span in another VW, witohut me even needing to go in game and do anything.


Re: Quick question about vehicles and VirtualWorlds - Norn - 31.03.2009

I believe vehicles with virtual worlds are bugged atm.


Re: Quick question about vehicles and VirtualWorlds - Outbreak - 31.03.2009

Nvm I have an idea that will probably get this working