whats the difference between CreateVehicle and AddStaticVehicleEx?
#1

would it matter if i replace AddStaticVehicleEx with CreateVehicle?

because im trying to add a streamer but mostly all are in AddStaticVehicleEx and the fuction for the vehicle streamer is CreateStreamVehicle
Reply
#2

CreateVehicle is used to place the vehicles and put their respawn time,..... respawns only when destroyed
While
AddStatic one will just put the vehicle on a place.....If it destroys or moves somewhere else from its initial postion, then it will get back tehre after a short Time.
Reply
#3

ok, im running LARP, and i want to change the
Код:
AddStaticVehicleEx(CarInfo[h][cModel],CarInfo[h][cLocationx],CarInfo[h][cLocationy],CarInfo[h][cLocationz]+1.0,CarInfo[h][cAngle],CarInfo[h][cColorOne],CarInfo[h][cColorTwo],60000);
to
Код:
CreateStreamVehicle(CarInfo[h][cModel],CarInfo[h][cLocationx],CarInfo[h][cLocationy],CarInfo[h][cLocationz]+1.0,CarInfo[h][cAngle],CarInfo[h][cColorOne],CarInfo[h][cColorTwo],60000);
would that fuck anything up?
Reply
#4

whats the syntax for CreateStreamVehicle ??

Reply
#5

i dont know what the syntax is, but here the code
Код:
stock CreateStreamVehicle(modelid,Float:x,Float:y,Float:z,Float:a,col1,col2)
{
	for(new i = 1;i<MAX_STREAM_VEHICLES;i++) {
	  if(VehicleInfo[i][valid] == 0) {
			VehicleInfo[i][dmodel] = modelid;
			VehicleInfo[i][x_spawn] = x;
			VehicleInfo[i][y_spawn] = y;
			VehicleInfo[i][z_spawn] = z;
			VehicleInfo[i][za_spawn] = a;
			VehicleInfo[i][color_1] = col1;
			VehicleInfo[i][color_2] = col2;
			VehicleInfo[i][valid] = 1;
			VehicleInfo[i][idnum] = 0;
			VehicleInfo[i][paintjob] = -1;
			VehicleInfo[i][temporary] = 0;
			if(VehicleInfo[i][id_prev_used] == 0) {
			  vehcount++;
			}
			UpdateVehicleSectorInfo();
			return i;
		}
	}
	return 0;
}
im a decent scripter, not good tho lol

its taxi's vehicle streamer
Reply
#6

well..i saw this code....and so You can do that ..what you asked just b4 your last post ...
Quote:

ok, im running LARP, and i want to change the
Code:
AddStaticVehicleEx(CarInfo[h][cModel],CarInfo[h][cLocationx],CarInfo[h][cLocationy],CarInfo[h][cLocationz]+1.0,CarInfo[h][cAngle],CarInfo[h][cColorOne],CarInfo[h][cColorTwo],60000);
to
Code:
CreateStreamVehicle(CarInfo[h][cModel],CarInfo[h][cLocationx],CarInfo[h][cLocationy],CarInfo[h][cLocationz]+1.0,CarInfo[h][cAngle],CarInfo[h][cColorOne],CarInfo[h][cColorTwo],60000);
would that fuck anything up?

ALL WILL BE FINE ..JUST DO IT


Reply
#7

Quote:

This function [AddStaticVehicle] can only create vehicles in the OnGameModeInit callback, and vehicles created with this function cannot be removed.

https://sampwiki.blast.hk/wiki/AddStaticVehicle
https://sampwiki.blast.hk/wiki/AddStaticVehicleEx
https://sampwiki.blast.hk/wiki/CreateVehicle

I would recommend CreateVehicle because it gives you the option to delete a spawned vehicle.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)