设为首页收藏本站新闻投稿

MOD中国同盟社

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 485|回复: 1

[求助] 帮我修改个插件,怎么控制spr的大小和透明与否 [复制链接]

Modder  发表于 2011-12-6 23:04:40
  1. #include <amxmod>

  2. //----------------------------------------------------------------------------------------------

  3. public plugin_init()
  4. {
  5. // Plugin Info
  6. register_plugin("Xiao J Medkit","1.0","duper/Rockell & X-man/H")
  7. register_cvar("amx_medkit", "1")

  8. // 掉钱捡钱的金钱数目
  9. register_cvar("amx_money", "300")

  10. register_event("ResetHUD", "newRound","b")
  11. register_event("DeathMsg","deathevent","a")
  12. }

  13. //----------------------------------------------------------------------------------------------

  14. public newRound()
  15. {
  16. new chocolate = find_ent_by_class(-1, "chocolate")
  17. while(chocolate) {
  18. remove_entity(chocolate)
  19. chocolate = find_ent_by_class(chocolate, "chocolate")
  20. }
  21. return PLUGIN_CONTINUE
  22. }
  23. //----------------------------------------------------------------------------------------------

  24. public deathevent()
  25. {
  26. if ( !get_cvar_num("amx_medkit") )
  27. return PLUGIN_CONTINUE

  28. new killer = read_data(1)
  29. new victim = read_data(2)

  30. if ( killer != victim )
  31. {

  32. createChocolate(victim)

  33. if(cs_get_user_money(victim)>=get_cvar_num("amx_money"))
  34. {
  35. cs_set_user_money(victim, cs_get_user_money(victim)-get_cvar_num("amx_money"))
  36. }
  37. else cs_set_user_money(victim, 0)
  38. }

  39. if(is_user_connected(victim))
  40. cs_reset_user_model(victim)
  41. return PLUGIN_CONTINUE
  42. }
  43. //----------------------------------------------------------------------------------------------

  44. public createChocolate(victim)
  45. {
  46. new Float:vAim[3], Float:vOrigin[3]
  47. entity_get_vector(victim, EV_VEC_origin, vOrigin)
  48. (victim, random_num(2, 4))

  49. vOrigin[0] += vAim[0]
  50. vOrigin[1] += vAim[1]
  51. vOrigin[2] += 30.0

  52. new Float:velo[3]
  53. velo[0] = random_float(0.1,150.0)
  54. velo[1] = random_float(0.1,150.0)
  55. velo[2] = random_float(0.1,150.0)+0.0

  56. new chocolate = create_entity("info_target")
  57. entity_set_string(chocolate, EV_SZ_classname, "xj")
  58. entity_set_model(chocolate, "sprites/money33.spr")
  59. entity_set_size(chocolate, Float:{-2.5, -2.5, -1.5}, Float:{2.5, 2.5, 1.5})
  60. entity_set_int(chocolate, EV_INT_solid, 2)
  61. entity_set_int(chocolate, EV_INT_movetype, MOVETYPE_TOSS)
  62. entity_set_vector(chocolate, EV_VEC_origin, vOrigin)
  63. entity_set_vector(chocolate, EV_VEC_velocity, velo)
  64. }

  65. //----------------------------------------------------------------------------------------------

  66. public plugin_precache() {
  67. precache_model("sprites/money33.spr")
  68. precache_sound( "misc/killChicken.wav")


  69. }

  70. //----------------------------------------------------------------------------------------------

  71. public pfn_touch(ptr, ptd){
  72. if(!is_valid_ent(ptd) || !is_valid_ent(ptr))
  73. return PLUGIN_CONTINUE

  74. if(!is_user_connected(ptd) || !is_user_alive(ptd))
  75. return PLUGIN_CONTINUE

  76. new classname[32]
  77. entity_get_string(ptr, EV_SZ_classname, classname, 31)
  78. if(equal(classname, "xj"))
  79. {
  80. cs_set_user_money(ptd, cs_get_user_money(ptd)+get_cvar_num("amx_money"))
  81. emit_sound(ptd,CHAN_VOICE,"misc/killChicken.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
  82. remove_entity(ptr)
  83. }
  84. return PLUGIN_CONTINUE
  85. }

  86. public client_death(killer, victim, wpnindex, hitplace, TK)
  87. {
  88. if(wpnindex == CSW_C4 && is_user_connected(victim))
  89. cs_reset_user_model(victim)
  90. }
复制代码

使用道具

Rank: 7Rank: 7Rank: 7

帖子
249
精华
0
声望
1627 点
金币
438 Mold
被赞许
7 次
注册时间
2011-1-27

可爱小猫 懒人勋章

发表于 2011-12-7 13:38:30 |显示全部楼层
路见不顺     拳打脚踢

使用道具 举报

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

回顶部