AttachObjectToVehicle
#1

Hello!

Im trying to add some rockets to rustler, but its not going so good.

i have created the objects:
pawn Код:
CreateObject( 3790,0,0,0,0,0,0,80 ); // Rustler Rocket
    CreateObject( 3790,0,0,0,0,0,0,80 ); // Rustler Rocket
    CreateObject( 3790,0,0,0,0,0,0,80 ); // Rustler Rocket
    CreateObject( 3790,0,0,0,0,0,0,80 ); // Rustler Rocket
    CreateObject( 3790,0,0,0,0,0,0,80 ); // Rustler Rocket
    CreateObject( 3790,0,0,0,0,0,0,80 ); // Rustler Rocket
And how about AttachObjectToVehicle? put it on OnGameModeInit? that didnt get the rockets in game,
even not with this cmd
pawn Код:
COMMAND:load(objectid, vehicleid, Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ, Float:fRotX, Float:fRotY, Float:RotZ, params[])
{
    AttachObjectToVehicle(3790, 476, 2.200000, 1.700000, -1.000000, 93.000000, 271.000000, 0.000000 ); // Rustler Rocket
    AttachObjectToVehicle(3790, 476, 2.699999, 1.700000, -0.899999, 0.000000, 2.000000, 270.000000 ); // Rustler Rocket
    AttachObjectToVehicle(3790, 476, 3.269999, 1.660000, -0.820000, 0.000000, 2.000000, 271.699890 ); // Rustler Rocket
    AttachObjectToVehicle(3790, 476, -2.040000, 1.710000, -1.000000, 0.000000, 1.700000, 270.000000 ); // Rustler Rocket
    AttachObjectToVehicle(3790, 476, -2.629999, 1.700000, -0.949999, 0.000000, 1.600000, 269.000000 ); // Rustler Rocket
    AttachObjectToVehicle(3790, 476, -3.209999, 1.700000, -0.830000, 0.000000, 1.000000, 268.700012 ); // Rustler Rocket
    return 1;
}
So, what to do to make it right?
Reply
#2

Is it giving you any errors ?, and paste it under OnPlayerCommandText
Reply
#3

Quote:
Originally Posted by BATAD
Посмотреть сообщение
Is it giving you any errors ?, and paste it under OnPlayerCommandText
It gives no errors, and why under OnPlayerCommandText? always when i put i cmd there, it tells me "unknown command"
Reply
#4

new Something;
Something = CreateObject( 3790,0,0,0,0,0,0,80 );
AttachObjectToVehicle(something,...,..,.....)
I guess.
Reply
#5

Quote:
Originally Posted by Machida
Посмотреть сообщение
new Something;
Something = CreateObject( 3790,0,0,0,0,0,0,80 );
AttachObjectToVehicle(something,...,..,.....)
I guess.
Yeah, but when i put ""new object = CreateObject( 3790,0,0,0,0,0,0,80 );"" pawno crash
Reply
#6

do:
new object;
object = ....
Reply
#7

Quote:
Originally Posted by cruising
Посмотреть сообщение
Yeah, but when i put ""new object = CreateObject( 3790,0,0,0,0,0,0,80 );"" pawno crash
PHP код:
new object;
object AttachObjectToVehicle(objectidvehicleidFloat:fOffsetXFloat:fOffsetYFloat:fOffsetZFloat:fRotXFloat:fRotYFloat:RotZ
https://sampwiki.blast.hk/wiki/AttachObjectToVehicle
Reply
#8

I have read the wiki, but it didnt work.

Now i have made like this, but still not working :S
EDIT:
pawn Код:
new rocket;

public OnGameModeInit()
{
    AttachObjectToVehicle(rocket, 476, 2.200000, 1.700000, -1.000000, 93.000000, 271.000000, 0.000000 ); // Rustler Rocket
    AttachObjectToVehicle(rocket, 476, 2.699999, 1.700000, -0.899999, 0.000000, 2.000000, 270.000000 ); // Rustler Rocket
    AttachObjectToVehicle(rocket, 476, 3.269999, 1.660000, -0.820000, 0.000000, 2.000000, 271.699890 ); // Rustler Rocket
    AttachObjectToVehicle(rocket, 476, -2.040000, 1.710000, -1.000000, 0.000000, 1.700000, 270.000000 ); // Rustler Rocket
    AttachObjectToVehicle(rocket, 476, -2.629999, 1.700000, -0.949999, 0.000000, 1.600000, 269.000000 ); // Rustler Rocket
    AttachObjectToVehicle(rocket, 476, -3.209999, 1.700000, -0.830000, 0.000000, 1.000000, 268.700012 ); // Rustler Rocket
    rocket = CreateObject( 3790,0,0,0,0,0,0,80 ); // <iVO>
    rocket = CreateObject( 3790,0,0,0,0,0,0,80 ); // <iVO>
    rocket = CreateObject( 3790,0,0,0,0,0,0,80 ); // <iVO>
    rocket = CreateObject( 3790,0,0,0,0,0,0,80 ); // <iVO>
    rocket = CreateObject( 3790,0,0,0,0,0,0,80 ); // <iVO>
    rocket = CreateObject( 3790,0,0,0,0,0,0,80 ); // <iVO>  
    return 1;
}

//and also a cmd
COMMAND:load(objectid, vehicleid, Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ, Float:fRotX, Float:fRotY, Float:RotZ, params[])
{
    AttachObjectToVehicle(rocket, 476, 2.200000, 1.700000, -1.000000, 93.000000, 271.000000, 0.000000 ); // Rustler Rocket
    AttachObjectToVehicle(rocket, 476, 2.699999, 1.700000, -0.899999, 0.000000, 2.000000, 270.000000 ); // Rustler Rocket
    AttachObjectToVehicle(rocket, 476, 3.269999, 1.660000, -0.820000, 0.000000, 2.000000, 271.699890 ); // Rustler Rocket
    AttachObjectToVehicle(rocket, 476, -2.040000, 1.710000, -1.000000, 0.000000, 1.700000, 270.000000 ); // Rustler Rocket
    AttachObjectToVehicle(rocket, 476, -2.629999, 1.700000, -0.949999, 0.000000, 1.600000, 269.000000 ); // Rustler Rocket
    AttachObjectToVehicle(rocket, 476, -3.209999, 1.700000, -0.830000, 0.000000, 1.000000, 268.700012 ); // Rustler Rocket
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: