Jump to content

question about window


Chaos

Recommended Posts

function stopDamage ( )   

 addEventHandler ( "onClientPlayerDamage", getLocalPlayer(), stopMinigunDamage )

end

function stopMinigunDamage()

player = getLocalPlayer()

setElementHealth (player,getElementHealth (player) +25)

end

I think you mean that is that correct and if correct is there a shortcut?

Link to comment

I think that the functions must be created before, try this: (stopDamage function is not eeeded!)

--addEventHandler ( "onClientPlayerDamage", getLocalPlayer(), stopMinigunDamage ) 
function stopMinigunDamage() 
health = getElementHealth(localPlayer) 
setElementHealth (localPlayer, health +25) 
end 
addEventHandler ( "onClientPlayerDamage", getRootElement(), stopMinigunDamage ) 

Link to comment
function stopDamage ( )    
 addEventHandler ( "onClientPlayerDamage", getLocalPlayer(), stopMinigunDamage ) 
addEventHandler("onClientPlayerStealthKill", getLocalPlayer(), stopMinigunDamage ) 
end 
  
function stopMinigunDamage() 
player = getLocalPlayer() 
setElementHealth (player,getElementHealth (player) +100) 
cancelEvent () 
end 

correct?

Link to comment

i'm plan to make a marker is that possible?

  
    addEvent ( "test", true ) 
    addEventHandler ( "test", getRootElement(), 
    function( )   
      local x, y, z = getElementPosition ( source ) 
      local theMarker = createMarker ( x , y , z, "cylinder", 2, 0, 0, 0, 0 ) 
   addEventHandler( "onMarkerHit", theMarker, antizombies ) 
    end) 
      
    function antizombies(h) 
    if not isElement(h) then return end 
    if getElementData(h,"zombie") then killPed(h) end  
    end 
  
  

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