AddStaticVehicle - 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)
+--- Thread: AddStaticVehicle (
/showthread.php?tid=648088)
AddStaticVehicle -
Osamakurdi - 15.01.2018
How I can AddStaticVehicle IN Dialog Response or anywhere ?
I just know that AddStaticVehicle Only Works at gamemodeint
(Im Using Filetscript)
Re: AddStaticVehicle -
Dayrion - 15.01.2018
https://sampwiki.blast.hk/wiki/CreateVehicle :P
Re: AddStaticVehicle -
Osamakurdi - 15.01.2018
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
Re: AddStaticVehicle -
dani18 - 15.01.2018
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:x, Float:y, Float:z, Float:az;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, az);
CreateVehicle(modelid, x+5, y+5, z, az, -1, -1, 180);
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.
Re: AddStaticVehicle -
Osamakurdi - 15.01.2018
Thanks all
+REP both of you !
Welcome back to forum :0@dani18
Re: AddStaticVehicle -
dani18 - 15.01.2018
Quote:
Originally Posted by Osamakurdi
Thanks all
+REP both of you !
Welcome back to forum :0@dani18
|
You are welcome, partner, and thanks
Re: AddStaticVehicle -
MP2 - 17.01.2018
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).