Jump to content

help with a givePlayerMoney problem


Recommended Posts

Making this script for a suggestion on CIT (already suggested it so don't think about stealing) but im having many problems with the givePlayerMoney part. Here is script.

function grow1() 
    tree1 = createObject(616, -267, -1358, -30) 
    moveObject(tree1, 30000, -267, -1358,7.5) 
    healthtime1 = setTimer (health1, 30000, 1) 
end 
addCommandHandler("tree", grow1) 
  
function health1() 
    ped1 = createPed ( 0, -267, -1358,8) 
    setElementAlpha ( ped1, 0 ) 
    attachElements(ped1, tree1) 
    falltime1 = setTimer (treefall1, 100, 0) 
end 
  
function treefall1(player) 
    if (isPedDead ( ped1 ) ) then 
        killTimer ( falltime1 ) 
        moveObject(tree1, 1000, -267, -1358,7.5, 90, 0, 0) 
        setTimer(sink1, 3000, 1) 
        outputChatBox("You've cut down a tree! Here is your pay!", getRootElement(), 0, 255, 0, true ) 
        givePlayerMoney ( player, 1000 ) 
    end 
end 
  
function sink1() 
    moveObject(tree1, 10000, -267, -1358,4, 90, 0, 0) 
    setTimer(grow1, 10200, 1) 
    setTimer(reset1, 10000, 1) 
end 
  
function reset1() 
    destroyElement(tree1) 
end 

Link to comment
Guest Guest4401
function grow1(player) 
    tree1 = createObject(616, -267, -1358, -30) 
    moveObject(tree1, 30000, -267, -1358,7.5) 
    healthtime1 = setTimer (health1, 30000, 1,player) 
end 
addCommandHandler("tree", grow1) 
  
function health1(player) 
    ped1 = createPed ( 0, -267, -1358,8) 
    setElementAlpha ( ped1, 0 ) 
    attachElements(ped1, tree1) 
    falltime1 = setTimer (treefall1, 100, 0,player) 
end 
  
function treefall1(player) 
    if (isPedDead ( ped1 ) ) then 
        killTimer ( falltime1 ) 
        moveObject(tree1, 1000, -267, -1358,7.5, 90, 0, 0) 
        setTimer(sink1, 3000, 1) 
        outputChatBox("You've cut down a tree! Here is your pay!", getRootElement(), 0, 255, 0, true ) 
        givePlayerMoney ( player, 1000 ) 
    end 
end 
  
function sink1() 
    moveObject(tree1, 10000, -267, -1358,4, 90, 0, 0) 
    setTimer(grow1, 10200, 1) 
    setTimer(reset1, 10000, 1) 
end 
  
function reset1() 
    destroyElement(tree1) 
end 

Link to comment
function grow1(player) 
    tree1 = createObject(616, -267, -1358, -30) 
    moveObject(tree1, 30000, -267, -1358,7.5) 
    healthtime1 = setTimer (health1, 30000, 1,player) 
end 
addCommandHandler("tree", grow1) 
  
function health1(player) 
    ped1 = createPed ( 0, -267, -1358,8) 
    setElementAlpha ( ped1, 0 ) 
    attachElements(ped1, tree1) 
    falltime1 = setTimer (treefall1, 100, 0,player) 
end 
  
function treefall1(player) 
    if (isPedDead ( ped1 ) ) then 
        killTimer ( falltime1 ) 
        moveObject(tree1, 1000, -267, -1358,7.5, 90, 0, 0) 
        setTimer(sink1, 3000, 1,player) 
        outputChatBox("You've cut down a tree! Here is your pay!", player, 0, 255, 0, true ) 
        givePlayerMoney ( player, 1000 ) 
    end 
end 
  
function sink1(player) 
    moveObject(tree1, 10000, -267, -1358,4, 90, 0, 0) 
    setTimer(grow1, 10200, 1,player) 
    setTimer(reset1, 10000, 1) 
end 
  
function reset1() 
    destroyElement(tree1) 
end 

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