Attach Help
#1

pawn Код:
if(strcmp(cmd, "/stavidrva", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    new Float:x, Float:y, Float:z;
    AttachObjectToVehicle(drvo,kamion,1062.80004883,-338.20001221,74.80000305,0,0,0);
    SendClientMessage(playerid, COLOR_WHITE, "{37F906}INFO:{FFFFFF}Drvata se uspesno natovareni vo kamionot");
    }
    }
pawn Код:
kamion = AddStaticVehicle(578,1062.69995117,-337.79998779,74.69999695,0.00000000,245,245); //DFT-30
drvo = CreateObject(1463,1066.30004883,-341.70001221,73.30000305,0.00000000,0.00000000,0.00000000);
And now when i type /stavidrva the drvo(tree) dont in saved position on the car..When i type /stavidrva object drvo(tree) disappears please help me !
Reply
#2

Bump !
Reply
#3

Код:
if(strcmp(cmd, "/stavidrva", true) == 0)
{
    if(!IsPlayerInAnyVehicle(playerid)) // if he isnt in a vehicle
    {
        return SendClientMessage(playerid,COLOR_RED,"You have to be in a vehicle to use this.");
    }
    new vid;
    vid=GetPlayerVehicleID(playerid);
    AttachObectToVehicle(drvo,vid,1062.80004883,-338.20001221,74.80000305,0,0,0);
    SendClientMessage(playerid,COLOR_GREEN,"Object attached.");
    return 1;
}
untested
Reply
#4

again disappears :@
Reply
#5

When attaching object x,y,z are not location of vehicle but the offset.

https://sampwiki.blast.hk/wiki/AttachObjectToVehicle

In your case they are toooo big. Rectify it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)