Jump to content

damage Library .


Kenix

Recommended Posts

Posted

the script does not work = (

  
function damageLibrary ( attacker, weapon, bodypart, loss ) 
    if ( weapon == 4 ) then 
        setElementHealth ( source, getElementHealth(source) - 50 ) 
    elseif ( weapon == 6 ) then 
        setElementHealth ( source, getElementHealth(source) - 100 ) 
        end 
    if ( weapon == 9 ) then 
        setElementHealth ( source, getElementHealth(source) - 200 ) 
    elseif ( weapon == 5 ) then 
        setElementHealth ( source, getElementHealth(source) - 100 ) 
        end 
    if ( weapon == 24 ) then 
        setElementHealth ( source, getElementHealth(source) - 200 ) 
    elseif ( weapon == 25 ) then 
        setElementHealth ( source, getElementHealth(source) - 200 ) 
        end 
    if ( weapon == 26 ) then 
        setElementHealth ( source, getElementHealth(source) - 100 ) 
    elseif ( weapon == 27 ) then 
        setElementHealth ( source, getElementHealth(source) - 100 ) 
        end 
    if ( weapon == 28 ) then 
        setElementHealth ( source, getElementHealth(source) - 20 ) 
    elseif ( weapon == 29 ) then 
        setElementHealth ( source, getElementHealth(source) - 25 ) 
        end 
    if ( weapon == 32 ) then 
        setElementHealth ( source, getElementHealth(source) - 20 ) 
    elseif ( weapon == 30 ) then 
        setElementHealth ( source, getElementHealth(source) - 66 ) 
        end 
    if ( weapon == 31 ) then 
        setElementHealth ( source, getElementHealth(source) - 40 )         
    elseif ( weapon == 33 ) then 
        setElementHealth ( source, getElementHealth(source) - 100 ) 
        end 
    if ( weapon == 34 ) then 
        setElementHealth ( source, getElementHealth(source) - 200 ) 
    elseif ( weapon == 0 ) then 
        setElementHealth ( source, getElementHealth(source) - 50 )                   
    end 
end 
  
addEventHandler ( "onPlayerDamage", getRootElement (), damageLibrary  ) 
  

http://vk.com/the_kenix

Вопросы задавайте на форуме, не пишите мне в личку.

Please don't pm me.

Posted

doesnt work at all or doesnt work as intended?

PS: i bet you have to also remove the default player damage by cancelling onClientPlayerDamage event.

PS2:

if then

elseif then

elseif then

elseif then

...

end

but imo better make a damage table like damage[weaponid] = damageamount to avoid these elseif's.

?

Posted

thanks a lot but there is a bug with one weapon and it is not in the script when I shoot from the spaz-12 is a player kick.

[2010-12-26 21:07:05] QUIT: {O.J.}CARTER(RUS) left the game [Quit]

P.S in the log says that it came out but he actually kicked.

http://vk.com/the_kenix

Вопросы задавайте на форуме, не пишите мне в личку.

Please don't pm me.

Posted

this is anticheat in action. disable anticheat checking on your server, or maybe try triggering an custom event that will set element health from your current event handler

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

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