Jump to content

Simple I think (Help)


Recommended Posts

function healFlowers (attacker, attackerweapon, bodypart, loss) 
  theHealth = getElementHealth (source) 
  if (attackerweapon == 14) and (loss > 1) and ( theHealth < 80 ) then 
    setElementHealth ( source, 100 ) 
    takePlayerMoney (source, 100) 
    givePlayerMoney (attacker, 100) 
  end 
end 
addEventHandler ("onPlayerDamage", getRootElement(), healFlowers ) 

after heal medic can damage player with flowers how to make not able ?

also

  
-Hospital 
 local EnterMarker = createMarker( 1607.22, 1816.25, 11.82, 'arrow', 2.0, 0, 255, 0, 150 ) 
   
  function MarkerHit( hitElement, matchingDimension )  
  setElementInterior ( hitElement, 3, 389.85, 173.49, 1008.38 ) 
  end 
   
 addEventHandler( "onMarkerHit", EnterMarker, MarkerHit ) 

how to set dimension ? so for this their dimension is 1

Link to comment
  
function healFlowers (attacker, attackerweapon, bodypart, loss) 
  theHealth = getElementHealth (source) 
  if (attackerweapon == 14) and (loss > 1) and ( theHealth < 80 ) then 
    cancelEvent() 
    setElementHealth ( source, 100 ) 
    takePlayerMoney (source, 100) 
    givePlayerMoney (attacker, 100) 
  end 
end 
addEventHandler ("onPlayerDamage", getRootElement(), healFlowers ) 
  
  

maybe something like that.

  
  
-Hospital 
 local EnterMarker = createMarker( 1607.22, 1816.25, 11.82, 'arrow', 2.0, 0, 255, 0, 150 ) 
   
  function MarkerHit( hitElement, matchingDimension )  
  setElementInterior ( hitElement, 3, 389.85, 173.49, 1008.38 ) 
  setElementDimension ( hitElement, 1 ) 
  end 
   
addEventHandler( "onMarkerHit", EnterMarker, MarkerHit ) 
  
  

setElementDimension ( player argument, int dimension )

Link to comment
  • Moderators
CowTurbo, the event onPlayerDamage can't be canceled, wiki note:

It should also be noted that canceling this event has no effect. Cancel the client-side event onClientPlayerDamage instead.

So:

function healFlowers (attacker, attackerweapon, bodypart, loss) 
  if (attackerweapon == 14) then 
    cancelEvent() 
  end 
end 
addEventHandler ("onPlayerDamage", getRootElement(), healFlowers ) 

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