Kenix Posted December 26, 2010 Share Posted December 26, 2010 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 ) Link to comment
Aibo Posted December 26, 2010 Share Posted December 26, 2010 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. Link to comment
Kenix Posted December 26, 2010 Author Share Posted December 26, 2010 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. Link to comment
dzek (varez) Posted December 26, 2010 Share Posted December 26, 2010 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 Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now