Advertisement
Guest User

Untitled

a guest
Jul 24th, 2019
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.67 KB | None | 0 0
  1.  
  2. #include <amxmodx>
  3. #include <amxmisc>
  4. #include <cstrike>
  5. #include <fun>
  6. #include <fakemeta_util>
  7. #include <hamsandwich>
  8. #include <engine>
  9.  
  10. #define Keysrod (1<<0)|(1<<1)|(1<<9)
  11. #define ITEM_HE (1<<0) // "a"
  12. #define ITEM_FS (1<<1) // "b"
  13. #define ITEM_SG (1<<2) // "c"
  14. #define ITEM_DG (1<<3) // "d"
  15. #define ITEM_VH (1<<4) // "e"
  16. #define ITEM_DF (1<<5) // "f"
  17. #define ITEM_NV (1<<6) // "g"
  18.  
  19. new jumpnum[33] = 0
  20. new bool:dojump[33] = false
  21. new hk_File4[ 128 ];
  22. new hk_VipsList[ 128 ][ 32 ], hk_TotalLines;
  23. new hk_IsUserVip[ 33 ];
  24. new hk_viplist[ ] = "vips_list.ini";
  25. new hk_Folder[ ] = "Vip";
  26. new hk_cfg[ ] = "vip-config";
  27. new hk_File[ 128 ];
  28. new hk_File1[ 128 ];
  29. new g_type, g_hudmsg
  30. new vip_hud
  31. new maxplayers
  32. new mpd, mkb, mhb
  33. new health_add
  34. new health_hs_add
  35. new health_max
  36. new hk_Killer
  37. new hk_KillerHp
  38. new hk_HpAdd
  39. new hk_HpMax
  40. new jumps, items
  41. new hk_iRoundCount
  42. new bool:hk_IsRestarting
  43. new gun_menu
  44. new cvardmg
  45.  
  46. enum
  47. {
  48. Primary = 1
  49. , Secondary
  50. , Knife
  51. , Grenades
  52. , C4
  53. };
  54.  
  55. public plugin_init()
  56. {
  57. register_plugin("Vip", "2.1", "Leustean")
  58.  
  59. register_concmd("say /vips", "showAdmin", ADMIN_ALL, "")
  60. register_concmd("amx_addvips", "addvips", ADMIN_RCON, "<Nume sau SteamID>")
  61. register_concmd("amx_vips", "vips", ADMIN_RCON, "Lista Vip-urilor")
  62.  
  63. RegisterHam ( Ham_Spawn, "player", "Hook_PlayerSpawn", 1 )
  64. register_event("Damage", "on_damage", "b", "2!0", "3=0", "4!0")
  65. register_event("DeathMsg", "hook_death", "a", "1>0")
  66. register_event("Damage","Damage","b")
  67. register_event("DeathMsg","death_msg","a")
  68. register_menucmd(register_menuid("rod"), Keysrod, "Pressedrod")
  69. register_event("TextMsg", "Event_TextMsg_Restart", "a", "2&#Game_C", "2&#Game_w")
  70. register_event("HLTV", "Event_HLTV_New_Round", "a", "1=0", "2=0")
  71. RegisterHam(Ham_TakeDamage, "player", "Ham_CBasePlayer_TakeDamage_Pre")
  72.  
  73. register_cvar("vip_maxjumps","1")
  74. jumps = register_cvar("vip_jumps","1")
  75. vip_hud = register_cvar("vip_hud","1")
  76. g_type = register_cvar("vip_bulletdamage","1")
  77. health_add = register_cvar("vip_hp_kill", "10")
  78. health_hs_add = register_cvar("vip_hp_hs", "25")
  79. health_max = register_cvar("vip_hp_max", "100")
  80. mpd = register_cvar("vip_money_damage","3")
  81. mkb = register_cvar("vip_money_kill","500")
  82. mhb = register_cvar("vip_money_hs","1000")
  83. items = register_cvar("vip_items_round", "abcdefg")
  84. gun_menu = register_cvar("vip_gun_menu","1")
  85. cvardmg = register_cvar("vip_damage","2")
  86. g_hudmsg = CreateHudSyncObj()
  87. maxplayers = get_maxplayers()
  88.  
  89.  
  90. }
  91.  
  92. public plugin_cfg()
  93. {
  94.  
  95.  
  96. new Dir[ 64 ];
  97. get_configsdir(Dir,charsmax(Dir));
  98. formatex ( hk_File, charsmax ( hk_File ), "%s/%s", Dir, hk_Folder );
  99. formatex ( hk_File1, charsmax ( hk_File1 ), "%s/%s.cfg", hk_File, hk_cfg );
  100. if(!dir_exists(hk_File))
  101. mkdir(hk_File);
  102.  
  103. formatex ( hk_File4, charsmax ( hk_File4 ), "%s/%s", hk_File, hk_viplist );
  104.  
  105. if (!file_exists(hk_File4))
  106. write_file(hk_File4,"; -->VIP List<--");
  107.  
  108. new hk_Buffer[ 192 ], hk_Line, hk_Len;
  109. while ( ( hk_Line = read_file ( hk_File4, hk_Line, hk_Buffer, charsmax ( hk_Buffer ), hk_Len ) ) )
  110. {
  111. if ( ! strlen ( hk_Buffer ) || hk_Buffer[ 0 ] == ';' || ( hk_Buffer[ 0 ] == '/' && hk_Buffer[ 1 ] == '/' ) )
  112. continue;
  113.  
  114. copy ( hk_VipsList[ hk_TotalLines++ ], 32, hk_Buffer );
  115.  
  116. }
  117.  
  118. if(!file_exists(hk_File1))
  119. {
  120. write_file(hk_File1,"// Vip Configuration File")
  121. write_file(hk_File1,"")
  122. write_file(hk_File1,"")
  123. write_file(hk_File1,"// BulletDamage - afiseaza dmg-ul facut unui jucator")
  124. write_file(hk_File1,"// 1 - Activat 0 - Dezactivat")
  125. write_file(hk_File1,"vip_bulletdamage ^"1^"")
  126. write_file(hk_File1,"")
  127. write_file(hk_File1,"// Vips Online")
  128. write_file(hk_File1,"// Arata Vip-urile online in HUD prin scrierea in chat a comenzii /vips")
  129. write_file(hk_File1,"// 1 - Activat 0 - Dezactivat")
  130. write_file(hk_File1,"vip_hud ^"1^"")
  131. write_file(hk_File1,"")
  132. write_file(hk_File1,"// Hp primit pe un kill ")
  133. write_file(hk_File1,"vip_hp_kill ^"10^"")
  134. write_file(hk_File1,"")
  135. write_file(hk_File1,"// Hp primit pe un hs")
  136. write_file(hk_File1,"vip_hp_hs ^"25^"")
  137. write_file(hk_File1,"")
  138. write_file(hk_File1,"// Valoarea maxima a hp-ului pe care o poate avea Vip-ul")
  139. write_file(hk_File1,"vip_hp_max ^"100^"")
  140. write_file(hk_File1,"")
  141. write_file(hk_File1,"// Banii primiti pe un damage")
  142. write_file(hk_File1,"vip_money_damage ^"3^"")
  143. write_file(hk_File1,"")
  144. write_file(hk_File1,"// Banii primiti pe un kill")
  145. write_file(hk_File1,"vip_money_kill ^"500^"")
  146. write_file(hk_File1,"")
  147. write_file(hk_File1,"// Banii primiti pe un hs")
  148. write_file(hk_File1,"vip_money_hs ^"1000^"")
  149. write_file(hk_File1,"")
  150. write_file(hk_File1,"// Guns Menu - afiseaza meniul cu arme")
  151. write_file(hk_File1,"// Pe hartile de tip AWP, acest meniu va fi automat dezactivat")
  152. write_file(hk_File1,"// 1 - Activat 0 - Dezactivat")
  153. write_file(hk_File1,"vip_gun_menu ^"1^"")
  154. write_file(hk_File1,"")
  155. write_file(hk_File1,"// Items per round - primiti diverse obiecte la inceputul fiecarei runde")
  156. write_file(hk_File1,"// a - He Grenade")
  157. write_file(hk_File1,"// b - Flashbang (x2)")
  158. write_file(hk_File1,"// c - Smoke Grenade ")
  159. write_file(hk_File1,"// d - Deagle")
  160. write_file(hk_File1,"// e - Vest + Helm")
  161. write_file(hk_File1,"// f - Defuse Kit (Doar CT)")
  162. write_file(hk_File1,"// g - NightVision")
  163. write_file(hk_File1,"vip_items_round ^"abcdefg^"")
  164. write_file(hk_File1,"")
  165. write_file(hk_File1,"// Jumps - Salturi")
  166. write_file(hk_File1,"// 1 - Activat 0 - Dezactivat")
  167. write_file(hk_File1,"vip_jumps ^"1^"")
  168. write_file(hk_File1,"")
  169. write_file(hk_File1,"// Cate sarituri in plus poate sa faca deodata")
  170. write_file(hk_File1,"vip_maxjumps ^"1^"")
  171. write_file(hk_File1,"")
  172. write_file(hk_File1,"// De cate ori damage-ul jucatorului se mareste indiferent de arma")
  173. write_file(hk_File1,"// ex: daca este 2, atunci jucatorului i se mareste dmg-ul de 2 ori")
  174. write_file(hk_File1,"vip_damage ^"2^"")
  175. write_file(hk_File1,"")
  176.  
  177.  
  178. }
  179.  
  180. server_cmd("exec %s",hk_File1)
  181. }
  182.  
  183. public client_putinserver(id)
  184. {
  185.  
  186. hk_IsUserVip[ id ] = 0;
  187. jumpnum[id] = 0
  188. dojump[id] = false
  189. }
  190.  
  191. public client_disconnect(id)
  192. {
  193.  
  194. hk_IsUserVip[ id ] = 0;
  195. jumpnum[id] = 0
  196. dojump[id] = false
  197. }
  198. public addvips(id, level, cid)
  199. {
  200. if (!cmd_access(id, level, cid, 2))
  201. return PLUGIN_HANDLED
  202.  
  203. new arg[32]
  204.  
  205. read_argv(1, arg, 31)
  206.  
  207. new szLog[256];
  208. formatex(szLog,255,"%s",arg);
  209. write_file(hk_File4,szLog,-1);
  210. console_print(id, "[Olds.ro] Vip-ul a fost adaugat in lista")
  211.  
  212. return PLUGIN_HANDLED
  213.  
  214. }
  215. public vips(id, level, cid)
  216. {
  217. if (!cmd_access(id, level, cid, 1))
  218. return PLUGIN_HANDLED
  219.  
  220. new s_Name[ 32 ], s_AuthID[ 32 ];
  221. get_user_name ( id, s_Name, 31 );
  222. get_user_authid ( id, s_AuthID, 31 );
  223.  
  224. console_print(id, "======> Www.Olds.Ro <======")
  225. for ( new i; i < hk_TotalLines; i++ )
  226. {
  227. if ( strcmp ( s_Name, hk_VipsList[ i ] ) || strcmp ( s_AuthID, hk_VipsList[ i ] ) )
  228. console_print(id, " - %s", hk_VipsList[ i ])
  229.  
  230.  
  231. }
  232. console_print(id, "======> Www.Olds.Ro <======")
  233. return PLUGIN_HANDLED
  234. }
  235.  
  236.  
  237. public Event_TextMsg_Restart()
  238. {
  239. hk_IsRestarting = true
  240. }
  241.  
  242. public Event_HLTV_New_Round()
  243. {
  244. if( hk_IsRestarting )
  245. {
  246. hk_IsRestarting = false
  247. hk_iRoundCount = 0
  248. }
  249. }
  250.  
  251. public Hook_PlayerSpawn ( const id )
  252. {
  253. if ( ! is_user_alive ( id ) )
  254. return HAM_IGNORED;
  255. if ( ! is_user_vip ( id ) )
  256. {
  257. hk_IsUserVip[ id ] = 0;
  258. return HAM_IGNORED;
  259. }
  260.  
  261. hk_IsUserVip[ id ] = 1;
  262. hk_iRoundCount++
  263. new map[32];
  264. get_mapname(map,31);
  265.  
  266. if(equali(map, "awp_", 3))
  267. return HAM_IGNORED;
  268.  
  269. if (get_pcvar_num(gun_menu) == 1)
  270. if(hk_iRoundCount>=4)
  271. Showrod(id);
  272.  
  273. set_task(0.3, "giveitems", id)
  274. return HAM_IGNORED;
  275. }
  276.  
  277. public Ham_CBasePlayer_TakeDamage_Pre( const id, const iInflictor, const iAttacker, const Float:flDamage, const iDamageType )
  278. {
  279. if ( ! is_user_vip ( iAttacker ) )
  280. {
  281. hk_IsUserVip[ iAttacker ] = 0;
  282. return HAM_IGNORED;
  283. }
  284. hk_IsUserVip[ iAttacker ] = 1;
  285.  
  286. new dmg1 = get_pcvar_num(cvardmg)
  287.  
  288. if( iDamageType == DMG_FALL )
  289. SetHamParamFloat(4, flDamage*1)
  290. else
  291. SetHamParamFloat(4, flDamage*dmg1)
  292.  
  293. return HAM_IGNORED
  294. }
  295.  
  296. public on_damage(id)
  297. {
  298. if(get_pcvar_num(g_type))
  299. {
  300. static attacker; attacker = get_user_attacker(id)
  301. static damage; damage = read_data(2)
  302.  
  303. if ( is_user_vip ( attacker ) )
  304. {
  305. hk_IsUserVip[ id ] = 1;
  306.  
  307. if(is_user_connected(attacker))
  308. {
  309. if(fm_is_ent_visible(attacker,id))
  310. {
  311. set_hudmessage(0, 100, 200, -1.0, 0.55, 2, 0.1, 4.0, 0.02, 0.02, -1)
  312. ShowSyncHudMsg(attacker, g_hudmsg, "%i^n", damage)
  313. }
  314.  
  315.  
  316. }
  317. }else hk_IsUserVip[ id ] = 0;
  318. }
  319. }
  320.  
  321. public Damage(id)
  322. {
  323. new weapon, hitpoint, attacker = get_user_attacker(id,weapon,hitpoint)
  324. if(attacker<=maxplayers && is_user_alive(attacker) && attacker!=id)
  325.  
  326. if ( is_user_vip ( id ) )
  327. {
  328. hk_IsUserVip[ id ] = 1;
  329. new money = read_data(2) * get_pcvar_num(mpd)
  330. if(hitpoint==1) money += get_pcvar_num(mhb)
  331. cs_set_user_money(attacker,cs_get_user_money(attacker) + money)
  332. }else hk_IsUserVip[ id ] = 0;
  333. }
  334.  
  335. public death_msg()
  336. {
  337. if(read_data(1)<=maxplayers && read_data(1) && read_data(1)!=read_data(2))
  338. cs_set_user_money(read_data(1),cs_get_user_money(read_data(1)) + get_pcvar_num(mkb) - 300)
  339. }
  340.  
  341. public hook_death()
  342. {
  343. hk_Killer = read_data(1)
  344.  
  345. if ( (read_data(3) == 1) && (read_data(5) == 0) )
  346. {
  347. hk_HpAdd = get_pcvar_num (health_hs_add)
  348. }
  349. else
  350. hk_HpAdd = get_pcvar_num (health_add)
  351.  
  352. hk_HpMax = get_pcvar_num (health_max)
  353.  
  354.  
  355. if ( ! is_user_vip ( hk_Killer ) )
  356. {
  357. hk_IsUserVip[ hk_Killer ] = 0;
  358. return;
  359. }
  360. hk_IsUserVip[ hk_Killer ] = 1;
  361.  
  362. hk_KillerHp = get_user_health(hk_Killer)
  363. hk_KillerHp += hk_HpAdd
  364.  
  365. if (hk_KillerHp > hk_HpMax) hk_KillerHp = hk_HpMax
  366. set_user_health(hk_Killer, hk_KillerHp)
  367.  
  368. set_hudmessage(0, 255, 0, -1.0, 0.15, 0, 1.0, 1.0, 0.1, 0.1, -1)
  369. show_hudmessage(hk_Killer, "Healed +%d hp", hk_HpAdd)
  370.  
  371. }
  372.  
  373. public showAdmin(id)
  374. {
  375. if(get_pcvar_num(vip_hud) == 1)
  376. {
  377.  
  378.  
  379. new num, iLen, admin
  380. static pl[32], name[32], szBuff[2048]
  381.  
  382. get_players(pl, num, "c")
  383.  
  384. for(new i = 0; i < num; i++)
  385. {
  386. if ( is_user_vip ( pl[i] ) )
  387. {
  388. hk_IsUserVip[ pl[i] ] = 1;
  389. get_user_name(pl[i], name, 31)
  390. iLen += format(szBuff[iLen], 2048 - iLen, "%d. %s^n", admin + 1, name)
  391. admin++
  392. }
  393.  
  394. }
  395.  
  396.  
  397. set_hudmessage(0, 255, 0, 0.02, 0.2, 0, 6.0, 7.0 )
  398. show_hudmessage(id, " %s online:^n%s", admin > 1 ? "Vips" : "Vips", szBuff)
  399.  
  400. arrayset(szBuff, 0, 2048)
  401. }
  402. return PLUGIN_HANDLED
  403. }
  404.  
  405. public client_PreThink(id)
  406. {
  407. if(!is_user_alive(id)) return PLUGIN_CONTINUE
  408. if(get_pcvar_num(jumps) == 0) return PLUGIN_CONTINUE
  409.  
  410. if ( ! is_user_vip ( id ) )
  411. {
  412. hk_IsUserVip[ id ] = 0;
  413. return PLUGIN_CONTINUE
  414. }
  415.  
  416.  
  417. hk_IsUserVip[ id ] = 1;
  418. new nbut = get_user_button(id)
  419. new obut = get_user_oldbutton(id)
  420. if((nbut & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(obut & IN_JUMP))
  421. {
  422. if(jumpnum[id] < get_cvar_num("vip_maxjumps"))
  423. {
  424. dojump[id] = true
  425. jumpnum[id]++
  426. return PLUGIN_CONTINUE
  427. }
  428. }
  429. if((nbut & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
  430. {
  431. jumpnum[id] = 0
  432. return PLUGIN_CONTINUE
  433. }
  434.  
  435. return PLUGIN_CONTINUE
  436. }
  437.  
  438. public client_PostThink(id)
  439. {
  440. if(!is_user_alive(id)) return PLUGIN_CONTINUE
  441. if(get_pcvar_num(jumps) == 0) return PLUGIN_CONTINUE
  442.  
  443. if ( ! is_user_vip ( id ) )
  444. {
  445. hk_IsUserVip[ id ] = 0;
  446. return PLUGIN_CONTINUE
  447. }
  448.  
  449.  
  450. hk_IsUserVip[ id ] = 1;
  451. if(dojump[id] == true)
  452. {
  453. new Float:velocity[3]
  454. entity_get_vector(id,EV_VEC_velocity,velocity)
  455. velocity[2] = random_float(265.0,285.0)
  456. entity_set_vector(id,EV_VEC_velocity,velocity)
  457. dojump[id] = false
  458. return PLUGIN_CONTINUE
  459. }
  460.  
  461. return PLUGIN_CONTINUE
  462. }
  463.  
  464. public Showrod(id)
  465. {
  466. show_menu(id, Keysrod, "Guns Menu^n\w1. M4a1^n\w2. AK47^n0. Exit^n", -1, "rod")
  467. }
  468.  
  469. public Pressedrod(id, key)
  470. {
  471.  
  472. switch (key) {
  473. case 0: {
  474. StripWeapons(id, Primary)
  475. give_item(id,"weapon_m4a1")
  476. cs_set_user_bpammo(id, CSW_M4A1, 90 );
  477. }
  478.  
  479. case 1: {
  480. StripWeapons(id, Primary)
  481. give_item(id,"weapon_ak47")
  482. cs_set_user_bpammo(id, CSW_AK47, 90);
  483. }
  484.  
  485. case 9: {
  486. }
  487. }
  488. return PLUGIN_CONTINUE
  489. }
  490.  
  491. public get_item_flags()
  492. {
  493. new sFlags[24]
  494. get_pcvar_string(items,sFlags,23)
  495. return read_flags(sFlags)
  496. }
  497.  
  498. public giveitems(id)
  499. {
  500. new iFlags = get_item_flags()
  501. new CsTeams:userTeam = cs_get_user_team(id)
  502.  
  503. if (iFlags&ITEM_HE)
  504. fm_give_item(id,"weapon_hegrenade")
  505.  
  506.  
  507. if(iFlags&ITEM_FS)
  508. {
  509. fm_give_item(id,"weapon_flashbang")
  510. fm_give_item(id,"weapon_flashbang")
  511. }
  512.  
  513. if(iFlags&ITEM_SG)
  514. fm_give_item(id,"weapon_smokegrenade")
  515.  
  516.  
  517. if(iFlags&ITEM_DG)
  518. {
  519. StripWeapons(id, Secondary);
  520. fm_give_item(id,"weapon_deagle")
  521. cs_set_user_bpammo(id, CSW_DEAGLE, 35 );
  522. }
  523.  
  524. if(iFlags&ITEM_VH)
  525. fm_give_item(id,"item_assaultsuit")
  526.  
  527. if(userTeam == CS_TEAM_CT && iFlags&ITEM_DF)
  528. fm_give_item(id,"item_thighpack")
  529.  
  530. if(iFlags&ITEM_NV)
  531. cs_set_user_nvg(id, 1)
  532.  
  533.  
  534. }
  535.  
  536. stock is_user_vip ( id )
  537. {
  538. new s_Name[ 32 ], s_AuthID[ 32 ];
  539. get_user_name ( id, s_Name, 31 );
  540. get_user_authid ( id, s_AuthID, 31 );
  541.  
  542. for ( new i; i < hk_TotalLines; i++ )
  543. {
  544. if ( ! strcmp ( s_Name, hk_VipsList[ i ] ) )
  545. return 1;
  546. if ( ! strcmp ( s_AuthID, hk_VipsList[ i ] ) )
  547. return 1;
  548. }
  549.  
  550. return 0;
  551.  
  552. }
  553.  
  554. stock StripWeapons(id, Type, bool: bSwitchIfActive = true)
  555. {
  556. new iReturn;
  557.  
  558. if(is_user_alive(id))
  559. {
  560. new iEntity, iWeapon;
  561. while((iWeapon = GetWeaponFromSlot(id, Type, iEntity)) > 0)
  562. iReturn = ham_strip_user_weapon(id, iWeapon, Type, bSwitchIfActive);
  563. }
  564.  
  565. return iReturn;
  566. }
  567.  
  568. stock GetWeaponFromSlot( id , iSlot , &iEntity )
  569. {
  570. if ( !( 1 <= iSlot <= 5 ) )
  571. return 0;
  572.  
  573. iEntity = 0;
  574. const m_rgpPlayerItems_Slot0 = 367;
  575. const m_iId = 43;
  576. const XO_WEAPONS = 4;
  577. const XO_PLAYER = 5;
  578.  
  579. iEntity = get_pdata_cbase( id , m_rgpPlayerItems_Slot0 + iSlot , XO_PLAYER );
  580.  
  581. return ( iEntity > 0 ) ? get_pdata_int( iEntity , m_iId , XO_WEAPONS ) : 0;
  582. }
  583.  
  584. stock ham_strip_user_weapon(id, iCswId, iSlot = 0, bool:bSwitchIfActive = true)
  585. {
  586. new iWeapon
  587. if( !iSlot )
  588. {
  589. static const iWeaponsSlots[] = {
  590. -1,
  591. 2, //CSW_P228
  592. -1,
  593. 1, //CSW_SCOUT
  594. 4, //CSW_HEGRENADE
  595. 1, //CSW_XM1014
  596. 5, //CSW_C4
  597. 1, //CSW_MAC10
  598. 1, //CSW_AUG
  599. 4, //CSW_SMOKEGRENADE
  600. 2, //CSW_ELITE
  601. 2, //CSW_FIVESEVEN
  602. 1, //CSW_UMP45
  603. 1, //CSW_SG550
  604. 1, //CSW_GALIL
  605. 1, //CSW_FAMAS
  606. 2, //CSW_USP
  607. 2, //CSW_GLOCK18
  608. 1, //CSW_AWP
  609. 1, //CSW_MP5NAVY
  610. 1, //CSW_M249
  611. 1, //CSW_M3
  612. 1, //CSW_M4A1
  613. 1, //CSW_TMP
  614. 1, //CSW_G3SG1
  615. 4, //CSW_FLASHBANG
  616. 2, //CSW_DEAGLE
  617. 1, //CSW_SG552
  618. 1, //CSW_AK47
  619. 3, //CSW_KNIFE
  620. 1 //CSW_P90
  621. }
  622. iSlot = iWeaponsSlots[iCswId]
  623. }
  624.  
  625. const XTRA_OFS_PLAYER = 5
  626. const m_rgpPlayerItems_Slot0 = 367
  627.  
  628. iWeapon = get_pdata_cbase(id, m_rgpPlayerItems_Slot0 + iSlot, XTRA_OFS_PLAYER)
  629.  
  630. const XTRA_OFS_WEAPON = 4
  631. const m_pNext = 42
  632. const m_iId = 43
  633.  
  634. while( iWeapon > 0 )
  635. {
  636. if( get_pdata_int(iWeapon, m_iId, XTRA_OFS_WEAPON) == iCswId )
  637. {
  638. break
  639. }
  640. iWeapon = get_pdata_cbase(iWeapon, m_pNext, XTRA_OFS_WEAPON)
  641. }
  642.  
  643. if( iWeapon > 0 )
  644. {
  645. const m_pActiveItem = 373
  646. if( bSwitchIfActive && get_pdata_cbase(id, m_pActiveItem, XTRA_OFS_PLAYER) == iWeapon )
  647. {
  648. ExecuteHamB(Ham_Weapon_RetireWeapon, iWeapon)
  649. }
  650.  
  651. if( ExecuteHamB(Ham_RemovePlayerItem, id, iWeapon) )
  652. {
  653. user_has_weapon(id, iCswId, 0)
  654. ExecuteHamB(Ham_Item_Kill, iWeapon)
  655. return 1
  656. }
  657. }
  658.  
  659. return 0
  660. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement