waleedgh Posted June 3, 2016 Share Posted June 3, 2016 addEventHandler("onClientGUIClick",heal, function () health = getElementHealth(source) walo=getPlayerMoney(player) if (walo<=3000) and (health<=100) then outputChatBox("you Don't have enough money",200,0,0) return end if (health>=100) and (walo>=3000) then outputChatBox("your health is already full",30,200,0) return end if (walo>=3000) and (health<=100) then setElementHealth(root,20) takePlayerMoney(3000) outputChatBox("you have bought medicine",20,30,200) end end) attempt to compare number with boolean healp (walo means money) Link to comment
ViRuZGamiing Posted June 3, 2016 Share Posted June 3, 2016 onClientGUIClick - Source: The source of this event is the GUI element that was clicked. player is undefined. Both health and walo are false, so you're compairing numbers with false. Link to comment
waleedgh Posted June 3, 2016 Author Share Posted June 3, 2016 onClientGUIClick - Source:The source of this event is the GUI element that was clicked. player is undefined. Both health and walo are false, so you're compairing numbers with false. addEventHandler("onClientGUIClick",heal, function () health = getElementHealth() walo=getPlayerMoney() if (walo<=3000) and (health<=100) then outputChatBox("you Don't have enough money",200,0,0) return end if (health>=100) and (walo>=3000) then outputChatBox("your health is already full",30,200,0) return end if (walo>=3000) and (health<=100) then setElementHealth(root,20) takePlayerMoney(3000) outputChatBox("you have bought medicine",20,30,200) end end) ?? Link to comment
BEN. Posted June 6, 2016 Share Posted June 6, 2016 addEventHandler("onClientGUIClick",heal, function () health = getElementHealth(localPlayer) walo=getPlayerMoney(localPlayer) if (walo<3000) and (health<=100) then outputChatBox("you Don't have enough money",200,0,0) elseif (health>=100) and (walo>=3000) then outputChatBox("your health is already full",30,200,0) elseif (walo>=3000) and (health<=100) then setElementHealth(localPlayer,20) takePlayerMoney(3000) outputChatBox("you have bought medicine",20,30,200) end end) https://wiki.multitheftauto.com/wiki/GetLocalPlayer Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now