Advertisement
Guest User

Untitled

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