hlmod.hu
https://hlmod.hu/

Ez most mi?
https://hlmod.hu/viewtopic.php?f=24&t=22583
Oldal: 1 / 1

Szerző:  voga955 [2015.11.04. 16:38 ]
Hozzászólás témája:  Ez most mi?

Le akarom fordítani amxx-re a .sma-t de nem engedi ezt írja ki:

csdm_equip.sma(19) : fatal error 100: cannot read from file: "csdm"

Itt van a sma:
SMA Forráskód: [ Mindet kijelol ]
  1. /**
  2.  * csdm_equip.sma
  3.  * Allows for Counter-Strike to be played as DeathMatch.
  4.  *
  5.  * CSDM Equipment Menu
  6.  *
  7.  * By Freecode and BAILOPAN
  8.  * (C)2003-2006 David "BAILOPAN" Anderson
  9.  *
  10.  * Give credit where due.
  11.  * Share the source - it sets you free
  12.  */
  13.  
  14. #include <amxmodx>
  15. #include <amxmisc>
  16. #include <cstrike>
  17. #include <csdm>
  18. #include <fakemeta>
  19.  
  20. //Tampering with the author and name lines can violate the copyright
  21. new PLUGINNAME[] = "CSDM Equip"
  22. new VERSION[] = CSDM_VERSION
  23. new AUTHORS[] = "CSDM Team"
  24.  
  25. #define EQUIP_PRI (1<<0)
  26. #define EQUIP_SEC (1<<1)
  27. #define EQUIP_ARMOR (1<<2)
  28. #define EQUIP_GREN (1<<3)
  29. #define EQUIP_ITEMS (1<<4)
  30. #define EQUIP_ALL (EQUIP_PRI|EQUIP_SEC|EQUIP_ARMOR|EQUIP_GREN|EQUIP_ITEMS)
  31.  
  32. //Menus
  33. new g_SecMenu[] = "CSDM: Másodlagos fegyverek" // Menu Name
  34. new g_SecMenuID = -1 // Menu ID
  35. new g_cSecondary // Menu Callback
  36. new bool:g_mSecStatus = true // Menu Available?
  37.  
  38. new g_PrimMenu[] = "CSDM: Elsődleges fegyverek"
  39. new g_PrimMenuID = -1
  40. new g_cPrimary
  41. new bool:g_mPrimStatus = true
  42.  
  43. new g_ArmorMenu[] = "CSDM: Pajzs"
  44. new g_ArmorMenuID = -1
  45. new bool:g_mArmorStatus = true
  46.  
  47. new g_NadeMenu[] = "CSDM: Gránátok"
  48. new g_NadeMenuID = -1
  49. new bool:g_mNadeStatus = true
  50.  
  51. new g_EquipMenu[] = "CSDM: Felszerelés"
  52. new g_EquipMenuID = -1
  53.  
  54. new bool:g_mShowuser[33] = true
  55.  
  56. new bool:g_mAutoNades = false
  57. new bool:g_mAutoArmor = false
  58.  
  59. //Weapon Selections
  60. new g_SecWeapons[33][18]
  61. new g_PrimWeapons[33][18]
  62. new bool:g_mNades[33]
  63. new bool:g_mArmor[33]
  64.  
  65. //Config weapon storage holders
  66. new g_BotPrim[MAX_WEAPONS][18]
  67. new g_iNumBotPrim
  68.  
  69. new g_BotSec[MAX_WEAPONS][18]
  70. new g_iNumBotSec
  71.  
  72. new g_Secondary[MAX_SECONDARY][18]
  73. new bool:g_DisabledSec[MAX_WEAPONS]
  74. new g_iNumSec
  75.  
  76. new g_Primary[MAX_PRIMARY][18]
  77. new bool:g_DisabledPrim[MAX_WEAPONS]
  78. new g_iNumPrim
  79.  
  80. #define SILENCED_M4A1 0
  81. #define SILENCED_USP 1
  82. new bool:g_Silenced[33][2]
  83.  
  84. //Misc
  85. new g_Armor = 0
  86. new fnadesnum = 0
  87. new bool:g_Flash = false
  88. new bool:g_Nade = false
  89. new bool:g_Smoke = false
  90. new bool:g_NightVision = false
  91. new bool:g_DefuseKit = false
  92.  
  93. //Quick Fix for menu pages
  94. new g_MenuState[33] = {0}
  95.  
  96. public csdm_Init(const version[])
  97. {
  98. if (version[0] == 0)
  99. {
  100. set_fail_state("CSDM failed to load.")
  101. return
  102. }
  103.  
  104. // Menus and callbacks
  105. g_SecMenuID = menu_create(g_SecMenu, "m_SecHandler", 0)
  106. g_PrimMenuID = menu_create(g_PrimMenu, "m_PrimHandler", 0)
  107. g_ArmorMenuID = menu_create(g_ArmorMenu, "m_ArmorHandler", 0)
  108. g_NadeMenuID = menu_create(g_NadeMenu, "m_NadeHandler", 0)
  109. g_EquipMenuID = menu_create(g_EquipMenu, "m_EquipHandler", 0)
  110.  
  111. menu_setprop(g_PrimMenuID, MPROP_EXIT, MEXIT_NEVER)
  112. menu_setprop(g_SecMenuID, MPROP_EXIT, MEXIT_NEVER)
  113.  
  114. g_cSecondary = menu_makecallback("c_Secondary")
  115. g_cPrimary = menu_makecallback("c_Primary")
  116. }
  117.  
  118. public csdm_CfgInit()
  119. {
  120. // Config reader
  121. csdm_reg_cfg("equip", "cfgSetting")
  122. // In order for weapon menu
  123. csdm_reg_cfg("secondary", "cfgSecondary")
  124. csdm_reg_cfg("primary", "cfgPrimary")
  125. csdm_reg_cfg("botprimary", "cfgBotPrim")
  126. csdm_reg_cfg("botsecondary", "cfgBotSec")
  127. }
  128.  
  129. public plugin_init()
  130. {
  131. register_plugin(PLUGINNAME, VERSION, AUTHORS)
  132.  
  133. // Build Armor/Nade/Equip Menu's
  134. buildMenu()
  135.  
  136. register_clcmd("say guns", "enableMenu")
  137. register_clcmd("say /guns", "enableMenu")
  138. register_clcmd("say menu", "enableMenu")
  139. register_clcmd("say enablemenu", "enableMenu")
  140. register_clcmd("say enable_menu", "enableMenu")
  141. }
  142.  
  143. public client_connect(id)
  144. {
  145. g_mShowuser[id] = true
  146. g_mNades[id] = false
  147. g_mArmor[id] = false
  148. g_Silenced[id][SILENCED_M4A1] = false
  149. g_Silenced[id][SILENCED_USP] = false
  150.  
  151. return PLUGIN_CONTINUE
  152. }
  153.  
  154. public client_disconnect(id)
  155. {
  156. g_mShowuser[id] = true
  157. g_mNades[id] = false
  158. g_mArmor[id] = false
  159.  
  160. return PLUGIN_CONTINUE
  161. }
  162.  
  163. public csdm_RemoveWeapon(owner, entity_id, boxed_id)
  164. {
  165. new classname[32], weapon
  166. pev(entity_id, pev_classname, classname, 31)
  167. weapon = get_weaponid(classname)
  168. if (weapon == CSW_M4A1)
  169. {
  170. g_Silenced[owner][SILENCED_M4A1] = cs_get_weapon_silen(entity_id) ? true : false
  171. } else if (weapon == CSW_USP) {
  172. g_Silenced[owner][SILENCED_USP] = cs_get_weapon_silen(entity_id) ? true : false
  173. }
  174.  
  175. return PLUGIN_CONTINUE
  176. }
  177.  
  178. public csdm_PostDeath(killer, victim, headshot, const weapon[])
  179. {
  180. /* Clean up any defusal kits we might have made! */
  181. if (!g_DefuseKit)
  182. {
  183. return
  184. }
  185.  
  186. /* This might have a race condition for team switches... */
  187. if (cs_get_user_team(victim) == CS_TEAM_CT)
  188. {
  189. cs_set_user_defuse(victim, 0)
  190. }
  191. }
  192.  
  193. public cfgSecondary(readAction, line[], section[])
  194. {
  195. if (readAction == CFG_READ)
  196. {
  197. if (g_iNumSec >= MAX_SECONDARY)
  198. return PLUGIN_HANDLED
  199.  
  200. new wep[16], display[48], dis[4]
  201. new cmd[6]
  202.  
  203. parse(line, wep, 15, display, 47, dis, 3)
  204.  
  205. new disabled = str_to_num(dis)
  206.  
  207. //Copy weapon into array
  208. format(g_Secondary[g_iNumSec], 17, "weapon_%s", wep)
  209.  
  210. g_DisabledSec[g_iNumSec] = disabled ? false : true
  211.  
  212. format(cmd,5,"%d ",g_iNumSec)
  213. g_iNumSec++
  214.  
  215. //TODO: Add menu_destroy_items to remake menu on cfg reload
  216. menu_additem(g_SecMenuID, display, cmd, 0, g_cSecondary)
  217. }
  218. else if (readAction == CFG_RELOAD)
  219. {
  220. g_SecMenuID = menu_create(g_SecMenu, "m_SecHandler", 0)
  221. g_iNumSec = 0
  222. }
  223. else if (readAction == CFG_DONE)
  224. {
  225. //Nothing for now
  226. return PLUGIN_HANDLED
  227. }
  228.  
  229. return PLUGIN_HANDLED
  230. }
  231.  
  232. public cfgPrimary(readAction, line[], section[])
  233. {
  234. if (readAction == CFG_READ)
  235. {
  236. if (g_iNumPrim >= MAX_PRIMARY)
  237. return PLUGIN_HANDLED
  238.  
  239. new wep[16], display[48], dis[4]
  240. new cmd[6]
  241.  
  242. parse(line, wep, 15, display, 47, dis, 3)
  243.  
  244. new disabled = str_to_num(dis)
  245.  
  246. //Copy weapon into array
  247. format(g_Primary[g_iNumPrim], 17, "weapon_%s", wep)
  248. g_DisabledPrim[g_iNumPrim] = disabled ? false : true
  249.  
  250. format(cmd, 5, "%d", g_iNumPrim)
  251. g_iNumPrim++
  252.  
  253. //TODO: Add menu_destroy_items to remake menu on cfg reload
  254. menu_additem(g_PrimMenuID, display, cmd, 0, g_cPrimary)
  255. } else if (readAction == CFG_RELOAD) {
  256. g_PrimMenuID = menu_create(g_PrimMenu, "m_PrimHandler", 0)
  257. g_iNumPrim = 0
  258. } else if (readAction == CFG_DONE) {
  259. //Nothing for now
  260. return PLUGIN_HANDLED
  261. }
  262.  
  263. return PLUGIN_HANDLED
  264. }
  265.  
  266.  
  267. public cfgBotPrim(readAction, line[], section[])
  268. {
  269. if (readAction == CFG_READ)
  270. {
  271.  
  272. new wep[16], display[32]
  273.  
  274. parse(line, wep, 15, display, 31)
  275.  
  276. //Copy weapon into array
  277. format(g_BotPrim[g_iNumBotPrim], 17, "weapon_%s", wep)
  278. g_iNumBotPrim++
  279. } else if (readAction == CFG_RELOAD) {
  280. g_iNumBotPrim = 0
  281. } else if (readAction == CFG_DONE) {
  282. //Nothing for now
  283. return PLUGIN_HANDLED
  284. }
  285.  
  286. return PLUGIN_HANDLED
  287. }
  288.  
  289. public cfgBotSec(readAction, line[], section[])
  290. {
  291. if (readAction == CFG_READ)
  292. {
  293.  
  294. new wep[16], display[32]
  295.  
  296. parse(line, wep, 15, display, 31)
  297.  
  298. //Copy weapon into array
  299. format(g_BotSec[g_iNumBotSec], 17, "weapon_%s", wep)
  300. g_iNumBotSec++
  301. } else if (readAction == CFG_RELOAD) {
  302. g_iNumBotSec = 0
  303. } else if (readAction == CFG_DONE) {
  304. //Nothing for now
  305. return PLUGIN_HANDLED
  306. }
  307.  
  308. return PLUGIN_HANDLED
  309. }
  310.  
  311. public cfgSetting(readAction, line[], section[])
  312. {
  313. if (readAction == CFG_READ)
  314. {
  315.  
  316. new setting[16], sign[3], value[6]
  317.  
  318. parse(line, setting, 15, sign, 2, value, 5)
  319.  
  320. // Menus settings
  321. if (contain(setting,"menus") != -1)
  322. {
  323. if (containi(value, "p") != -1)
  324. {
  325. g_mPrimStatus = true
  326. }
  327.  
  328. if (containi(value, "s") != -1)
  329. {
  330. g_mSecStatus = true
  331. }
  332.  
  333. if (containi(value, "a") != -1)
  334. {
  335. g_mArmorStatus = true
  336. }
  337.  
  338. if (containi(value, "g") != -1)
  339. {
  340. g_mNadeStatus = true
  341. }
  342.  
  343. return PLUGIN_HANDLED
  344. } else if (contain(setting, "autoitems") != -1) {
  345.  
  346. if (containi(value, "a") != -1)
  347. {
  348. //Disable Armor Menu
  349. g_mArmorStatus = false
  350. g_mAutoArmor = true
  351.  
  352. g_Armor = 1
  353. }
  354.  
  355. if (containi(value, "h") != -1)
  356. {
  357. //Disable Armor Menu
  358. g_mArmorStatus = false
  359. g_mAutoArmor = true
  360. g_Armor = 2
  361. }
  362.  
  363. if (containi(value, "g") != -1)
  364. {
  365. //Disable Grenade Menu
  366. g_mNadeStatus = false
  367. g_mAutoNades = true
  368. }
  369.  
  370. if (containi(value, "d") != -1)
  371. {
  372. g_DefuseKit = true
  373. }
  374.  
  375. if (containi(value, "n") != -1)
  376. {
  377. g_NightVision = true
  378. }
  379.  
  380. return PLUGIN_HANDLED
  381. } else if (contain(setting, "grenades") != -1) {
  382. if (containi(value, "f") != -1)
  383. {
  384. g_Flash = true
  385. }
  386.  
  387. if (containi(value, "h") != -1)
  388. {
  389. g_Nade = true
  390. }
  391.  
  392. if (containi(value, "s") != -1)
  393. {
  394. g_Smoke = true
  395. }
  396. } else if (contain(setting, "fnadesnum") != -1) {
  397. fnadesnum = str_to_num(value)
  398. }
  399.  
  400. return PLUGIN_HANDLED
  401. } else if (readAction == CFG_RELOAD) {
  402. g_mArmorStatus = false
  403. g_mNadeStatus = false
  404. g_Flash = false
  405. g_Nade = false
  406. g_Smoke = false
  407. g_Armor = 0
  408. g_mSecStatus = false
  409. g_mPrimStatus = false
  410. g_mAutoNades = false
  411. g_DefuseKit = false
  412. g_NightVision = false
  413. fnadesnum = 1
  414. } else if (readAction == CFG_DONE) {
  415. //Nothing for now
  416. return PLUGIN_HANDLED
  417. }
  418.  
  419. return PLUGIN_HANDLED
  420. }
  421.  
  422. //Secondary Weapon Callback
  423. public c_Secondary(id, menu, item)
  424. {
  425.  
  426. if( item < 0 ) return PLUGIN_CONTINUE
  427.  
  428. new cmd[6], iName[64]
  429. new access, callback
  430.  
  431. menu_item_getinfo(menu, item, access, cmd,5, iName, 63, callback)
  432.  
  433. new dis = str_to_num(cmd)
  434.  
  435. //Check to see if item is disabled
  436. if (g_DisabledSec[dis])
  437. {
  438. return ITEM_DISABLED
  439. }
  440. else
  441. {
  442. return ITEM_ENABLED
  443. }
  444.  
  445. return PLUGIN_HANDLED
  446. }
  447.  
  448. //Primary Weapon Callback
  449. public c_Primary(id, menu, item)
  450. {
  451.  
  452. if (item < 0)
  453. return PLUGIN_CONTINUE
  454.  
  455. // Get item info
  456. new cmd[6], iName[64]
  457. new access, callback
  458.  
  459. menu_item_getinfo(menu, item, access, cmd,5, iName, 63, callback)
  460.  
  461. new dis = str_to_num(cmd)
  462.  
  463. //Check to see if item is disabled
  464. if (g_DisabledPrim[dis])
  465. {
  466. return ITEM_DISABLED
  467. }
  468. else
  469. {
  470. return ITEM_ENABLED
  471. }
  472.  
  473. return PLUGIN_HANDLED
  474. }
  475.  
  476. //Equipment Menu handler
  477. public m_EquipHandler(id, menu, item)
  478. {
  479. if (item < 0)
  480. {
  481. return PLUGIN_CONTINUE
  482. }
  483.  
  484. // Get item info
  485. new cmd[2], iName[64]
  486. new access, callback
  487.  
  488. menu_item_getinfo(menu, item, access, cmd, 1, iName, 63, callback)
  489.  
  490. new choice = str_to_num(cmd)
  491.  
  492. switch(choice)
  493. {
  494. case 1:
  495. {
  496. if (g_mSecStatus)
  497. {
  498. menu_display(id, g_SecMenuID, 0)
  499. }
  500. else if (g_mPrimStatus)
  501. {
  502. menu_display(id, g_PrimMenuID, 0)
  503. }
  504. else if (g_mArmorStatus)
  505. {
  506. menu_display(id, g_ArmorMenuID, 0)
  507. }
  508. else if (g_mNadeStatus)
  509. {
  510. if (g_mAutoArmor)
  511. {
  512. equipUser(id, EQUIP_ARMOR)
  513. }
  514. menu_display(id, g_NadeMenuID, 0)
  515. } else {
  516. if (g_mAutoArmor)
  517. {
  518. equipUser(id, EQUIP_ARMOR)
  519. }
  520. if (g_mAutoNades)
  521. {
  522. equipUser(id, EQUIP_GREN)
  523. }
  524. equipUser(id, EQUIP_ITEMS)
  525. }
  526. }
  527. case 2:
  528. {
  529. // Equip person with last settings
  530. equipUser(id, EQUIP_ALL)
  531. }
  532. case 3:
  533. {
  534. g_mShowuser[id] = false
  535. client_print(id, print_chat, "[CSDM] Írj ^"guns^" , hogy megnyisd a fegyvermenüt.")
  536. equipUser(id, EQUIP_ALL)
  537. }
  538. }
  539.  
  540. return PLUGIN_HANDLED
  541. }
  542.  
  543. //Secondary Wep Menu handler
  544. public m_SecHandler(id, menu, item)
  545. {
  546. // Get item info
  547. new cmd[6], iName[64]
  548. new access, callback
  549.  
  550. menu_item_getinfo(menu, item, access, cmd,5, iName, 63, callback)
  551.  
  552. new wep = str_to_num(cmd)
  553.  
  554. copy(g_SecWeapons[id],17,g_Secondary[wep])
  555. equipUser(id, EQUIP_SEC)
  556.  
  557. // Show next menu here
  558.  
  559. if (g_mPrimStatus)
  560. {
  561. menu_display(id, g_PrimMenuID, 0)
  562. }
  563. else if (g_mArmorStatus)
  564. {
  565. menu_display(id, g_ArmorMenuID, 0)
  566. }
  567. else if (g_mNadeStatus)
  568. {
  569. if (g_mAutoArmor)
  570. {
  571. equipUser(id, EQUIP_ARMOR)
  572. }
  573. menu_display(id, g_NadeMenuID, 0)
  574. }
  575. else
  576. {
  577. if (g_mAutoArmor)
  578. {
  579. equipUser(id, EQUIP_ARMOR)
  580. }
  581. if (g_mAutoNades)
  582. {
  583. equipUser(id, EQUIP_GREN)
  584. }
  585. equipUser(id, EQUIP_ITEMS)
  586. }
  587.  
  588. return PLUGIN_HANDLED
  589. }
  590.  
  591. //Primary Wep Menu handler
  592. public m_PrimHandler(id, menu, item)
  593. {
  594. if (item < 0) return PLUGIN_HANDLED
  595.  
  596. // Get item info
  597. new cmd[6], iName[64]
  598. new access, callback
  599.  
  600. if (menu_item_getinfo(menu, item, access, cmd,5, iName, 63, callback))
  601. {
  602. new wep = str_to_num(cmd)
  603.  
  604. copy(g_PrimWeapons[id], 17, g_Primary[wep])
  605. equipUser(id, EQUIP_PRI)
  606. }
  607.  
  608. // Show next menu here
  609.  
  610. if (g_mArmorStatus)
  611. {
  612. menu_display(id, g_ArmorMenuID, 0)
  613. }
  614. else if (g_mNadeStatus)
  615. {
  616. if (g_mAutoArmor)
  617. {
  618. equipUser(id, EQUIP_ARMOR)
  619. }
  620. menu_display(id, g_NadeMenuID, 0)
  621. } else {
  622. if (g_mAutoArmor)
  623. {
  624. equipUser(id, EQUIP_ARMOR)
  625. }
  626. if (g_mAutoNades)
  627. {
  628. equipUser(id, EQUIP_GREN)
  629. }
  630. equipUser(id, EQUIP_ITEMS)
  631. }
  632.  
  633. return PLUGIN_HANDLED
  634. }
  635.  
  636. //Armor Menu handler
  637. public m_ArmorHandler(id, menu, item)
  638. {
  639. if (item < 0) return PLUGIN_CONTINUE
  640.  
  641. // Get item info
  642. new cmd[6], iName[64]
  643. new access, callback
  644.  
  645. menu_item_getinfo(menu, item, access, cmd,5, iName, 63, callback)
  646.  
  647. new choice = str_to_num(cmd)
  648.  
  649. if (choice == 1)
  650. {
  651. g_mArmor[id] = true
  652. }
  653. else if (choice == 2)
  654. {
  655. g_mArmor[id] = false
  656. }
  657. equipUser(id, EQUIP_ARMOR)
  658.  
  659. // Show next menu here
  660.  
  661. if (g_mNadeStatus)
  662. {
  663. menu_display(id, g_NadeMenuID, 0)
  664. } else {
  665. if (g_mAutoNades)
  666. {
  667. equipUser(id, EQUIP_GREN)
  668. }
  669. equipUser(id, EQUIP_ITEMS)
  670. }
  671.  
  672. return PLUGIN_HANDLED
  673. }
  674.  
  675. //Nade Menu handler
  676. public m_NadeHandler(id, menu, item)
  677. {
  678. if (item < 0) return PLUGIN_CONTINUE
  679.  
  680. new cmd[6], iName[64]
  681. new access, callback
  682.  
  683. menu_item_getinfo(menu, item, access, cmd, 5, iName, 63, callback)
  684.  
  685. new choice = str_to_num(cmd)
  686.  
  687. if (choice == 1)
  688. {
  689. g_mNades[id] = true
  690. }
  691. else if (choice == 2)
  692. {
  693. g_mNades[id] = false
  694. }
  695.  
  696. equipUser(id, EQUIP_GREN)
  697. equipUser(id, EQUIP_ITEMS)
  698.  
  699. return PLUGIN_HANDLED
  700. }
  701.  
  702. buildMenu()
  703. {
  704. //Equip Menu
  705. menu_additem(g_EquipMenuID, "Új fegyverek", "1", 0, -1)
  706. menu_additem(g_EquipMenuID, "Előző fegyverek", "2", 0, -1)
  707. menu_additem(g_EquipMenuID, "Ne mutassa újra a menüt", "3", 0, -1)
  708. menu_setprop(g_EquipMenuID, MPROP_EXIT, MEXIT_NEVER)
  709.  
  710. //Armor Menu
  711. menu_additem(g_ArmorMenuID, "Igen, kell pajzs", "1", 0, -1)
  712. menu_additem(g_ArmorMenuID, "Nem kell pajzs", "2", 0, -1)
  713. menu_setprop(g_ArmorMenuID, MPROP_EXIT, MEXIT_NEVER)
  714.  
  715. //Nade Menu
  716. menu_additem(g_NadeMenuID, "Összes Gránát", "1", 0, -1)
  717. menu_additem(g_NadeMenuID, "Nem kell gránát", "2", 0, -1)
  718. menu_setprop(g_NadeMenuID, MPROP_EXIT, MEXIT_NEVER)
  719.  
  720. return PLUGIN_HANDLED
  721. }
  722.  
  723. equipUser(id, to)
  724. {
  725. if (!is_user_alive(id) )
  726. return
  727.  
  728. if (to & EQUIP_SEC)
  729. {
  730. //Give Secondary
  731. GiveUserFullWeapon(id, g_SecWeapons[id])
  732. }
  733.  
  734. if (to & EQUIP_PRI)
  735. {
  736. //Give Primary
  737. GiveUserFullWeapon(id, g_PrimWeapons[id])
  738. }
  739.  
  740. if (to & EQUIP_ARMOR)
  741. {
  742. //Give Armor
  743. if (g_mAutoArmor || g_mArmor[id])
  744. {
  745. new armor = g_mArmor[id] ? 2 : g_Armor
  746. cs_set_user_armor(id, DEFAULT_ARMOR, CsArmorType:armor)
  747. }
  748. }
  749.  
  750. if (to & EQUIP_GREN)
  751. {
  752. //Give Nades
  753. if (g_mNades[id] || g_mAutoNades)
  754. {
  755.  
  756. if (g_Nade)
  757. {
  758. GiveUserFullWeapon(id,"weapon_hegrenade")
  759. }
  760.  
  761. if (g_Smoke)
  762. {
  763. GiveUserFullWeapon(id, "weapon_smokegrenade")
  764. }
  765.  
  766. if (g_Flash && fnadesnum)
  767. {
  768. GiveUserFullWeapon(id, "weapon_flashbang")
  769. if (fnadesnum == 2)
  770. {
  771. GiveUserFullWeapon(id, "weapon_flashbang")
  772. }
  773. }
  774.  
  775. }
  776. }
  777.  
  778. if (to & EQUIP_ITEMS)
  779. {
  780. if (g_DefuseKit && (cs_get_user_team(id) == CS_TEAM_CT))
  781. {
  782. cs_set_user_defuse(id, 1)
  783. }
  784. if (g_NightVision)
  785. {
  786. cs_set_user_nvg(id, 1)
  787. }
  788. }
  789. }
  790.  
  791. GiveUserFullWeapon(id, const wp[])
  792. {
  793. /** First check to make sure the user does not have a weapon in this slot */
  794. new wpnid = get_weaponid(wp)
  795. new weapons[MAX_WEAPONS], num
  796. new name[24], weap
  797. new slot
  798. if (wpnid == 0)
  799. {
  800. if (equal(wp, "weapon_shield"))
  801. {
  802. slot = SLOT_PRIMARY
  803. wpnid = -1
  804. }
  805. } else {
  806. slot = g_WeaponSlots[wpnid]
  807. }
  808. if ((slot == SLOT_SECONDARY || slot == SLOT_PRIMARY)
  809. && wpnid > 0)
  810. {
  811. get_user_weapons(id, weapons, num)
  812. for (new i=0; i<num; i++)
  813. {
  814. weap = weapons[i]
  815. if (weap == wpnid)
  816. {
  817. continue
  818. }
  819. if (g_WeaponSlots[weap] == slot)
  820. {
  821. if (slot == SLOT_SECONDARY && cs_get_user_shield(id))
  822. {
  823. //temporary fix!
  824. drop_with_shield(id, weap)
  825. } else {
  826. get_weaponname(weap, name, 23)
  827. csdm_force_drop(id, name)
  828. }
  829. }
  830. }
  831. } else if (slot == SLOT_PRIMARY && wpnid == -1 && cs_get_user_shield(id)) {
  832. return
  833. }
  834.  
  835. if (slot == SLOT_PRIMARY && cs_get_user_shield(id) && wpnid > 0)
  836. {
  837. csdm_fwd_drop(id, -1, "weapon_shield")
  838. }
  839.  
  840. new item_id = csdm_give_item(id, wp)
  841. if (item_id > 0)
  842. {
  843. if (wpnid == CSW_M4A1)
  844. {
  845. cs_set_weapon_silen(item_id, g_Silenced[id][SILENCED_M4A1], 1)
  846. } else if (wpnid == CSW_USP) {
  847. cs_set_weapon_silen(item_id, g_Silenced[id][SILENCED_USP], 1)
  848. }
  849. }
  850.  
  851. if (wpnid > 0)
  852. {
  853. new bpammo = g_MaxBPAmmo[wpnid]
  854. if (bpammo)
  855. {
  856. cs_set_user_bpammo(id, wpnid, bpammo)
  857. }
  858. }
  859. }
  860.  
  861. // MAIN FUNCTION OF THE PLUGIN
  862. public csdm_PostSpawn(player)
  863. {
  864. if (is_user_bot(player))
  865. {
  866. new randPrim = random_num(0, g_iNumBotPrim-1)
  867. new randSec = random_num(0, g_iNumBotSec-1)
  868.  
  869. // By our lMOSTeast favorite guy KWo RIP - 02.11.2005.
  870. new randArm = random_num(0, 2)
  871. new randGre = random_num(0, 2)
  872.  
  873. GiveUserFullWeapon(player, g_BotPrim[randPrim])
  874. GiveUserFullWeapon(player, g_BotSec[randSec])
  875.  
  876. g_mArmor[player] = (g_mArmorStatus && randArm)
  877. g_mNades[player] = (g_mNadeStatus && randGre)
  878.  
  879. if (g_mAutoArmor || g_mArmor[player])
  880. {
  881. equipUser(player, EQUIP_ARMOR)
  882. }
  883.  
  884. if (g_mAutoNades || g_mNades[player])
  885. {
  886. equipUser(player, EQUIP_GREN)
  887. }
  888. if (g_DefuseKit)
  889. {
  890. equipUser(player, EQUIP_ITEMS)
  891. }
  892. } else {
  893. if (g_mShowuser[player])
  894. {
  895. g_MenuState[player] = 1
  896. menu_display(player, g_EquipMenuID, 0)
  897. } else {
  898. g_MenuState[player] = 0
  899. equipUser(player, EQUIP_ALL)
  900. }
  901. }
  902.  
  903. return PLUGIN_CONTINUE
  904. }
  905.  
  906. public enableMenu(id)
  907. {
  908. if (!csdm_active())
  909. return PLUGIN_CONTINUE
  910.  
  911. if (!g_mShowuser[id])
  912. {
  913. g_mShowuser[id] = true
  914. client_print(id, print_chat, "[CSDM] Funkció már engedélyezve van.")
  915. if (!g_MenuState[id])
  916. {
  917. g_MenuState[id] = 1
  918. menu_display(id, g_EquipMenuID, 0)
  919. }
  920. } else {
  921. client_print(id, print_chat, "[CSDM] Neked már engedélyezve van a menü.")
  922. }
  923.  
  924. return PLUGIN_HANDLED
  925. }

Szerző:  mforce [2015.11.04. 17:03 ]
Hozzászólás témája:  Re: Ez most mi?

Ez egy rossz témanyitás, kuka.
am include csdm hiányzik

Oldal: 1 / 1 Minden időpont UTC+02:00 időzóna szerinti
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/