Getting vehicle height for sirens? - 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: Getting vehicle height for sirens? (
/showthread.php?tid=201496)
Getting vehicle height for sirens? -
acade - 21.12.2010
Hello,
I was wondering if someone has a way of getting the vehicle height to set the siren down on top. That would be great,
Thanks
Re: Getting vehicle height for sirens? -
Dark_Kostas - 21.12.2010
There is no that function for now, but you can make one by your own.
pawn Код:
GetVehicleHeightForSiren(vehicleid)
{
modelid = GetVehicleModel(vehicleid);
switch(modelid)
{
case 400: return 5.0;
case 550: return 6.0;
}
return -1;
}
And then you can use it like that.
pawn Код:
new vehicleid;
vehicleid = GetPlayerVehicleID(playerid);
new siren = CreateObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
AttachObjectToVehicle(siren, vehicleid, 0.0, 0.0, GetVehicleHeightForSiren(vehicleid), 0.0, 0.0, 0.0);
Re: Getting vehicle height for sirens? -
acade - 21.12.2010
Thanks though for some reason that isn't working.
Re: Getting vehicle height for sirens? -
Lookin - 21.12.2010
it is just an example on a possible way of doing it try write your own using a similar method to the above and see were it takes you