Discuz! Board

标题: [代码|Code]显示伤害类型|Display Damage Type [打印本页]

作者: Jerry小坏    时间: 2017-7-13 16:50
标题: [代码|Code]显示伤害类型|Display Damage Type

  1. #include < amxmodx >
  2. #include < fakemeta >
  3. #include < hamsandwich >

  4. public plugin_init( )
  5. {
  6.         register_plugin( "Damage Type Display", "1.0", "ESFKAMI" )
  7.         RegisterHam( Ham_TakeDamage, "player", "@TakeDamage", true )
  8. }

  9. public @TakeDamage( __int_Victim, __int_Inflictor, __int_Attacker, Float: __float_Damage, __bit_DamageType )
  10. {
  11.         switch( __bit_DamageType )
  12.         {
  13.                 case 0: client_print( __int_Victim, print_center, "Damage Type: DMG_GENERIC" )
  14.                 case (1<<0): client_print( __int_Victim, print_center, "Damage Type: DMG_CRUSH" )
  15.                 case (1<<1): client_print( __int_Victim, print_center, "Damage Type: DMG_BULLET" )
  16.                 case (1<<2): client_print( __int_Victim, print_center, "Damage Type: DMG_SLASH" )
  17.                 case (1<<3): client_print( __int_Victim, print_center, "Damage Type: DMG_BURN" )
  18.                 case (1<<4): client_print( __int_Victim, print_center, "Damage Type: DMG_FREEZE" )
  19.                 case (1<<5): client_print( __int_Victim, print_center, "Damage Type: DMG_FALL" )
  20.                 case (1<<6): client_print( __int_Victim, print_center, "Damage Type: DMG_BLAST" )
  21.                 case (1<<7): client_print( __int_Victim, print_center, "Damage Type: DMG_CLUB" )
  22.                 case (1<<8): client_print( __int_Victim, print_center, "Damage Type: DMG_SHOCK" )
  23.                 case (1<<9): client_print( __int_Victim, print_center, "Damage Type: DMG_SONIC" )
  24.                 case (1<<10): client_print( __int_Victim, print_center, "Damage Type: DMG_ENERGYBEAM" )
  25.                 case (1<<12): client_print( __int_Victim, print_center, "Damage Type: DMG_NEVERGIB" )
  26.                 case (1<<13): client_print( __int_Victim, print_center, "Damage Type: DMG_ALWAYSGIB" )
  27.                 case (1<<14): client_print( __int_Victim, print_center, "Damage Type: DMG_DROWN" )
  28.                 case (1<<15): client_print( __int_Victim, print_center, "Damage Type: DMG_PARALYZE" )
  29.                 case (1<<16): client_print( __int_Victim, print_center, "Damage Type: DMG_NERVEGAS" )
  30.                 case (1<<17): client_print( __int_Victim, print_center, "Damage Type: DMG_POISON" )
  31.                 case (1<<18): client_print( __int_Victim, print_center, "Damage Type: DMG_RADIATION" )
  32.                 case (1<<19): client_print( __int_Victim, print_center, "Damage Type: DMG_DROWNRECOVER" )
  33.                 case (1<<20): client_print( __int_Victim, print_center, "Damage Type: DMG_ACID" )
  34.                 case (1<<21): client_print( __int_Victim, print_center, "Damage Type: DMG_SLOWBURN" )
  35.                 case (1<<22): client_print( __int_Victim, print_center, "Damage Type: DMG_SLOWFREEZE" )
  36.                 case (1<<23): client_print( __int_Victim, print_center, "Damage Type: DMG_MORTAR" )
  37.                 case (~(0x3fff)): client_print( __int_Victim, print_center, "Damage Type: DMG_TIMEBASED" )
  38.                
  39.         }
  40. }
复制代码





欢迎光临 Discuz! Board (https://esfbbs.foxnyx.top/) Powered by Discuz! X3.2