Jump to content

Paramedic Command


iRack

Recommended Posts

-- Copy to 'server.lua'

function healPlayer(player, cmd, name, price)
  if not name or not price then
    outputChatBox("/heal [Player_Name] [Price]", player, 255, 255, 255, true)
  else
    local target = getPlayerFromName(name)
    if target then
      if getPlayerMoney(target)>=tonumber(price) then
        takePlayerMoney(target, tonumber(price))
        givePlayerMoney(player, tonumber(price))
        setElementHealth(target, 100)
        outputChatBox(getPlayerName(player) .. " healed you!", player, 255, 255, 255, true)
        outputChatBox("You healed " .. getPlayerName(target), player, 255, 255, 255, true)
      else
        outputChatBox("Can't pay the healing", player, 255, 255, 255, true)
      end
    else
      outputChatBox("I can't find the target!", player, 255, 255, 255, true)
    end
end
addCommandHandler("heal", healPlayer)
  
-- Copy to 'meta.xml'
  
<meta>
  <script src="server.lua" type="server"/>
</meta>

 

Edited by holuzs
  • Thanks 1
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...