yMassai Posted March 26, 2012 Posted March 26, 2012 (edited) 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? Edited March 27, 2012 by Guest
Kenix Posted March 26, 2012 Posted March 26, 2012 What the problem find id here? https://wiki.multitheftauto.com/wiki/Weapons Also use [xml][/xml] tags!
yMassai Posted March 27, 2012 Author Posted March 27, 2012 I tested the script with other players. I noticed a problem. sprey can also take the life of the players, but i not know how. can anyone help me?
Axel Posted March 27, 2012 Posted March 27, 2012 (edited) This should work.. function cancel ( attacker, weapon, bodypart, loss ) if ( weapon == 41 ) then cancelEvent() end end addEventHandler ( "onClientPlayerDamage", getlocalPlayer(), cancel ) Edited. Edited March 27, 2012 by Guest
Castillo Posted March 27, 2012 Posted March 27, 2012 It should also be noted that canceling this event has no effect. Cancel the client-side event onClientPlayerDamage instead.
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