Jump to content

question about window


Chaos

Recommended Posts

Posted

Yes, you can also use that to disable it.

The zombies can still hurt you because the zombies script uses setElementHealth, and "onClientPlayerDamage" doesn't cancel that.

Posted

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?

Posted

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 ) 

Posted

It is needed, because he wants to add the event when he presses a key, you should read the entire topic before reply, don't take it the wrong way.

@Chaos: That should work, yes.

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

correct?

Posted

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 
  
  

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