[HELP] I attached flamethrower in MTA to car but here it attachs a bed ??!! WTF! HELP
#1

Here is code:
pawn Код:
#define FILTERSCRIPT
#include <a_samp>

new FlameThrower1;
new DeathVehicle1;

#define PRESSED(%0) \
    (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
   
forward FlameThrowerTimer1();
#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    DeathVehicle1 = CreateVehicle(405,-2073.0219726563,-83.703521728516,35.1640625, 0, 158, 158, 60);
    FlameThrower1 = CreateObject(14446,0,0,0,0,0,0);
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

#else

main()
{
}

#endif

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/2", cmdtext, true, 10) == 0)
    {
        PutPlayerInVehicle(playerid, DeathVehicle1, 0);
        return 1;
    }
    return 0;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if (PRESSED(KEY_FIRE))//LEFT_MOUSE
    {
    if (IsPlayerInVehicle(playerid, DeathVehicle1))
        {
        AttachObjectToVehicle(FlameThrower1,DeathVehicle1,0.457519535,-2.84314728,-2.20000076,0,0,180);
        SetTimer("FlameThrowerTimer1",3000,false);
        }
    }
    return 1;
}

public FlameThrowerTimer1()
{
    DestroyObject(FlameThrower1);
}
There are no errors
Reply
#2

Код:
 AttachObjectToVehicle(14446,DeathVehicle1,0.457519535,-2.84314728,-2.20000076,0,0,180);
Reply
#3

That`s right But In Game It Attachs A bed
Reply
#4

then u selected a wrong object id
Reply
#5

Fixed Thanks
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)