CreateVehicle Not Working
#1

Код:
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?
Reply
#2

did you put:
pawn Код:
new tuned;
Reply
#3

Yes,
Код:
new Tuned;
Reply
#4

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

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

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

You have OnGamemodeInit between some Macro if Statements ?

#if

#else

#endif
Reply
#8

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?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)