Jump to content

Need help in my script


Majhol

Recommended Posts

Posted

Hold on, you forgot to specify the bone to attach it to.

exports [ "bone_attach" ]:attachElementToBone(kb_beer,player,24,0,0,0,0,0,0) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Try it?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Post your new code.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
local pepsi = createObject( 955, 1463.5, -2206, 12.5, 0, 0, 0 ) 
local myMarker1 = createMarker( 1463.4791259766, -2207.4919433594, 13.546875, "cylinder", 1, 255, 255, 0, 170 ) 
local kb_beer = createObject( 1950, 1463.5, -2206, 12.5, 0, 0, 0 ) 
  
  
 function MarkerHit1( player, matchingDimension )  
        takePlayerMoney ( player, tonumber(150) ) 
        setPedAnimation( player, "VENDING", "VEND_Drink_P", -1, true, false, true ) 
        setTimer(function () setPedAnimation ( player, nil, nil) end,1300,1, true) 
        outputChatBox( "لقد استعدت قوتك", player, 255, 0, 0 ) 
        setPedRotation ( player, 0 ) 
        setElementHealth ( player, 100 ) 
        exports [ "VEND_Drink_P" ]:attachElementToBone(kb_beer,player,24,0,0,0,0,0,0)end 
  
addEventHandler( "onMarkerHit", myMarker1, MarkerHit1 ) 

Posted

You named the bone_attach resource: "VEND_Drink_P"?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Does it work now?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
Does it work now?

Nope, this is the finale code

  
local pepsi = createObject( 955, 1463.5, -2206, 12.5, 0, 0, 0 ) 
local myMarker1 = createMarker( 1463.4791259766, -2207.4919433594, 13.546875, "cylinder", 1, 255, 255, 0, 170 ) 
local kb_beer = createObject( 1950, 0, 0, 0, 0, 0, 0 ) 
  
  
 function MarkerHit1( player, matchingDimension )  
        takePlayerMoney ( player, tonumber(150) ) 
        setPedAnimation( player, "VENDING", "VEND_Drink_P", -1, true, false, true ) 
        setTimer(function () setPedAnimation ( player, nil, nil) end,1300,1, true) 
        outputChatBox( "لقد استعدت قوتك", player, 255, 0, 0 ) 
        setPedRotation ( player, 0 ) 
        setElementHealth ( player, 100 ) 
        exports [ "bone_attach" ]:attachElementToBone(kb_beer,player,24,0,0,0,0,0,0)end 
  
addEventHandler( "onMarkerHit", myMarker1, MarkerHit1 ) 

Posted
exports [ "bone_attach" ]:attachElementToBone ( kb_beer, player, 12, 0.015, 0.03, 0, 180, 0, 0 ) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

lool

look now when I go to the marker he do the animation and nothing in the hand and I got shocked with this bottle in his hand xD

s41kyx.png

Posted

I guess we are close to the target

all I want is him drinking the beer while in the marker and then the bottle should be gone xD

Posted

Change the offsets until it fits.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

no what I mean I want to set a timer with it so when he drinks the bottle after 1300 the bottle should be gone not the position of the bottle

Posted
local pepsi = createObject ( 955, 1463.5, -2206, 12.5, 0, 0, 0 ) 
local myMarker1 = createMarker ( 1463.4791259766, -2207.4919433594, 13.546875, "cylinder", 1, 255, 255, 0, 170 ) 
  
function MarkerHit1 ( player, matchingDimension ) 
    takePlayerMoney ( player, 150 ) 
    setPedAnimation ( player, "VENDING", "VEND_Drink_P", -1, true, false, true ) 
    local kb_beer = createObject( 1950, 0, 0, 0, 0, 0, 0 ) 
    setTimer ( 
        function ( beer ) 
            setPedAnimation ( player, nil, nil ) 
            if isElement ( beer ) then 
                destroyElement ( beer ) 
            end 
        end 
        ,1300, 1, kb_beer 
    ) 
    outputChatBox ( "??? ?????? ????", player, 255, 0, 0 ) 
    setPedRotation ( player, 0 ) 
    setElementHealth ( player, 100 ) 
    exports [ "bone_attach" ]:attachElementToBone ( kb_beer, player, 24, 0, 0, 0, 0, 0, 0 ) 
end 
addEventHandler ( "onMarkerHit", myMarker1, MarkerHit1 ) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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...