Jump to content

[AYUDA] setTimer


Javier

Recommended Posts

playersTouched = { } 
  
function incremento ( attacker, weapon, bodypart, loss ) 
    if ( attacker and getElementType ( attacker ) == "ped" and getElementData ( attacker, "zombie" ) ) then 
        playersTouched [ source ] = true 
    end 
end 
addEventHandler ( "onPlayerDamage", getRootElement(), incremento ) 
  
setTimer ( 
    function ( ) 
        for player, _ in pairs ( playersTouched ) do 
            setPedArmor ( player, ( getPedArmor ( player ) + 10 ) ) 
        end 
    end 
    ,120000, 0 
) 
  
addEventHandler( "onPlayerWasted", getRootElement( ), 
function() 
        playersTouched [ source ] = false 
end 
) 

Link to comment
playersTouched = { } 
  
function incremento ( attacker, weapon, bodypart, loss ) 
    if ( attacker and getElementType ( attacker ) == "ped" and getElementData ( attacker, "zombie" ) ) then 
        playersTouched [ source ] = true 
    end 
end 
addEventHandler ( "onPlayerDamage", getRootElement(), incremento ) 
  
setTimer ( 
    function ( ) 
        for player, _ in pairs ( playersTouched ) do 
            setPedArmor ( player, ( getPedArmor ( player ) + 10 ) ) 
        end 
    end 
    ,120000, 0 
) 
  
addEventHandler ( "onPlayerWasted", root, 
    function ( ) 
        playersTouched [ source ] = nil 
    end 
) 

El problema de pekio era que no quito al jugador de la tabla, nomas cambio el valor a 'false'.

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...