DecaK

Untitled

Mar 20th, 2018
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.10 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <engine>
  3. #include <fun>
  4. #include <superspawns>
  5.  
  6. new picked[33] = 0;
  7.  
  8. new const wpn_lista[][] = {
  9. "weapon_p228",
  10. "weapon_scout",
  11. "weapon_hegrenade",
  12. "weapon_xm1014",
  13. "weapon_mac10",
  14. "weapon_aug",
  15. "weapon_elite",
  16. "weapon_fiveseven",
  17. "weapon_ump45",
  18. "weapon_sg550",
  19. "weapon_galil",
  20. "weapon_famas",
  21. "weapon_usp",
  22. "weapon_glock18",
  23. "weapon_awp",
  24. "weapon_mp5navy",
  25. "weapon_m249",
  26. "weapon_m3",
  27. "weapon_m4a1",
  28. "weapon_tmp",
  29. "weapon_g3sg1",
  30. "weapon_deagle",
  31. "weapon_sg552",
  32. "weapon_ak47",
  33. "weapon_p90"
  34. }
  35.  
  36. //new const model[] = "models/box/w_box.mdl"
  37. new const model[] = "models/w_m4a1.mdl"
  38. new g_sprite
  39.  
  40. public plugin_init() {
  41. register_plugin("Private JB Game", "1.0", "DecaK / Megastorm")
  42. register_touch("WPBox", "player", "touchbox");
  43. register_clcmd("say start", "Start")
  44. SsInit(3500.0)
  45. SsScan()
  46. SsDump()
  47. }
  48.  
  49. public Start(id) {
  50. new Float:origin[3];
  51. for(new i = 0;i < 34; i++) if(SsGetOrigin(origin)) create_wpbox(origin)
  52. SsClean();
  53. arrayset(picked, 0, 33)
  54. }
  55.  
  56. /*public plugin_precache2()
  57. {
  58. precache_model(model)
  59. g_sprite = precache_model("sprites/box/box_sprite.spr")
  60. precache_sound("box/touched.wav")
  61. }*/
  62.  
  63. public create_wpbox(Float:Origin[3])
  64. {
  65. new ent = create_entity("info_target")
  66.  
  67. entity_set_origin(ent, Origin)
  68. entity_set_string(ent, EV_SZ_classname, "WPBox")
  69. entity_set_model(ent, model)
  70. set_rendering ( ent, kRenderFxGlowShell, random_num(128,255),random_num(128,255),random_num(128,255), kRenderFxNone, 255 )
  71. entity_set_int(ent, EV_INT_solid, SOLID_BBOX)
  72. entity_set_int(ent, EV_INT_movetype, MOVETYPE_PUSHSTEP)
  73. entity_set_size(ent,Float:{-2.0,-2.0,-2.0},Float:{5.0,5.0,5.0})
  74. drop_to_floor(ent)
  75. /*
  76. engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, Origin, 0)
  77. write_byte(TE_BEAMCYLINDER) // TE id
  78. engfunc(EngFunc_WriteCoord, OriginZrtve[0]) // x
  79. engfunc(EngFunc_WriteCoord, OriginZrtve[1]) // y
  80. engfunc(EngFunc_WriteCoord, OriginZrtve[2]) // z
  81. engfunc(EngFunc_WriteCoord, OriginZrtve[0]) // x axis
  82. engfunc(EngFunc_WriteCoord, OriginZrtve[1]) // y axis
  83. engfunc(EngFunc_WriteCoord, OriginZrtve[2]+385.0) // z axis
  84. write_short(g_sprite) // sprite
  85. write_byte(0) // startframe
  86. write_byte(0) // framerate
  87. write_byte(4) // life
  88. write_byte(30) // width
  89. write_byte(0) // noise
  90. write_byte(250) // red
  91. write_byte(0) // green
  92. write_byte(0) // blue
  93. write_byte(200) // brightness
  94. write_byte(0) // speed
  95. message_end()
  96. */
  97. }
  98.  
  99. public daj_oruzje(id) give_item(id, wpn_lista[random_num(0, sizeof(wpn_lista))])
  100. public client_connect(id) picked[id] = 0;
  101.  
  102. public touchbox(ent, toucher)
  103. {
  104. if (!is_user_alive(toucher) || !pev_valid(ent) || picked[toucher] > 3)
  105. return FMRES_IGNORED
  106. new classname[32]
  107. pev(ent, pev_classname, classname, 31)
  108. if (!equal(classname, "WPBox"))
  109. return FMRES_IGNORED
  110. daj_oruzje(toucher)
  111. picked[toucher]++;
  112. emit_sound(toucher, CHAN_ITEM, "box/touched.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
  113. set_pev(ent, pev_effects, EF_NODRAW)
  114. set_pev(ent, pev_solid, SOLID_NOT)
  115. if(pev_valid(ent)) engfunc(EngFunc_RemoveEntity, ent)
  116. return FMRES_IGNORED
  117. }
Advertisement
Add Comment
Please, Sign In to add comment