joubouti Posted May 15, 2015 Share Posted May 15, 2015 hi i have a problem with this scrip if i click on the button i get the health but i don't get the armor , i don't know why please someone help me function click() if source == Health_Button then local Player = getLocalPlayer() setElementHealth ( Player, 200) setPedArmor ( Player, 100) end end addEventHandler("onClientGUIClick", resourceRoot, click) Link to comment
GTX Posted May 15, 2015 Share Posted May 15, 2015 setPedArmor is server-side only function. Link to comment
joubouti Posted May 15, 2015 Author Share Posted May 15, 2015 setPedArmor is server-side only function. please give me server-side script Link to comment
GTX Posted May 15, 2015 Share Posted May 15, 2015 Client-side: function click() if source == Health_Button then triggerServerEvent("armor::set", localPlayer) end end addEventHandler("onClientGUIClick", resourceRoot, click) Server-side: function setArmor() setElementHealth(source, 200) setPedArmor(source, 100) end addEvent("armor::set", true) addEventHandler("armor::set", root, setArmor) Link to comment
joubouti Posted May 15, 2015 Author Share Posted May 15, 2015 Client-side: function click() if source == Health_Button then triggerServerEvent("armor::set", localPlayer) end end addEventHandler("onClientGUIClick", resourceRoot, click) Server-side: function setArmor() setElementHealth(source, 200) setPedArmor(source, 100) end addEvent("armor::set", true) addEventHandler("armor::set", root, setArmor) thx man Link to comment
GTX Posted May 15, 2015 Share Posted May 15, 2015 Client-side: function click() if source == Health_Button then triggerServerEvent("armor::set", localPlayer) end end addEventHandler("onClientGUIClick", resourceRoot, click) Server-side: function setArmor() setElementHealth(source, 200) setPedArmor(source, 100) end addEvent("armor::set", true) addEventHandler("armor::set", root, setArmor) thx man You're welcome. 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