hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2024.03.29. 06:29



Jelenlévő felhasználók

Jelenleg 286 felhasználó van jelen :: 0 regisztrált, 0 rejtett és 286 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  [ 3 hozzászólás ] 
Szerző Üzenet
 Hozzászólás témája: Fegyver vásárlás letiltás
HozzászólásElküldve: 2013.08.06. 18:17 
Offline
Őskövület
Avatar

Csatlakozott: 2011.12.28. 00:35
Hozzászólások: 2736
Megköszönt másnak: 56 alkalommal
Megköszönték neki: 275 alkalommal
Hali!

Melyik az a plugin ami bizonyos pályákon letiltja a fegyver vásárlást, de nem teljesen.

PL:
Van egy awp, fy, aim, pálya. És , hogy azon a pályán ne lehessen m4a1 stb....

Előre is köszi.

_________________
****


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Fegyver vásárlás letiltás
HozzászólásElküldve: 2013.08.06. 23:22 
Offline
Felfüggesztve
Avatar

Csatlakozott: 2013.06.09. 18:47
Hozzászólások: 2004
Megköszönt másnak: 1 alkalommal
Megköszönték neki: 220 alkalommal
pixxa112 írta:
Hali!

Melyik az a plugin ami bizonyos pályákon letiltja a fegyver vásárlást, de nem teljesen.

PL:
Van egy awp, fy, aim, pálya. És , hogy azon a pályán ne lehessen m4a1 stb....

Előre is köszi.


Nem találtam olyat, amibe lett volna egy .ini fájl kiterjesztés, de viszont hozzá lehet írni.

SMA Forráskód: [ Mindet kijelol ]
  1. /**********************
  2. amx_advanced_weaprest.sma by MagicShot ...*...
  3.  
  4. Usage:
  5. amx_weaprest "weaponname" or "Weapon Group ex. submachineguns" - Refer to Readme for More Examples
  6.  
  7. Main Cvars:
  8. amx_weaponrest < - Enable/Diable Avanced Weapon Restion - Deafult Enabled
  9. amx_weaponwait < - Wait Till Next Round Before Restictions Start - Default Enabled
  10.  
  11. Voting Cvars:
  12. amx_weapvote_ratio <- Vote Ratio - Default 51%
  13. amx_wvote_delay <- Weapon Vote delay - Default 180 Seconds
  14. amx_xtra_wep_msg <- Extra Weapon Messgae- Default 0 - OFF
  15.  
  16. ***********
  17. *Change.Log
  18. ***********
  19. Version 0.33 ([MUPPETS] Gonzo)
  20. 1) found another vote-bug
  21. 2) removed hardcoded pathes - using log_amx
  22. 3) Should now be approvable <!-- s:) --><img src=\"{SMILIES_PATH}/icon_e_smile.gif\" alt=\":)\" title=\"mosoly\" /><!-- s:) -->
  23.  
  24. Version 0.32 (by [MUPPETS] Gonzo)
  25. 1) voting fixed
  26. 2) fixed amxmodx path (still hardcoded)
  27.  
  28. Version 0.31
  29. 1). Bug fixes. Should now work with CS 1.6
  30.  
  31. Updates:
  32. 1). CZ Testing Currently
  33. 2). Adding Sheild Restriction
  34. 3). Menu & Better Voting System to Come.
  35. 4). Cool Punishment (Ideas Requested)
  36.  
  37. Version 0.3
  38.  
  39. 1). Added amx_weaponwait cvar
  40. 2). Added Group Restrictions
  41. 3). Added Inital Voting System
  42. 4). Omtimized Restriction Checking
  43.  
  44. Credits: Bailopan, _KaszpiR_, & Ludwig Van
  45. **********************/
  46. #include <amxmodx>
  47. #include <amxmisc>
  48.  
  49. new const weaponname[31][] = {"pistols", "p228", "shotguns", "scout", "submachineguns", "auto", "zoomed", "mac10", "aug", "scoped", "elites", "fiveseven", "ump45", "sgsniper", "zoomscope", "rifles", "usp", "glock", "awp", "mp5", "para", "pump", "colt", "tmp", "g3sniper", "25", "deagle", "sg552", "ak47", "knife", "p90"}
  50. new const vote_weapon[31][] = {"vote_pistols", "vote_p228", "vote_shotguns", "vote_scout", "vote_submachineguns", "vote_auto", "vote_zoomed", "vote_mac10", "vote_aug", "vote_scoped", "vote_elites", "vote_fiveseven", "vote_ump45", "vote_sgsniper", "vote_zoomscope", "vote_rifles", "vote_usp", "vote_glock", "vote_awp", "vote_mp5", "vote_para", "vote_pump", "vote_colt", "vote_tmp", "vote_g3sniper", "25", "vote_deagle", "vote_sg552", "vote_ak47", "vote_knife", "vote_p90"}
  51. new pistols[31]
  52. new shotguns[31]
  53. new submachineguns[31]
  54. new zoomed[31]
  55. new scoped[31]
  56. new zoomscope[31]
  57. new rifles[31]
  58. new pistols_disabled[31]
  59. new shotguns_disabled[31]
  60. new submachineguns_disabled[31]
  61. new zoomed_disabled[31]
  62. new scoped_disabled[31]
  63. new zoomscope_disabled[31]
  64. new rifles_disabled[31]
  65. new weap_disabled[64]
  66. new weap_pend[32]
  67. new curweap
  68. new bool:first_time[32]
  69. new voteweapon[32]
  70. new votewepi
  71. new votewepi2
  72. new voteoutcome
  73. new votenumber = 0
  74. new votecontroller[33][2]
  75. new option[4]
  76. new Float:vote_ratio
  77. new totalvoters = 0
  78. new bool:bVoteToStop = false
  79. new st_vote
  80. new bool:wvote_deny = false
  81.  
  82. public checkweap(id,level,cid) {
  83. //if (!cmd_access(id,level,cid,3)) {
  84. // client_print(id,print_console,"[AMXX] Access Check")
  85. // return PLUGIN_HANDLED
  86. //}
  87. client_print(id,print_console,"[AMXX] Access Granted")
  88. new weap[32]
  89. read_argv(1,weap,31)
  90. if (equal(weap,""))
  91. return PLUGIN_CONTINUE
  92. for(new i = 0; i < 31; i++) {
  93. if (containi(weaponname[i], weap)!=-1)
  94. curweap = i
  95. if (first_time[i] == true)
  96. first_time[i] = false
  97. }
  98. if ( (weap_disabled[curweap] == 0) && (weap_pend[curweap] != 1) ){
  99. if (get_cvar_num("amx_weaponwait") == 0)
  100. weap_disabled[curweap] = 1
  101.  
  102. if (containi(weaponname[curweap], "pistols")!=-1) {
  103. weap_pend[0] = 1
  104. if (get_cvar_num("amx_weaponwait") == 1) {
  105. pistols[1] = 1; pistols[10] = 1; pistols[11] = 1; pistols[16] = 1; pistols[17] = 1; pistols[26] = 1; weap_pend[0] = 1
  106. }else {
  107. pistols[1] = 1; pistols[10] = 1; pistols[11] = 1; pistols[16] = 1; pistols[17] = 1; pistols[26] = 1
  108. pistols_disabled[1] = 1; pistols_disabled[10] = 1; pistols_disabled[11] = 1; pistols_disabled[16] = 1; pistols_disabled[17] = 1; pistols_disabled[26] = 1
  109. }
  110. }
  111. if (containi(weaponname[curweap], "shotguns")!=-1) {
  112. weap_pend[2] = 1
  113. if (get_cvar_num("amx_weaponwait") == 1) {
  114. shotguns[5] = 1; shotguns[21] = 1
  115. }else {
  116. shotguns[5] = 1; shotguns[21] = 1
  117. shotguns_disabled[5] = 1; shotguns_disabled[21] = 1
  118. }
  119. }
  120. if (containi(weaponname[curweap], "submachineguns")!=-1) {
  121. weap_pend[4] = 1
  122. if (get_cvar_num("amx_weaponwait") == 1) {
  123. submachineguns[7] = 1; submachineguns[12] = 1; submachineguns[19] = 1; submachineguns[23] = 1
  124. }else {
  125. submachineguns[7] = 1; submachineguns[12] = 1; submachineguns[19] = 1; submachineguns[23] = 1
  126. submachineguns_disabled[7] = 1; submachineguns_disabled[12] = 1; submachineguns_disabled[19] = 1; submachineguns_disabled[23] = 1
  127. }
  128. }
  129. if (containi(weaponname[curweap], "zoomed")!=-1) {
  130. weap_pend[6] = 1
  131. if (get_cvar_num("amx_weaponwait") == 1) {
  132. zoomed[8] = 1; zoomed[27] = 1
  133. }else {
  134. zoomed[8] = 1; zoomed[27] = 1
  135. zoomed_disabled[8] = 1; zoomed_disabled[27] = 1
  136. }
  137. }
  138. if (containi(weaponname[curweap], "scoped")!=-1) {
  139. weap_pend[9] = 1
  140. if (get_cvar_num("amx_weaponwait") == 1) {
  141. scoped[3] = 1; scoped[13] = 1; scoped[18] = 1; scoped[24] = 1
  142. }else {
  143. scoped[3] = 1; scoped[13] = 1; scoped[18] = 1; scoped[24] = 1
  144. scoped_disabled[3] = 1; scoped_disabled[13] = 1; scoped_disabled[18] = 1; scoped_disabled[24] = 1
  145. }
  146. }
  147. if (containi(weaponname[curweap], "zoomscope")!=-1) {
  148. weap_pend[14] = 1
  149. if (get_cvar_num("amx_weaponwait") == 1) {
  150. zoomscope[3] = 1; zoomscope[8] = 1; zoomscope[13] = 1; zoomscope[18] = 1; zoomscope[24] = 1; zoomscope[27] = 1
  151. }else {
  152. zoomscope[3] = 1; zoomscope[8] = 1; zoomscope[13] = 1; zoomscope[18] = 1; zoomscope[24] = 1; zoomscope[27] = 1
  153. zoomscope_disabled[3] = 1; zoomscope_disabled[8] = 1; zoomscope_disabled[13] = 1; zoomscope_disabled[18] = 1; zoomscope_disabled[24] = 1; zoomscope_disabled[27] = 1
  154. }
  155. }
  156. if (containi(weaponname[curweap], "rifles")!=-1) {
  157. weap_pend[15] = 1
  158. if (get_cvar_num("amx_weaponwait") == 1) {
  159. rifles[22] = 1; rifles[28] = 1; rifles[3] = 1; rifles[8] = 1; rifles[13] = 1; rifles[18] = 1; rifles[24] = 1; rifles[27] = 1
  160. }else {
  161. rifles[22] = 1; rifles[28] = 1; rifles[3] = 1; rifles[8] = 1; rifles[13] = 1; rifles[18] = 1; rifles[24] = 1; rifles[27] = 1
  162. rifles_disabled[22] = 1; rifles_disabled[28] = 1; rifles_disabled[3] = 1; rifles_disabled[8] = 1; rifles_disabled[13] = 1; rifles_disabled[18] = 1; rifles_disabled[24] = 1; rifles_disabled[27] = 1
  163. }
  164. }
  165. first_time[curweap] = true
  166. weap_pend[curweap] = 1
  167. client_print(id,print_console,"[AMXX] Disable %s Next Round", weaponname[curweap])
  168.  
  169. }else {
  170. if (containi(weaponname[curweap], "pistols")!=-1) {
  171. weap_pend[0] = 2
  172. if (get_cvar_num("amx_weaponwait") == 1) {
  173. pistols[1] = 2; pistols[10] = 2; pistols[11] = 2; pistols[16] = 2; pistols[17] = 2; pistols[26] = 2
  174. }else {
  175. pistols[1] = 2; pistols[10] = 2; pistols[11] = 2; pistols[16] = 2; pistols[17] = 2; pistols[26] = 2
  176. pistols_disabled[1] = 2; pistols_disabled[10] = 2; pistols_disabled[11] = 2; pistols_disabled[16] = 2; pistols_disabled[17] = 2; pistols_disabled[26] = 2
  177. }
  178. }
  179. if (containi(weaponname[curweap], "shotguns")!=-1) {
  180. weap_pend[2] = 2
  181. if (get_cvar_num("amx_weaponwait") == 1) {
  182. shotguns[5] = 2; shotguns[21] = 2
  183. }else {
  184. shotguns[5] = 2; shotguns[21] = 2
  185. shotguns_disabled[5] = 2; shotguns_disabled[21] = 2
  186. }
  187. }
  188. if (containi(weaponname[curweap], "submachineguns")!=-1) {
  189. weap_pend[4] = 2
  190. if (get_cvar_num("amx_weaponwait") == 1) {
  191. submachineguns[7] = 2; submachineguns[12] = 2; submachineguns[19] = 2; submachineguns[23] = 2
  192. }else {
  193. submachineguns[7] = 2; submachineguns[12] = 2; submachineguns[19] = 2; submachineguns[23] = 2
  194. submachineguns_disabled[7] = 2; submachineguns_disabled[12] = 2; submachineguns_disabled[19] = 2; submachineguns_disabled[23] = 2
  195. }
  196. }
  197. if (containi(weaponname[curweap], "zoomed")!=-1) {
  198. weap_pend[6] = 2
  199. if (get_cvar_num("amx_weaponwait") == 1) {
  200. zoomed[8] = 2; zoomed[27] = 2
  201. }else {
  202. zoomed[8] = 2; zoomed[27] = 2
  203. zoomed_disabled[8] = 2; zoomed_disabled[27] = 2
  204. }
  205. }
  206. if (containi(weaponname[curweap], "scoped")!=-1) {
  207. weap_pend[9] = 2
  208. if (get_cvar_num("amx_weaponwait") == 1) {
  209. scoped[3] = 2; scoped[13] = 2; scoped[18] = 2; scoped[24] = 2
  210. }else {
  211. scoped[3] = 2; scoped[13] = 1; scoped[18] = 2; scoped[24] = 2
  212. scoped_disabled[3] = 2; scoped_disabled[13] = 2; scoped_disabled[18] = 2; scoped_disabled[24] = 2
  213. }
  214. }
  215. if (containi(weaponname[curweap], "zoomscope")!=-1) {
  216. weap_pend[14] = 2
  217. if (get_cvar_num("amx_weaponwait") == 1) {
  218. zoomscope[3] = 2; zoomscope[8] = 2; zoomscope[13] = 2; zoomscope[18] = 2; zoomscope[24] = 2; zoomscope[27] = 2
  219. }else {
  220. zoomscope[3] = 2; zoomscope[8] = 2; zoomscope[13] = 2; zoomscope[18] = 2; zoomscope[24] = 2; zoomscope[27] = 2
  221. zoomscope_disabled[3] = 2; zoomscope_disabled[8] = 2; zoomscope_disabled[13] = 2; zoomscope_disabled[18] = 2; zoomscope_disabled[24] = 2; zoomscope_disabled[27] = 2
  222. }
  223. }
  224. if (containi(weaponname[curweap], "rifles")!=-1) {
  225. weap_pend[15] = 2
  226. if (get_cvar_num("amx_weaponwait") == 1) {
  227. rifles[22] = 2; rifles[28] = 2; rifles[3] = 2; rifles[8] = 2; rifles[13] = 2; rifles[18] = 2; rifles[24] = 2; rifles[27] = 2
  228. }else {
  229. rifles[22] = 2; rifles[28] = 2; rifles[3] = 2; rifles[8] = 2; rifles[13] = 2; rifles[18] = 2; rifles[24] = 2; rifles[27] = 2
  230. rifles_disabled[22] = 2; rifles_disabled[28] = 2; rifles_disabled[3] = 2; rifles_disabled[8] = 2; rifles_disabled[13] = 2; rifles_disabled[18] = 2; rifles_disabled[24] = 2; rifles_disabled[27] = 2
  231. }
  232. }
  233. weap_pend[curweap] = 2
  234. client_print(id,print_console,"[AMXX] Enable %s Next Round", weaponname[curweap])
  235. if (get_cvar_num("amx_weaponwait") == 0)
  236. weap_disabled[curweap] = 0
  237. }
  238. return PLUGIN_HANDLED
  239. }
  240.  
  241. public dropthatweapon(id) {
  242. if (get_cvar_num("amx_weaponrest") == 0)
  243. return PLUGIN_HANDLED
  244. new weapon, ammo, wep
  245. weapon = get_user_weapon(id,wep,ammo)
  246. new const wepi = read_data(2)
  247. if (get_cvar_num("amx_weaponwait") == 1) {
  248. if (pistols[wepi] == 1 || shotguns[wepi] == 1 || submachineguns[wepi] == 1 || zoomed[wepi] == 1|| scoped[wepi] == 1 || zoomscope[wepi] == 1 || rifles[wepi] == 1) {
  249. if (pistols_disabled[wepi] == 0 && shotguns_disabled[wepi] == 0 && submachineguns_disabled[wepi] == 0 && zoomed_disabled[wepi] == 0&& scoped_disabled[wepi] == 0 && zoomscope_disabled[wepi] == 0 && rifles_disabled[wepi] == 0) {
  250. return PLUGIN_HANDLED
  251. }
  252. }
  253. if (pistols[wepi] == 2 || shotguns[wepi] == 2 || submachineguns[wepi] == 2 || zoomed[wepi] == 2|| scoped[wepi] == 2 || zoomscope[wepi] == 2 || rifles[wepi] == 2) {
  254. if (pistols_disabled[wepi] == 0 && shotguns_disabled[wepi] == 0 && submachineguns_disabled[wepi] == 0 && zoomed_disabled[wepi] == 0 && scoped_disabled[wepi] == 0 && zoomscope_disabled[wepi] == 0 && rifles_disabled[wepi] == 0) {
  255. return PLUGIN_HANDLED
  256. }
  257. }else if ( (weap_disabled[wepi] == 0) && (first_time[wepi] == true) ) {
  258. return PLUGIN_HANDLED
  259. }
  260. }
  261. if ( (weap_disabled[wepi] == 0) && (weap_pend[wepi] == 0) && (pistols[wepi] == 0) && (shotguns[wepi] == 0) && (submachineguns[wepi] == 0) && (zoomed[wepi] == 0) && (scoped[wepi] == 0) && (zoomscope[wepi] == 0) && (rifles[wepi] == 0) ) {
  262. return PLUGIN_HANDLED
  263. }
  264. if (get_cvar_num("amx_weaponwait") == 0) {
  265. check_special(id,weapon,wepi)
  266. if (weap_pend[wepi] == 1) {
  267. client_print(id,print_chat,"[AMXX] Hey butterfingers! Dont waste your time and money. That Weapon is Disabled")
  268. disarm_player(id,weapon)
  269. return PLUGIN_HANDLED
  270. }
  271. }
  272. if (pistols_disabled[wepi] == 1 || shotguns_disabled[wepi] == 1 || submachineguns_disabled[wepi] == 1 || zoomed_disabled[wepi] == 1 || scoped_disabled[wepi] == 1 || zoomscope_disabled[wepi] == 1 || rifles_disabled[wepi] == 1 ) {
  273. check_special(id,weapon,wepi)
  274. }
  275.  
  276. if ( (weap_disabled[wepi] == 1) && (first_time[wepi] == false) ) {
  277. client_print(id,print_chat,"[AMXX] Hey butterfingers! Dont waste your time and money. That Weapon is Disabled")
  278. disarm_player(id,weapon)
  279. }
  280. return PLUGIN_HANDLED
  281. }
  282.  
  283. public check_special(id,weapon,wepi) {
  284. if (pistols_disabled[wepi] == 1) {
  285. client_print(id,print_chat,"[AMXX] Hey butterfingers! Dont waste your time and money. All Pistols Are Diabled")
  286. disarm_player(id,weapon)
  287. }
  288. if (shotguns_disabled[wepi] == 1) {
  289. client_print(id,print_chat,"[AMXX] Hey butterfingers! Dont waste your time and money. All Shotguns Are Diabled")
  290. disarm_player(id,weapon)
  291. }
  292. if (submachineguns_disabled[wepi] == 1) {
  293. client_print(id,print_chat,"[AMXX] Hey butterfingers! Dont waste your time and money. All Sub Machine Guns Are Diabled")
  294. disarm_player(id,weapon)
  295. }
  296. if (zoomed_disabled[wepi] == 1) {
  297. client_print(id,print_chat,"[AMXX] Hey butterfingers! Dont waste your time and money. All Zoomed Rifles Are Diabled")
  298. disarm_player(id,weapon)
  299. }
  300. if (scoped_disabled[wepi] == 1) {
  301. client_print(id,print_chat,"[AMXX] Hey butterfingers! Dont waste your time and money. All Scoped Rifles Are Diabled")
  302. disarm_player(id,weapon)
  303. }
  304. if (zoomscope_disabled[wepi] == 1) {
  305. client_print(id,print_chat,"[AMXX] Hey butterfingers! Dont waste your time and money. All Zoomed & Scoped Rifles Are Diabled")
  306. disarm_player(id,weapon)
  307. }
  308. if (rifles_disabled[wepi] == 1) {
  309. client_print(id,print_chat,"[AMXX] Hey butterfingers! Dont waste your time and money. All Rifles Are Diabled")
  310. disarm_player(id,weapon)
  311. }
  312. return PLUGIN_CONTINUE
  313. }
  314.  
  315. disarm_player(victim, weapon){
  316. new wpname[32]
  317. new parm[2]
  318. parm[0]=victim
  319. get_weaponname(weapon,wpname,31)
  320. engclient_cmd(victim,"drop",wpname)
  321. return PLUGIN_CONTINUE
  322. }
  323.  
  324. public WEAPVote(id,level,cid) {
  325. if (get_cvar_num("amx_weaponrest") == 0)
  326. return PLUGIN_HANDLED
  327. read_argv(1,voteweapon,31)
  328. new m = 0
  329. new bool:test = false
  330. while (++m <= 30) {
  331. if (equali(vote_weapon[m], voteweapon) ) {
  332. votewepi = m
  333. set_cvar_num("amx_vote_temp",m)
  334. test = true
  335. }
  336. }
  337. if (test == false) {
  338. return PLUGIN_CONTINUE
  339. }
  340. if( (wvote_deny == true) && (!(get_user_flags(id)&ADMIN_MAP)) ){
  341. client_print(id,print_chat,"[AMXX] We just had a weapon vote. Wait a little longer.")
  342. return PLUGIN_HANDLED
  343. }
  344. new Float:voting = get_cvar_float("amx_last_voting")
  345. if (voting > get_gametime()){
  346. client_print(id,print_chat,"There is already one voting...")
  347. return PLUGIN_HANDLED
  348. }
  349. if (voting && voting + get_cvar_float("amx_vote_delay") > get_gametime()) {
  350. client_print(id,print_chat,"Voting not allowed at this time")
  351. return PLUGIN_HANDLED
  352. }
  353. new inprogress[32]
  354. get_cvar_string("amx_vote_inprogress",inprogress,32)
  355. if (equal(inprogress, "0")) {
  356. new keys
  357. new menu_msg[256]
  358. if ( (weap_disabled[votewepi] == 1) || (weap_pend[votewepi] == 1) ) {
  359. format(menu_msg,256, "\yEnable the weapon %s? \w^n^n1. Yes^n2. No", weaponname[votewepi])
  360. voteoutcome = 1
  361.  
  362. }else {
  363. format(menu_msg,256, "\yDisable the weapon %s? \w^n^n1. Yes^n2. No", weaponname[votewepi])
  364. voteoutcome = 2
  365. }
  366. keys = (1<<0)|(1<<1)
  367. new authid[32],name[32]
  368. get_user_authid(id,authid,31)
  369. get_user_name(id,name,32)
  370. log_amx("^"%s<%d><%s><>^" vote weaponname[%s] ",name,get_user_userid(id),authid, weaponname[votewepi])
  371. new Float:vote_time = get_cvar_float("amx_vote_time") + 2.0
  372. set_cvar_float("amx_last_voting", get_gametime() + vote_time )
  373. vote_ratio = get_cvar_float("amx_weapvote_ratio")
  374. for(new a = 0; a < 33; a++) {
  375. votecontroller[a][1] = 0
  376. }
  377. votenumber++
  378. set_cvar_string("amx_vote_inprogress","1")
  379. bVoteToStop = true
  380. totalvoters = 0
  381. new Team[33]
  382. new maxpl = get_maxplayers()+1
  383. for(new k = 1; k < maxpl; k++){
  384. get_user_team(k,Team,33)
  385. if(!((equali(Team,"UNAS",4)) || (equali(Team,"SPEC",4)) || (get_user_time(k)== 0) )) {
  386. show_menu(k,keys,menu_msg,floatround(vote_time))
  387. totalvoters++
  388. }
  389. }
  390. st_vote = 0
  391. set_task(vote_time,"HandleWEAPVote")
  392. client_print(id,print_chat,"[AMXX] Voting has started...")
  393. for(new j = 0; j < 4;++j) option[j] = 0
  394. }else{
  395. client_print(id,print_chat,"[AMXX] Voting not allowed yet.")
  396. }
  397. return PLUGIN_HANDLED
  398. }
  399.  
  400. public HandleWEAPVote(id) {
  401. votewepi2 = get_cvar_num("amx_vote_temp")
  402. wvote_deny = true
  403. set_task(get_cvar_float("amx_wvote_delay"),"wep_vote_deny")
  404. set_cvar_string("amx_vote_inprogress","0")
  405. bVoteToStop = false
  406. for(new a = 0; a < 33; a++){
  407. votecontroller[a][1] = 0
  408. }
  409. if(st_vote == 1){
  410. st_vote = 0
  411. client_print(0,print_chat,"[AMXX] Voting sucessfully stopped.")
  412. return PLUGIN_HANDLED
  413. }
  414. new best = 0
  415. new best_count = 0
  416. for(new a = 0; a < 4; ++a) {
  417. if (option[a] > best_count){
  418. best_count = option[a]
  419. best = a
  420. }
  421. }
  422. new inum = totalvoters
  423. new Float:result_v = inum ? (float(option[best]) / float(inum)) : 0.0
  424. if (result_v >= vote_ratio) {
  425. if(best == 0){
  426. if (voteoutcome == 0) {
  427. show_hudmessage(0,"Voting Results: %s restrictions will stay^n^n%d votes to keep the %s disabled^n%d votes to enable the %s^n^n%d Total eligible voters",vote_weapon[votewepi],option[0],vote_weapon[votewepi],option[1],vote_weapon[votewepi],totalvoters)
  428. }else if (voteoutcome == 1) {
  429. show_hudmessage(0,"Voting Results: The %s will be enabled next round^n^n%d votes to keep the %s disabled^n%d votes to enable the %s^n^n%d Total eligible voters",vote_weapon[votewepi],option[0],vote_weapon[votewepi],option[1],vote_weapon[votewepi],totalvoters)
  430. weap_pend[votewepi2] = 2
  431. first_time[votewepi2] = true
  432. }else {
  433. show_hudmessage(0,"Voting Results: %s restrictions are in effect next round^n^n%d votes to disable the %s^n%d votes to keep the %s^n^n%d Total eligible voters",vote_weapon[votewepi],option[0],vote_weapon[votewepi],option[1],vote_weapon[votewepi],totalvoters)
  434. client_print(id, print_console, "SetVoteWepi=^"%s^"",votewepi2)
  435. weap_pend[votewepi2] = 1
  436. first_time[votewepi2] = true
  437. }
  438. log_amx("World triggered ^"voting_success^" (needed ^"%.2f^") (ratio ^"%.2f^") (result ^"%s^")",
  439. vote_ratio,result_v,vote_weapon[votewepi])
  440. }else {
  441. if(weap_disabled[votewepi2] == 1) {
  442. show_hudmessage(0,"Voting Results: The %s will be enabled next round^n^n%d votes to keep the %s disabled^n%d votes to enable the %s^n^n%d Total eligible voters",vote_weapon[votewepi],option[0],vote_weapon[votewepi],option[1],vote_weapon[votewepi],totalvoters)
  443. weap_pend[votewepi2] = 2
  444. first_time[votewepi2] = true
  445. } else {
  446. show_hudmessage(0,"Voting Results: The %s will continue to be enabled^n^n%d votes to disable the %s^n%d votes to keep the %s enabled^n^n%d Total eligible voters",vote_weapon[votewepi],option[0],vote_weapon[votewepi],option[1],vote_weapon[votewepi],totalvoters)
  447. }
  448. log_amx("World triggered ^"voting_failure^" (needed ^"%.2f^") (ratio ^"%.2f^")",vote_ratio,result_v)
  449. }
  450. }else{
  451. client_print(0,print_chat,"[AMXX] Voting for %s restrictions failed... No clear majority.",vote_weapon[votewepi])
  452. }
  453. return PLUGIN_HANDLED
  454. }
  455.  
  456. public client_connect(id){
  457. votecontroller[id][1] = 0
  458. return PLUGIN_CONTINUE
  459. }
  460.  
  461. public client_disconnect(id){
  462. votecontroller[id][1] = 0
  463. return PLUGIN_CONTINUE
  464. }
  465.  
  466. public wep_vote_deny(){
  467. wvote_deny = false
  468. return PLUGIN_CONTINUE
  469. }
  470.  
  471. public stopvote(id){
  472. if (!(get_user_flags(id)&ADMIN_MAP)){
  473. client_print(id,print_console,"[AMXX] You have no access to that command")
  474. return PLUGIN_HANDLED
  475. }
  476. if(bVoteToStop == true){
  477. new name[32]
  478. get_user_name(id,name,32)
  479. st_vote = 1
  480. client_print(id,print_console,"[AMXX] ADMIN !!! Ignore the unknown command message -- its ok")
  481. client_print(0,print_chat,"[AMXX] %s has disabled the vote in progress.",name)
  482. }
  483. return PLUGIN_CONTINUE
  484. }
  485.  
  486. public vote_count(id,key){
  487. new name[32]
  488. get_user_name(id,name,32)
  489. if(votenumber != votecontroller[id][0]) {
  490. votecontroller[id][0] = votenumber
  491. if (get_cvar_float("amx_vote_answers")) {
  492. client_print(0,print_chat,"[AMXX] %s voted for option # %d",name,key+1)
  493. }
  494. option[key] += 1
  495. }else{
  496. votecontroller[id][1] +=1
  497. }
  498. return PLUGIN_CONTINUE
  499. }
  500.  
  501. public round_start(id){
  502. if (get_cvar_num("amx_weaponrest") == 0)
  503. return PLUGIN_HANDLED
  504. delayed_rs(id)
  505. return PLUGIN_CONTINUE
  506. }
  507.  
  508. public delayed_rs(id){
  509. if (get_cvar_num("amx_weaponrest") == 0)
  510. return PLUGIN_HANDLED
  511. for(new j = 0; j<31;j++) {
  512. if ((weap_pend[j] == 2) && (weap_disabled[j] == 1)) {
  513. if (weap_pend[0] == 2) {
  514. pistols[1] = 0; pistols[10] = 0; pistols[11] = 0; pistols[16] = 0; pistols[17] = 0; pistols[26] = 0
  515. pistols_disabled[1] = 0; pistols_disabled[10] = 0; pistols_disabled[11] = 0; pistols_disabled[16] = 0; pistols_disabled[17] = 0; pistols_disabled[26] = 0
  516. }
  517. if (weap_pend[2] == 2) {
  518. shotguns[5] = 0; shotguns[21] = 0
  519. shotguns_disabled[5] = 0; shotguns_disabled[21] = 0
  520. }
  521. if (weap_pend[4] == 2) {
  522. submachineguns[7] = 0; submachineguns[12] = 0; submachineguns[19] = 0; submachineguns[23] = 0
  523. submachineguns_disabled[7] = 0; submachineguns_disabled[12] = 0; submachineguns_disabled[19] = 0; submachineguns_disabled[23] = 0
  524. }
  525. if (weap_pend[6] == 2) {
  526. zoomed[8] = 0; zoomed[27] = 0
  527. zoomed_disabled[8] = 0; zoomed_disabled[27] = 0
  528. }
  529. if (weap_pend[9] == 2) {
  530. scoped[3] = 0; scoped[13] = 0; scoped[18] = 0; scoped[24] = 0
  531. scoped_disabled[3] = 0; scoped_disabled[13] = 0; scoped_disabled[18] = 0; scoped_disabled[24] = 0
  532. }
  533. if (weap_pend[14] == 2) {
  534. zoomscope[3] = 0; zoomscope[8] = 0; zoomscope[13] = 0; zoomscope[18] = 0; zoomscope[24] = 0; zoomscope[27] = 0
  535. zoomscope_disabled[3] = 0; zoomscope_disabled[8] = 0; zoomscope_disabled[13] = 0; zoomscope_disabled[18] = 0; zoomscope_disabled[24] = 0; zoomscope_disabled[27] = 0
  536. }
  537. if (weap_pend[15] == 2) {
  538. rifles[22] = 0; rifles[28] = 0; rifles[3] = 0; rifles[8] = 0; rifles[13] = 0; rifles[18] = 0; rifles[24] = 0; rifles[27] = 0
  539. rifles_disabled[22] = 0; rifles_disabled[28] = 0; rifles_disabled[3] = 0; rifles_disabled[8] = 0; rifles_disabled[13] = 0; rifles_disabled[18] = 0; rifles_disabled[24] = 0; rifles_disabled[27] = 0
  540. }
  541. weap_pend[j] = 0
  542. weap_disabled[j] = 0
  543. }
  544. if (weap_pend[j] == 1) {
  545. if (weap_pend[0] == 1) {
  546. pistols[1] = 1; pistols[10] = 1; pistols[11] = 1; pistols[16] = 1; pistols[17] = 1; pistols[26] = 1
  547. pistols_disabled[1] = 1; pistols_disabled[10] = 1; pistols_disabled[11] = 1; pistols_disabled[16] = 1; pistols_disabled[17] = 1; pistols_disabled[26] = 1
  548. }
  549. if (weap_pend[2] == 1) {
  550. shotguns[5] = 1; shotguns[21] = 1
  551. shotguns_disabled[5] = 1; shotguns_disabled[21] = 1
  552. }
  553. if (weap_pend[4] == 1) {
  554. submachineguns[7] = 1; submachineguns[12] = 1; submachineguns[19] = 1; submachineguns[23] = 1
  555. submachineguns_disabled[7] = 1; submachineguns_disabled[12] = 1; submachineguns_disabled[19] = 1; submachineguns_disabled[23] = 1
  556. }
  557. if (weap_pend[6] == 1) {
  558. zoomed[8] = 1; zoomed[27] = 1
  559. zoomed_disabled[8] = 1; zoomed_disabled[27] = 1
  560. }
  561. if (weap_pend[9] == 1) {
  562. scoped[3] = 1; scoped[13] = 1; scoped[18] = 1; scoped[24] = 1
  563. scoped_disabled[3] = 1; scoped_disabled[13] = 1; scoped_disabled[18] = 1; scoped_disabled[24] = 1
  564. }
  565. if (weap_pend[14] == 1) {
  566. zoomscope[3] = 1; zoomscope[8] = 1; zoomscope[13] = 1; zoomscope[18] = 1; zoomscope[24] = 1; zoomscope[27] = 1
  567. zoomscope_disabled[3] = 1; zoomscope_disabled[8] = 1; zoomscope_disabled[13] = 1; zoomscope_disabled[18] = 1; zoomscope_disabled[24] = 1; zoomscope_disabled[27] = 1
  568. }
  569. if (weap_pend[15] == 1) {
  570. rifles[22] = 1; rifles[28] = 1; rifles[3] = 1; rifles[8] = 1; rifles[13] = 1; rifles[18] = 1; rifles[24] = 1; rifles[27] = 1
  571. rifles_disabled[22] = 1; rifles_disabled[28] = 1; rifles_disabled[3] = 1; rifles_disabled[8] = 1; rifles_disabled[13] = 1; rifles_disabled[18] = 1; rifles_disabled[24] = 1; rifles_disabled[27] = 1
  572. }
  573. weap_disabled[j] = 1
  574. weap_pend[j] = 0
  575. }
  576. if (first_time[j] == true) {
  577. first_time[j] = false
  578. }
  579. }
  580. return PLUGIN_CONTINUE
  581. }
  582.  
  583. public plugin_init() {
  584. register_plugin("Advanced Weapon Vote and Restriction","0.33","MagicShot")
  585. register_clcmd("amx_weaprest","checkweap",ADMIN_LEVEL_A,"amx_weaprest : toggles restricted weapons eg. amx_weaprest weaponname")
  586. register_event("CurWeapon","dropthatweapon","b","1=1")
  587. register_event("ResetHUD","round_start","b","1=1")
  588. register_clcmd("say", "WEAPVote")
  589. register_menucmd(register_menuid("Disable the"),(1<<0)|(1<<1)|(1<<2)|(1<<3),"vote_count")
  590. register_menucmd(register_menuid("Enable the"),(1<<0)|(1<<1)|(1<<2)|(1<<3),"vote_count")
  591. register_cvar("amx_weaponrest","1",0)
  592. register_cvar("amx_weaponwait","1",0)
  593. register_cvar("amx_weapvote_ratio","0.51")
  594. register_cvar("amx_vote_temp","0")
  595. register_cvar("amx_xtra_wep_msg","0")
  596. register_cvar("amx_map_wep_msg","0")
  597. register_cvar("amx_vote_inprogress","0")
  598. register_cvar("amx_wvote_delay","180.0")
  599. register_cvar("amx_last_voting","0")
  600. set_cvar_float("amx_last_voting",0.0)
  601. return PLUGIN_CONTINUE
  602. }

Elgondolásom: Bele írsz a pluginba egy olyat, hogy pl: restrict_weap.ini => ebbe bele írod az általad letiltott fegyvereket, és a plugin innen olvassa ki.

Vagy: pályanév szerint csinálsz .iniket, és csak az adott mappon, az adott iniből fogja kiolvasni a plugin.

Remélem tudtam segíteni ! ;)

Üdv.
Anonymous1337

_________________
Ha elnyerte valamelyik témában a hozzászólásom a tetszésedet melyet olvastál, akkor egy egyszerű gombnyomással kifejezheted, hogy tetszett.


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Fegyver vásárlás letiltás
HozzászólásElküldve: 2013.08.07. 08:19 
Offline
Developer
Avatar

Csatlakozott: 2011.06.01. 21:11
Hozzászólások: 7962
Megköszönt másnak: 295 alkalommal
Megköszönték neki: 535 alkalommal
Már megint a túlbonyolítás.

Csinálsz a configs mappában egy maps mappát. Tehát: amxmodx/configs/maps/, azon belül meg egy cfgt, a pálya nevével. Példa: de_dust2.cfg

Ha ez megvan, győződj meg hogy a restmenu.amxx bevan kapcsolva, alap járaton bekel lennie neki kapcsolva.

Utána a cfg tartalma ez legyen:
Kód:
amx_restrict on m4a1


így tiltani fogja a m4a1et a dust2őn, remélem érthető voltam.

És a fegyverek, esetleg ha más fegyvert akarsz tiltani:
Kód:
Weapon Name -> Restrict Name
H&K USP .45 Tactical -> usp
Glock18 Select Fire -> glock
Desert Eagle .50AE -> deagle
SIG P228 -> p228
Dual Beretta 96G Elite -> elites
FN Five-Seven -> fn57
Benelli M3 Super90 (pump shotty) -> m3
Benelli XM1014 (auto shotty) -> xm1014
H&K MP5-Navy -> mp5
Steyr Tactical Machine Pistol -> tmp
FN P90 -> p90
Ingram MAC-10 -> mac10
H&K UMP45 -> ump45
AK-47 -> ak47
Gali -> galil
Famas -> famas
Sig SG-552 Commando -> sg552
Colt M4A1 Carbine -> m4a1
Steyr Aug -> aug
Steyr Scout -> scout
AI Arctic Warfare/Magnum -> awp
H&K G3/SG-1 Sniper Rifle -> g3sg1
Sig SG-550 Sniper -> sg550
FN M249 Para (machine gun) -> m249
Kevlar Vest -> vest
Kevlar Vest & Helmet -> vesthelm
Flashbang -> flash
HE Grenade -> hegren
Smoke Grenade -> sgren
Defuse Kit -> defuser
NightVision Goggles -> nvgs
Tactical Shield -> shield
Primary weapon ammo -> primammo
Secondary weapon ammo -> secammo

_________________
http://www.easyrankup.eu


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  [ 3 hozzászólás ] 


Ki van itt

Jelenlévő fórumozók: nincs regisztrált felhasználó valamint 12 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