Jump to content

Medic Change


yMassai

Recommended Posts

local skin = {[275] = true} 
  
--Medic 
function healFlowers (attacker, attackerweapon, bodypart, loss) 
  theHealth = getElementHealth (source) 
    if not skin[getElementModel(attacker)] then return end --checks attackers skin 
      if ( theHealth > 95 ) then --checks clients health 
        if (getPlayerMoney(attacker) < 200) then --checks attacker money 
          setPlayerMoney (attacker, 0) 
        else 
          takePlayerMoney (attacker, 200) --takes attackers money for DMing to earn more 
          outputChatBox("Hospital: Don't DM to get more money. Your pay has been lowered.",attacker,0,255,255) --info in chatbox 
        end 
      else 
        if (attackerweapon == 14) and (loss > 1) and ( theHealth < 95 ) then 
          setElementHealth ( source, theHealth+17 ) --sets clients health+17 
          givePlayerMoney (attacker, 1.7*theHealth) --pays the medic -- you can change the 1.7 to another number or the whole equation to make a different payout 
      end 
    end 
end 
addEventHandler ("onPlayerDamage", getRootElement(), healFlowers ) 

This script is a doctor, he can give life to the players with a flower.

one could replace the flower and put to life with a spray? :wink:

Edited by Guest
Link to comment

This should work..

  
function cancel ( attacker, weapon, bodypart, loss )  
    if ( weapon == 41 ) then  
        cancelEvent() 
    end 
end 
addEventHandler ( "onClientPlayerDamage", getlocalPlayer(), cancel ) 
  

Edited.

Edited by Guest
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...