AddStaticVehicleWorld
#1

Hello,

I was bored of using the SetVehicleVirtualWorld function each time i wanted to ad a vehicle into a virtual world.
So now im trying to make it one function like here;

Код:
stock AddStaticVehicleWorld(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:angle, color1, color2,worldid)
{
  new vehicleID = AddStaticVehicle(modelid, spawn_x, spawn_y, spawn_z, angle, color1, color2,worldid);
  worldid = GetVehicleVirtualWorld(vehicleID);
  SetVehicleVirtualWorld(vehicleID,worldid);
  return vehicleID;
}
and under filterscriptinit
AddStaticVehicleWorld(402,2186.3081,1144.8165,12.2 462,176.9206,123,61,1);
It gives me jus one warning: warning 202: number of arguments does not match definition

The vehicle spawns but i cant make the world function to work
i guess i need to put SetVehicleVirtualWorld under onplayerspawn or vehicle spawn after all huh ?
Reply
#2

Quote:
Originally Posted by boelie
pawn Код:
stock AddStaticVehicleWorld(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:angle, color1, color2,worldid)
{
  new vehicleID = AddStaticVehicle(modelid, spawn_x, spawn_y, spawn_z, angle, color1, color2,worldid);
  worldid = GetVehicleVirtualWorld(vehicleID);
  SetVehicleVirtualWorld(vehicleID,worldid);
  return vehicleID;
}
Mhm shouldn't it be:

pawn Код:
stock AddStaticVehicleWorld(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:angle, color1, color2, worldid)
{
  new vehicleID = AddStaticVehicle(modelid, spawn_x, spawn_y, spawn_z, angle, color1, color2);
  SetVehicleVirtualWorld(vehicleID, worldid);
  return vehicleID;
}
? :O
Reply
#3

@Last_Stand_Guardian that way the car won't spawn.

Edit: My bad, i didn't see that you removed the GetVehicleVirtualWorld part.
Reply
#4

WOooww it works thanks Last_Stand_Guardian
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)