Jump to content

[HELP] attachElementToBone it does not work?


PlayAkoya

Recommended Posts

Hi,

i use the Resource https://community.multitheftauto.com/in ... ls&id=2540

My Script:

function onGivePlayerPizzaBox (player) 
  
    if (getPlayerName(player) == "[sR]PlayAkoya") then 
        local pname = getPlayerName(player) 
        burger = createObject(2880, 0, 0, 0) --1582 
        setElementDimension(burger, 0) 
        attachElementToBone(burger, player, 12, 0, 0, 0, 0, -90, 0) 
        outputChatBox("Debug: PIZZA FIXSIERT!", root, 200, 200, 0) 
    else 
        outputChatBox("Du bist nicht befugt den Test Command zu nutzen!", player, 200, 0, 0) 
    end 
end 
addCommandHandler("pizza", onGivePlayerPizzaBox, false, false) 

The objects are not firmed on players?! :cry:

Can anyone help, please?

Link to comment
#PUSH!

Can anyone help me with my problem? :?

You need to call bone_attach resource like this:

function onGivePlayerPizzaBox (player) 
    if (not isElement(player)) then return end 
        if isPedInVehicle (player) then return end 
        local pname = getPlayerName(player) 
        if not (pname == "[sR]PlayAkoya") then  
        outputChatBox("Du bist nicht befugt den Test Command zu nutzen!", player, 200, 0, 0) return end 
        burger = createObject(2880, 0, 0, 0)  
    setElementDimension(burger, getElementDimension (player)) 
    export.bone_attach:attachElementToBone(burger, player, 12, 0, 0, 0, 0, -90, 0) 
    outputChatBox("Debug: PIZZA FIXSIERT!",player, 200, 200, 0) 
end 
addCommandHandler("pizza", onGivePlayerPizzaBox) 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...