Advertisement
Guest User

Untitled

a guest
Nov 11th, 2019
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.70 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <cstrike>
  4. #include <engine>
  5. #include <fakemeta>
  6. #include <fakemeta_util>
  7. #include <hamsandwich>
  8.  
  9. #define PLUGIN "BonusBox"
  10. #define VERSION "1.0"
  11. #define AUTHOR "Aragon*"
  12.  
  13. //#define GOLD_SISTEM
  14.  
  15. #if defined GOLD_SISTEM
  16. #include <furien30_shop>
  17. #endif
  18.  
  19. #define BB_CLASS "Death_BonusBox"
  20. #define BB_FURIEN_MODEL "models/www_gamezeer_ro/w_gift.mdl"
  21. #define BB_ANTIFURIEN_MODEL "models/www_gamezeer_ro/w_gift.mdl"
  22.  
  23. //#define SPAWNBOX_SOUND "Furien/BonusBoxSpawn.wav"
  24. //#define TAKEBOX_SOUND "Furien/BonusBoxGet.wav"
  25.  
  26. static const ServerLicensedIp[ ] = "89.40.233.137";
  27.  
  28. //DANE EDIT
  29. new Kills[33],
  30. bool: MultiJump[33],
  31. bool: HaveMultiJump[33],
  32. JumpNum[33]
  33. new const restricted_maps[][] = {
  34. "35hp",
  35. "35hp_2",
  36. "css_bycadust",
  37. "fy_snow",
  38. "awp_garden",
  39. "awp_bycastor32",
  40. "awp_zigzag",
  41. "awp_bucuresti",
  42. "35hp_32",
  43. "awp_bycastor",
  44. "awp_india"
  45. }
  46.  
  47. native set_user_puncte(INDDEX, PUNCTE)
  48. native get_user_puncte(INDEX)
  49. native set_user_key(INDEX, KEY)
  50. native get_user_key(INDEX)
  51. native set_user_chest(INDEX, CHEST)
  52. native get_user_chest(INDEX)
  53.  
  54. public plugin_init() {
  55. register_plugin(PLUGIN, VERSION, AUTHOR)
  56.  
  57. new ServerIp[20];
  58. get_user_ip(0, ServerIp, charsmax(ServerIp), 1);
  59.  
  60. if(equal(ServerIp, ServerLicensedIp)) {
  61. new MapName[32]
  62. get_mapname(MapName, sizeof MapName - 1)
  63. for(new i; i < sizeof restricted_maps; i++) {
  64. if(!equal(MapName, restricted_maps[i]))
  65. plugin_init2()
  66. else
  67. pause("ade");
  68. }
  69. }
  70. else
  71. pause("ade");
  72. }
  73.  
  74. public plugin_init2() {
  75. register_logevent("LOGEVENT_RoundStart",2,"1=Round_Start")
  76. register_event("DeathMsg", "EVENT_Death", "a")
  77.  
  78. register_think(BB_CLASS,"BonusBox_Think")
  79. register_touch(BB_CLASS, "player", "BonusBox_Touch")
  80.  
  81. register_forward(FM_PlayerPreThink, "FWD_PlayerPreThink");
  82. }
  83.  
  84. public plugin_precache() {
  85. precache_model(BB_FURIEN_MODEL)
  86. precache_model(BB_ANTIFURIEN_MODEL)
  87.  
  88. //precache_sound(SPAWNBOX_SOUND)
  89. // precache_sound(TAKEBOX_SOUND)
  90. }
  91.  
  92. public client_putinserver(id) {
  93. JumpNum[id] = 0
  94. Kills[id] = 0;
  95. MultiJump[id] = false
  96. HaveMultiJump[id] = false
  97. }
  98.  
  99. public FWD_PlayerPreThink(id) {
  100. if(is_user_connected(id) && is_user_alive(id)) {
  101. if((get_user_button(id) & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(get_user_oldbutton(id) & IN_JUMP) && HaveMultiJump[id]) {
  102. if(JumpNum[id] < 2) {
  103. MultiJump[id] = true
  104. JumpNum[id]++
  105. }
  106. }
  107. if((get_user_button(id) & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
  108. JumpNum[id] = 0
  109. }
  110. }
  111.  
  112. public client_PostThink(id) {
  113. if(is_user_connected(id) && is_user_alive(id) && MultiJump[id]) {
  114. new Float: Velocity[3]
  115. entity_get_vector(id, EV_VEC_velocity, Velocity)
  116. Velocity[2] = random_float(265.0, 285.0)
  117. entity_set_vector(id, EV_VEC_velocity, Velocity)
  118. MultiJump[id] = false
  119. }
  120. }
  121.  
  122. public LOGEVENT_RoundStart()
  123. remove_entity_name(BB_CLASS)
  124.  
  125. public EVENT_Death()
  126. {
  127. new victim = read_data(2);
  128. new attacker = read_data(1)
  129.  
  130. if(is_user_connected(victim) && cs_get_user_team(victim) != CS_TEAM_SPECTATOR && is_user_connected(attacker) && attacker != victim)
  131. {
  132. Kills[attacker]++
  133.  
  134. if(Kills[attacker] == 5)
  135. {
  136. new ent, Float:Origin[3], Float:Angles[3];
  137.  
  138. ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"));
  139. engfunc(EngFunc_GetAttachment, victim, 0, Origin, Angles);
  140. pev(victim, pev_angles, Angles);
  141.  
  142. set_pev(ent, pev_origin, Origin);
  143. set_pev(ent, pev_angles, Angles);
  144. set_pev(ent, pev_solid, SOLID_BBOX);
  145. set_pev(ent, pev_movetype, MOVETYPE_PUSHSTEP);
  146.  
  147. set_pev(ent, pev_classname, BB_CLASS);
  148.  
  149. switch(get_user_team(victim)) {
  150. case 1: {
  151. entity_set_model(ent, BB_ANTIFURIEN_MODEL);
  152. entity_set_int(ent, EV_INT_team, 2);
  153. }
  154. case 2: {
  155. entity_set_model(ent, BB_FURIEN_MODEL);
  156. entity_set_int(ent, EV_INT_team, 1);
  157. }
  158. }
  159.  
  160. engfunc(EngFunc_SetSize, ent, Float:{-10.0, -10.0, -25.0},Float:{10.0, 10.0, 25.0})
  161. engfunc(EngFunc_DropToFloor, ent);
  162. set_pev(ent, pev_animtime, get_gametime());
  163. set_pev(ent, pev_framerate, 1.0);
  164.  
  165. set_pev(ent, pev_nextthink, halflife_time() + 0.01);
  166. Kills[attacker] = 0
  167. }
  168. }
  169. }
  170.  
  171. public BonusBox_Think(entity) {
  172. if(is_valid_ent(entity)) {
  173. switch(pev(entity, pev_team)) {
  174. case 1: {
  175. Light(entity, 4, 200, 0, 0)
  176.  
  177. }
  178. case 2: {
  179. Light(entity, 4, 0, 0, 200)
  180. }
  181. }
  182. set_pev(entity, pev_nextthink, halflife_time() + 0.01);
  183. }
  184. }
  185.  
  186. public BonusBox_Touch(box, touch)
  187. {
  188. if(is_valid_ent(box))
  189. {
  190. if(is_user_connected(touch) && pev(box, pev_team) == get_user_team(touch))
  191. {
  192. switch (random_num(1, 5))
  193. {
  194. case 1:
  195. {
  196. HaveMultiJump[touch] = true;
  197. Print(touch, "^x03[XMAS Gifts]^x04 Mosul^x01 ti-a oferit^x04 MULTI-JUMP");
  198. //formatex ( GiftName [ id ], charsmax ( GiftName [ ] ), "No Recoil^nDescriere: Gloantele nu mai sar." );
  199. }
  200.  
  201. case 2:
  202. {
  203. set_user_puncte(touch, get_user_puncte(touch) + 100)
  204. Print( touch,"^x03[XMAS Gifts]^x04 Mosul^x01 ti-a oferit^x04 100 PUNCTE" );
  205. //formatex ( GiftName [ id ], charsmax ( GiftName [ ] ), "Unlimited Clip^nDescriere: AI PRIMIT 100 PUNCTE" );
  206. }
  207.  
  208. case 3: {
  209. set_user_key(touch, get_user_key(touch) + 1)
  210. Print ( touch, "^x03[XMAS Gifts]^x04 Mosul^x01 ti-a oferit^x04 1 KEY" );
  211. remove_entity(box);
  212. //formatex ( GiftName [ touch ], charsmax ( GiftName [ ] ), "Unlimited Clip^nDescriere: AI PRIMIT 1 KEY" );
  213. }
  214.  
  215. case 4: {
  216. set_user_chest(touch, get_user_chest(touch) + 1)
  217. Print ( touch, "^x03[XMAS Gifts]^x04 Mosul^x01 ti-a oferit^x04 1 CHEST" );
  218. //formatex ( GiftName [ id ], charsmax ( GiftName [ ] ), "Unlimited Clip^nDescriere: AI PRIMIT 1 CHEST" );
  219. }
  220.  
  221. case 5: {
  222. cs_set_user_money ( touch, 16000 );
  223. Print ( touch, "^x03[XMAS Gifts]^x04 Mosul^x01 ti-a darut niste bani!" );
  224. //formatex ( GiftName [ id ], charsmax ( GiftName [ ] ), "Full Money^nDescriere: 16k$" );
  225. }
  226. }
  227. entity_set_int(box, EV_INT_solid, SOLID_NOT);
  228. remove_entity(box);
  229. return PLUGIN_CONTINUE;
  230. }
  231. }
  232. return PLUGIN_CONTINUE;
  233. }
  234.  
  235. stock Light(entity, radius, red, green, blue) {
  236. if(is_valid_ent(entity)) {
  237. static Float:origin[3]
  238. pev(entity, pev_origin, origin)
  239.  
  240. message_begin(MSG_BROADCAST, SVC_TEMPENTITY, _, entity);
  241. write_byte(TE_DLIGHT)
  242. engfunc(EngFunc_WriteCoord, origin[0])
  243. engfunc(EngFunc_WriteCoord, origin[1])
  244. engfunc(EngFunc_WriteCoord, origin[2])
  245. write_byte(radius)
  246. write_byte(red)
  247. write_byte(green)
  248. write_byte(blue)
  249. write_byte(1)
  250. write_byte(0)
  251. message_end();
  252. }
  253. }
  254.  
  255. stock Print(const id, const input[], any:...) {
  256. new count = 1, players[32];
  257. static msg[191];
  258. vformat(msg, 190, input, 3);
  259.  
  260. if(id) players[0] = id;
  261. else get_players(players, count, "ch"); {
  262. for(new i = 0; i < count; i++) {
  263. if(is_user_connected(players[i])) {
  264. message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
  265. write_byte(players[i]);
  266. write_string(msg);
  267. message_end();
  268. }
  269. }
  270. }
  271. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement