AddStaticVehicleWorld - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: AddStaticVehicleWorld (
/showthread.php?tid=149773)
AddStaticVehicleWorld -
boelie - 23.05.2010
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 ?
Re: AddStaticVehicleWorld -
Last_Stand_Guardian - 23.05.2010
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
Re: AddStaticVehicleWorld -
russo666 - 23.05.2010
@Last_Stand_Guardian that way the car won't spawn.
Edit: My bad, i didn't see that you removed the GetVehicleVirtualWorld part.
Re: AddStaticVehicleWorld -
boelie - 23.05.2010
WOooww it works
thanks Last_Stand_Guardian