hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2024.05.19. 23:08



Jelenlévő felhasználók

Jelenleg 62 felhasználó van jelen :: 0 regisztrált, 1 rejtett és 61 vendég

A legtöbb felhasználó (1565 fő) 2020.11.21. 11:26-kor tartózkodott itt.

Regisztrált felhasználók: nincs regisztrált felhasználó az elmúlt 5 percben aktív felhasználók alapján

Utoljára aktív
Ahhoz hogy lásd ki volt utoljára aktív, be kell jelentkezned.



Az oldal teljeskörű
használatához regisztrálj.

Regisztráció

Kereső


Új téma nyitása  Hozzászólás a témához  [ 1 hozzászólás ] 
Szerző Üzenet
 Hozzászólás témája: Új fegyver CSDM-hez
HozzászólásElküldve: 2012.10.15. 19:15 
Offline
Őskövület
Avatar

Csatlakozott: 2011.09.26. 20:33
Hozzászólások: 2105
Megköszönt másnak: 28 alkalommal
Megköszönték neki: 33 alkalommal
Csövi, hogy meg legyen a havi kérdésem :D:
Hogyan tudok zp-s fegyót ami átvan alakítva publicra betenni a cs dm alap fegyver választó menüjébe? Tegyük fel, a fegyvert a /mg3 parancsra kapnám, akkor? Nagyon fontos, előre is köszi :D

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


konfig:
Kód:
;A teljes Forditást készitette Expert_IMI
;azok a sorok amik ; kezdödnek azok csak megjegyzések

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Kell futtatnia a Fő plugin ebben a részben
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[settings]

;Beállítja, hogy CSDM engedélyezve van-e vagy sem alapbol ("0"-nem , "1" igen)
enabled = 1

;Lehessen e választani menüböl megjelnéskor vagy nem ("0"-nem , "1" igen)
; (0-Csak kés lessz)
strip_weapons = 1

;Beállítja, hogy mennyi ideig maradjanak a fegyverek a földön, miután leesett
;másodpercben értendö értéket adj meg
;"0" azonnal eltünik, "-1" végtelen (megjegyezném ehez hogy ajánlott 0 án hagyni mert nagy lagot okozhat a szerveren,egy idő után szerver leállást)
weapons_stay = 0

;Beállítja a véletlen megjelenést
; "none" - a játékosok csak az alap megjelenéseken jelennek meg minden mapon
; "preset" - - csdm_spawn_preset.amxx szükséges, minden mapon ameikhez van spawn pontok,azokon fog mejelenni a játékos
spawnmode = preset

;bomba eltávolitása,igy nem lehet lerakni a bombát majd ("0"-lessz bomba , "1" nem lessz bomba
remove_bomb = 1

;Beállítja hogy mennyit keljen várni az uj megjenésig(másopercben)
spawn_wait_time = 0.75


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Kell futtatnia a Misc plugin ebben a részben
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[misc]
;Eltávolitja a vásárlás pontokat,és a cél pontokat a radaron mint pl a tuszokat
; a - as_ maps
; b - vásárlás se legyen
; c - cs_ maps
; d - de_ maps
remove_objectives = acd

;Vásárlás tiltása minden mapon  1-igen , 0 nem
block_buy = 0

;Automatikus utántölti a fegyvert miután kifogyott 1-igen , 0 nem
ammo_refill = 1

;Legyen e rádió parancs ujraéledésnél 1-igen , 0-nem
spawn_radio_msg = 0


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Kell futtatnia a védelmet plugin ebben a részben
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[protection]

;Is spawn protection engedélyezése? 1-igen 0-nem
enabled = 1

;Színei szin és ragyogás megjenéskor
;A számjegyek R, G, B, A, ahol A az alfa átláthatóság
;(Ha az "A" magasabb, a ragyogás vastagabb lessz)
colors = "0 255 0 200"

;Hány másodpercig legyen valaki védett megjelenéskor
time = 2


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Futtatni kell az equip plugint
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[equip]

;Menüben megtatlálhatoak:
; p - elsődleges fegyverek
; s - Másodlagos fegyverek
; a - páncél
; g - gránát
; b - vásárlás
menus = psa

;Automatikusan add fegyver mellé:
; a - páncél
; h - sisak
; g - gránátok
; d - defusekit (CT-nek csak!)
; n - éjjellátó
autoitems = ah

;gránátok:
; f - flashbang
; h - he grenade
; s - smoke grenade
grenades = h

;Beállítja mennyi flash-gránátod adjon
; gránátot engedélyezni kell hozzá
fnadesnum = 1


;;;;;;;;;;;;;;;;
;;WEAPON MENUS;;
;;;;;;;;;;;;;;;;

;Fegyver menüben ezek lesznek megtaláhatóak:
;Ha valameik fegyvert ki szeretnéd venni a menüből akkor a fegyver neve utáni "1" -est rakd "0"-ra

[secondary]
usp USP 1
glock18 Glock 1
deagle Deagle 1
p228 P228 1
elite Elite 1
fiveseven "Five Seven" 1

[primary]
m4a1 M4A1 1
ak47 AK47 1
aug AUG 1
sg552 SG552 1
galil Galil 1
famas Famas 1
scout Scout 1
awp AWP 1
sg550 SG550 1
m249 M249 1
g3sg1 G3SG1 1
ump45 "UMP 45" 1
mp5navy "MP5 Navy" 1
m3 M3 1
xm1014 XM1014 1
tmp TMP 1
mac10 "Mac 10" 1
p90 P90 1

;Botoknak mien fegyverük lehet(csak akkor müködik ha vannak bent botok)

[botsecondary]
deagle
usp

[botprimary]
ak47
m4a1
awp
galil
aug


Hozzászólás jelentése
Vissza a tetejére
   
Hozzászólások megjelenítése:  Rendezés  
Új téma nyitása  Hozzászólás a témához  [ 1 hozzászólás ] 


Ki van itt

Jelenlévő fórumozók: nincs regisztrált felhasználó valamint 10 vendég


Nyithatsz új témákat ebben a fórumban.
Válaszolhatsz egy témára ebben a fórumban.
Nem szerkesztheted a hozzászólásaidat ebben a fórumban.
Nem törölheted a hozzászólásaidat ebben a fórumban.
Nem küldhetsz csatolmányokat ebben a fórumban.

Keresés:
Ugrás:  
Powered by phpBB® Forum Software © phpBB Limited
Magyar fordítás © Magyar phpBB Közösség
Portal: Kiss Portal Extension © Michael O'Toole