SA-MP Forums Archive
CreateVehicle Not Working - 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: CreateVehicle Not Working (/showthread.php?tid=129535)



CreateVehicle Not Working - cozza123456 - 22.02.2010

Код:
public OnGameModeInit()
     {
     Tuned = CreateVehicle(560,-1472.6376953125, 438.23937988281, 6.9924750328064, 268.69067382813,1,-1,60);
 	 AddVehicleComponent(560,1026);
  	 AddVehicleComponent(560,1027);
  	 AddVehicleComponent(560,1028);
     AddVehicleComponent(560,1032);
     AddVehicleComponent(560,1080);
     AddVehicleComponent(560,1138);
     AddVehicleComponent(560,1141);
     AddVehicleComponent(560,1171);
     ChangeVehiclePaintjob(560,2);
My Car wont spawn! Why?


Re: CreateVehicle Not Working - Fedee! - 22.02.2010

did you put:
pawn Код:
new tuned;



Re: CreateVehicle Not Working - cozza123456 - 22.02.2010

Yes,
Код:
new Tuned;



Re: CreateVehicle Not Working - Fedee! - 22.02.2010

Gives you errors or warnings?

EDIT:

I know why... on AddVehicleComponent goes the Vehicle ID, not the Model ID

pawn Код:
public OnGameModeInit()
     {
     Tuned = CreateVehicle(560,-1472.6376953125, 438.23937988281, 6.9924750328064, 268.69067382813,1,-1,60);
     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);
It should work fine now.


Re: CreateVehicle Not Working - cozza123456 - 22.02.2010

No errors, everything in code works correctly, i go into my server and the vehicle is not there.
All my other vehicles are there. CreateVehicle doesnt work on a whole, none of my CreateVehicle Parts Work.


Re: CreateVehicle Not Working - cozza123456 - 22.02.2010

Ok its my gamemode, createvehicle doesnt work on it. I put it on a filterscript and it works fine.


Re: CreateVehicle Not Working - BlackFoX - 22.02.2010

You have OnGamemodeInit between some Macro if Statements ?

#if

#else

#endif


Re: CreateVehicle Not Working - cozza123456 - 22.02.2010

Dont think so, but it works now. Now how do i make it so when my vehicle blows up and it respawns its modded again, i realise its OnVehicleSpawn but what do i do with that command and where do i put it?