Advertisement
Guest User

Untitled

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