AddStaticVehicle
#1

How I can AddStaticVehicle IN Dialog Response or anywhere ?
I just know that AddStaticVehicle Only Works at gamemodeint
(Im Using Filetscript)
Reply
#2

https://sampwiki.blast.hk/wiki/CreateVehicle :P
Reply
#3

Quote:
Originally Posted by Osamakurdi
Посмотреть сообщение
How I can AddStaticVehicle IN Dialog Response or anywhere ?
I just know that AddStaticVehicle Only Works at gamemodeint
(Im Using Filetscript)
I Think CreateVehicle isnt as same as AddVehicleStatic
Reply
#4

To create a vehicle with 'AddStaticVehicle' you should know that it is saved with '/ save' inside the server.
And how did @Dayrion say, to create a vehicle you use the definition 'CreateVehicle'.
Simple example:
PHP код:
  new Float:xFloat:yFloat:zFloat:az;
  
GetPlayerPos(playeridxyz);
  
GetPlayerFacingAngle(playeridaz);
  
CreateVehicle(modelidx+5y+5zaz, -1, -1180); 
In modelid you define the vehicle ID, you can find them here:
https://sampwiki.blast.hk/wiki/Vehicle_Model_ID_List

And if none of this helps you, then i do not know.
Reply
#5

Thanks all
+REP both of you !
Welcome back to forum :0@dani18
Reply
#6

Quote:
Originally Posted by Osamakurdi
Посмотреть сообщение
Thanks all
+REP both of you !
Welcome back to forum :0@dani18
You are welcome, partner, and thanks
Reply
#7

Quote:
Originally Posted by dani18
Посмотреть сообщение
To create a vehicle with 'AddStaticVehicle' you should know that it is saved with '/ save' inside the server.
The use of /save is irrelevant to which function to use. That command just saves your coordinates and you could then use them in CreateVehicle if you wanted to.

I was once told that static vehicles have their models pre-loaded to game clients for faster loading as players are driving around. I have never verified this but it would make sense as why else would there be a separate function?

Also CreateVehicle cannot be used to add trains, and AddStaticVehicle cannot be used after server startup (OnGameModeInit).
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)