SA-MP Forums Archive
need help GetVehicleModelInfo - 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)
+--- Thread: need help GetVehicleModelInfo (/showthread.php?tid=338412)



need help GetVehicleModelInfo - scott1 - 29.04.2012

Hi all,

i need help with this function GetVehicleModelInfo

Because i try to attach light on roof,

so i do

new Float:X, Float:Y, Float:Z;
GetVehicleModelInfo(carid, VEHICLE_MODEL_INFO_SIZE , X, Y, Z); //Get the size of vehicle model 411 (Infernus)
new gyro = CreateObject(19419,0,0,0,0,0,0,100.0); //
AttachObjectToVehicle(gyro, carid, 0.0, 0.0, Z, 0.0, 0.0, 0.0);

But my light get into the car O_o

How can i do?

Max


AW: need help GetVehicleModelInfo - Drebin - 29.04.2012

Have you defined carid?


Re: need help GetVehicleModelInfo - iEnemY - 29.04.2012

You must use GetVehicleModel(carid), not car id =)
pawn Код:
GetVehicleModelInfo(GetVehicleModel(carid), VEHICLE_MODEL_INFO_SIZE , X, Y, Z); //Get the size of vehicle model 411 (Infernus)



Re : need help GetVehicleModelInfo - scott1 - 29.04.2012

Yes


new carid = GetPlayerVehicleID(playerid);
new Float:X, Float:Y, Float:Z;
GetVehicleModelInfo(carid, VEHICLE_MODEL_INFO_SIZE , X, Y, Z); //Get the size of vehicle model 411 (Infernus)
new gyro = CreateObject(19419,0,0,0,0,0,0,100.0); //
AttachObjectToVehicle(gyro, carid, 0.0, 0.0, Z, 0.0, 0.0, 0.0);

My object is attached to vehicle, but into it, not on the roof as i tried


Re: need help GetVehicleModelInfo - iEnemY - 29.04.2012

I mean u must use
pawn Код:
GetVehicleModelInfo(GetVehicleModel(carid), VEHICLE_MODEL_INFO_SIZE , X, Y, Z);



AW: need help GetVehicleModelInfo - Drebin - 29.04.2012

pawn Код:
new Float:X, Float:Y, Float:Z;
new carid;
carid = GetPlayerVehicleID(playerid);
GetVehicleModelInfo(GetVehicleModel(carid), VEHICLE_MODEL_INFO_SIZE , X, Y, Z); //Get the size of vehicle model 411 (Infernus)
new gyro = CreateObject(19419,0,0,0,0,0,0,100.0); //
AttachObjectToVehicle(gyro, carid, 0.0, 0.0, Z, 0.0, 0.0, 0.0);



Re : need help GetVehicleModelInfo - scott1 - 29.04.2012

Damm you where right xD

So i did this



new carid = GetPlayerVehicleID(playerid);
new car = GetVehicleModel(carid);
new Float:X, Float:Y, Float:Z;
GetVehicleModelInfo(car, VEHICLE_MODEL_INFO_SIZE , X, Y, Z);
new gyro = CreateObject(19419,0,0,0,0,0,0,100.0); //
AttachObjectToVehicle(gyro, car, X/2, Y/2, Z, 0.0, 0.0, 0.0);


bu now, my object don't appear


Re: need help GetVehicleModelInfo - iEnemY - 29.04.2012

No no no, buddy.
pawn Код:
new Float:X, Float:Y, Float:Z;
GetVehicleModelInfo(GetVehicleModel(GetPlayerVehicleID(playerid)), VEHICLE_MODEL_INFO_SIZE , X, Y, Z);
AttachObjectToVehicle(CreateObject(19419,0,0,0,0,0,0,100.0), GetPlayerVehicleID(playerid), X/2, Y/2, Z, 0.0, 0.0, 0.0);
Thats right =)
So, to use GetVehicleModelInfo u must input Model. But, to attach obj u need car id. All simple.


Re: need help GetVehicleModelInfo - Kar - 29.04.2012

pawn Код:
new Float:x, Float:y, Float:z;
GetVehicleModelInfo(GetVehicleModel(GetPlayerVehicleID(playerid)), VEHICLE_MODEL_INFO_SIZE , x, y, z);
AttachObjectToVehicle(CreateObject(19419, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 100.0), GetPlayerVehicleID(playerid), 0.0, 0.0, (z / 2.0), 0.0, 0.0, 0.0);
That's my input


Re : need help GetVehicleModelInfo - scott1 - 30.04.2012

Oh my god ! WTF xD

Long time i didn't touch pwn, so i am like an noob

Thank you all

Max