Discuz! Board

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 2|回复: 0
打印 上一主题 下一主题

[代码|Code]显示伤害类型|Display Damage Type

[复制链接]

189

主题

189

帖子

580

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
580
跳转到指定楼层
楼主
发表于 2017-7-13 16:50:33 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

  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. }
复制代码
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Comsenz Inc.  

GMT+8, 2026-10-26 05:55 , Processed in 0.218595 second(s), 21 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表