Jump to content

setPedArmor


Recommended Posts

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

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

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