need help GetVehicleModelInfo
#1

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

Have you defined carid?
Reply
#3

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)
Reply
#4

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

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

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

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

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.
Reply
#9

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

Oh my god ! WTF xD

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

Thank you all

Max
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)