Getting vehicle height for sirens?
#1

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
Reply
#2

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);
Reply
#3

Thanks though for some reason that isn't working.
Reply
#4

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)