Permanent AttachObjectToVehicle?
#1

I used iVO to attach objects to vehicles in game and obviously save them in scriptfiles.
Now my question is, is there any way to permanently keep an object on a vehicle that is in your server?
So basically when the server starts the object is already attached to the car.
If this is possible, how?
Reply
#2

Mabye try putting it under:
public OnGameModeInit()
Like this:
it should work.

public OnGameModeInit()
{
SetPVarInt(playerid, "item1", CreateObject(2099,0,0,0,0,0,0));
AttachObjectToVehicle(GetPVarInt(playerid, "item1"), GetPlayerVehicleID(playerid),-0.000000, 2.345006, -0.279999, 0.000000, 0.000000, 0.000000);
}
Reply
#3

Also try adding you vehicle in that code above like:

AddStaticVehicle (your vehicle)
Reply
#4

And next time put it into a Pawn Code
Код:
 public OnGameModeInit()
{ 
SetPVarInt(playerid, "item1", CreateObject(2099,0,0,0,0,0,0));
AttachObjectToVehicle(GetPVarInt(playerid, "item1"), GetPlayerVehicleID(playerid),-0.000000, 2.345006, -0.279999, 0.000000, 0.000000, 0.000000);
}
Reply
#5

That just makes Pawno crash.
Maybe I didn't explain correctly.
I have a basic Admiral placed with AddStaticVehicle.
Now I just want the saved object which I have the coords from to permanently be on that Admiral, how?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)