Advertisement
Guest User

main.work.darkcore.lua

a guest
Apr 30th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 30.70 KB | None | 0 0
  1. ------------------------------------------------------------------------------------------
  2. -- MIX ADMIN SCRIPT --
  3. -- BY : Lawless --
  4. -- USGN: 4823 --
  5. ------------------------------------------------------------------------------------------
  6.  
  7. pl = {}
  8.  
  9. -- Administrators --
  10. owner = {23882,154130,4823,166404,31341,9929} -- Owner has GM tag, but has an !rcon command. I added this since rcon is very powerful (crashing server etc).
  11. gamemaster = {} --Put your USGN here
  12. supermod = {14686}
  13. mod = {} -- Moderator USGN here
  14. vip = {} -- VIP USGN here.
  15. viplus = {} -- Super VIP.
  16.  
  17. color = { -- You can change this, or add some extra colors. Note: the last color mustn't have "," behind it! "\169" is a copyright icon.
  18. "\169255220000", -- CS2D (yellow) 1
  19. "\169255255255", -- white 2
  20. "\169255000000", -- red 3
  21. "\169000255000", -- green 4
  22. "\169000000255", -- blue 5
  23. "\169220220220", -- light grey 6
  24. "\169064179162", -- PM - light blue 7
  25. "\169255025000", -- T 8
  26. "\169050150255", -- CT 9
  27. "\169100100100", -- pretty dark grey - tag 10
  28. "\169153255051", -- Pretty Green color - 11
  29. "\169255102102", -- 12
  30. "\169178255102", -- 13
  31. "\169255153153" -- 14
  32. },
  33.  
  34. -- HOOKS --
  35. addhook("join","_join")
  36. addhook("say","_says")
  37. addhook("clientdata","_clientdata")
  38. addhook("startround","_startround")
  39.  
  40. -- FUNCS --
  41. function _join(id) -- No need to change anything here
  42. pl[id] = {}
  43. pl[id].lvl = 1
  44. pl[id].status = "Player"
  45. pl[id].name = player(id,"name")
  46. pl[id].usgn = player(id,"usgn")
  47. pl[id].ip = player(id,"ip")
  48. pl[id].muted = false
  49. for _, usgn in ipairs(owner) do
  50. if player(id,"usgn")==usgn then
  51. pl[id].lvl = 15
  52. pl[id].status = "Super Administrator"
  53. pl[id].tag = ">+Admin <" --Same tag
  54. pl[id].has_tag = true
  55. end
  56. end
  57. for _, usgn in ipairs(gamemaster) do
  58. if player(id,"usgn")==usgn then
  59. pl[id].lvl = 10
  60. pl[id].status = "Administrator"
  61. pl[id].tag = ">Admin <"
  62. pl[id].has_tag = true
  63. end
  64. end
  65. for _, usgn in ipairs(mod) do
  66. if player(id,"usgn")==usgn then
  67. pl[id].lvl = 5
  68. pl[id].status = "Moderator"
  69. pl[id].tag = ">Moderator <"
  70. pl[id].has_tag = true
  71. end
  72. end
  73. for _, usgn in ipairs(vip) do
  74. if player(id,"usgn")==usgn then
  75. pl[id].lvl = 2
  76. pl[id].status = "V.I.P"
  77. pl[id].tag = ">VIP <"
  78. pl[id].has_tag = true
  79. end
  80. end
  81. for _, usgn in ipairs(viplus) do
  82. if player(id,"usgn")==usgn then
  83. pl[id].lvl = 3
  84. pl[id].status = "Super V.I.P"
  85. pl[id].tag = ">+VIP <"
  86. pl[id].has_tag = true
  87. end
  88. end
  89. for _, usgn in ipairs(supermod) do
  90. if player(id,"usgn")==usgn then
  91. pl[id].lvl = 6
  92. pl[id].status = "Super Moderator"
  93. pl[id].tag = ">+Moderator <"
  94. pl[id].has_tag = true
  95. end
  96. end
  97. welcome(id)
  98. end
  99.  
  100. function welcome(id)
  101. msg2(id,color[1].."Welcome to the aM Server")
  102. msg2(id,color[1].."Visit us at \169000255000www.am2d.net")
  103. msg2(id,color[1].."This server is powered by Aftermath Alpha Script V0.2")
  104. msg2(id,color[1].."To register and access more of the server, type @register name pass")
  105. msg2(id,color[1].."To login, type in @login uname password")
  106. msg2(id,color[1].."Type @help or ? for a list of commands")
  107. msg2(id,color[1].."Type @broadcast to announce an important message.")
  108. if pl[id].usgn==1 then
  109. msg2(id,color[3].."")
  110. elseif pl[id].usgn==1 then
  111. elseif pl[id].lvl >= 2 then
  112. msg2(id,color[1].."Logged in as a \169000255000"..pl[id].tag.."\169255220000.")
  113. end
  114. end
  115.  
  116. function error(id,txt,error)
  117. if error==1 then
  118. msg2(id,color[3].."Error, not enough privileges!")
  119. elseif error==2 then
  120. msg2(id,color[3].."Error, no players known with the I.D. "..t)
  121. elseif error==3 then
  122. msg2(id,color[3].."Error, bots are not banable")
  123. elseif error==4 then
  124. msg2(id,color[3].."Error, you have been muted, therefore you cannot talk")
  125. elseif error==5 then
  126. msg2(id,color[3].."Error, value is too high. 1-10 allowed")
  127. elseif error==6 then
  128. msg2(id,color[3].."Error, you don't own a score to reset")
  129. elseif error==7 then
  130. msg2(id,color[3].."Error, value is too high. 1-60 allowed")
  131. elseif error==8 then
  132. msg2(id,color[3].."Error, player has not been muted")
  133. elseif error==9 then
  134. msg2(id,color[3].."Error, muted ID "..t)
  135. elseif error==10 then
  136. msg2(id,""..color[3].."Error, bots cannot be muted")
  137. elseif error==11 then
  138. msg2(id,""..color[3].."Error, can't silence bots")
  139. elseif error==12 then
  140. msg2(id,""..color[3].."Error, bots doesn't have any information(s) granted")
  141. elseif error==13 then
  142. msg2(id,""..color[3].."Error, value is too high. 1-7 allowed")
  143. elseif error==14 then
  144. msg2(id,""..color[3].."Error, value is too high. 1-20 allowed")
  145. elseif error==15 then
  146. msg2(id,""..color[3].."Error, value is too high. 1-3 allowed")
  147. end
  148. end
  149. function _says(id,txt)
  150. if pl[id].muted == true then
  151. error(id,txt,4)
  152. return 1
  153. end
  154. if (txt == "rank") then
  155. return 0
  156. end
  157. if txt:sub(1,5)=="@kick" then
  158. if pl[id].lvl >= 5 then
  159. t = tonumber(txt:sub(7,8))
  160. local r = txt:sub(9)
  161. if pl[t].lvl >= 10 then
  162. msg2(id, "\169255000000Error, can't @kick a administration member.")
  163. return 1
  164. end
  165. if not player(t,"exists") then error(id,txt,2) return 1 end
  166. parse('kick '..t..' "'..r)
  167. msg(color[9]..""..player(id,"name").." "..color[9].."used: "..color[11].."@kick")
  168. return 1
  169. else
  170. error(id,txt,1)
  171. return 1
  172. end
  173. end
  174. if txt:sub(1,4)=="@ban" then
  175. if pl[id].lvl >= 5 then
  176. t = tonumber(txt:sub(6,7))
  177. r = txt:sub(10)
  178. if pl[t].lvl >= 10 then
  179. msg2(id, "\169255000000Error, can't @ban a administration member.")
  180. return 1
  181. end
  182. if not player(t,"exists") then error(id,txt,2) return 1 end
  183. if player(t,"bot")==true then error(id,txt,3) return 1 end
  184. parse('banip '..player(t,"ip")..' 0 "'..r)
  185. msg(color[9]..""..player(id,"name").." "..color[9].."used: "..color[11].."@ban")
  186. return 1
  187. else
  188. error(id,txt,1)
  189. return 1
  190. end
  191. end
  192. if txt:sub(1,6)=="@busgn" then
  193. if pl[id].lvl >= 5 then
  194. t = tonumber(txt:sub(8,9))
  195. r = txt:sub(11)
  196. if pl[t].lvl >= 10 then
  197. msg2(id, "\169255000000Error, can't @busgn a administration member.")
  198. return 1
  199. end
  200. if not player(t,"exists") then error(id,txt,2) return 1 end
  201. if player(t,"bot")==true then error(id,txt,3) return 1 end
  202. parse('banusgn '..player(t,"usgn")..' 0 "'..r)
  203. msg(color[9]..""..player(id,"name").." "..color[9].."used: "..color[11].."@busgn")
  204. return 1
  205. else
  206. error(id,txt,1)
  207. return 1
  208. end
  209. end
  210. if txt:sub(1,8)=="@tempban" then
  211. if pl[id].lvl >= 10 then
  212. t = tonumber(txt:sub(10,11))
  213. duration = txt:sub(12,14)
  214. r = txt:sub(15)
  215. if pl[t].lvl >= 10 then
  216. msg2(id, "\169255000000Error, can't @tempban a administration member.")
  217. return 1
  218. end
  219. if not player(t,"exists") then error(id,txt,2) return 1 end
  220. if player(t,"bot")==true then error(id,txt,3) return 1 end
  221. if tonumber(duration) > 60 then error(id,txt,7) return 1 end
  222. msg(color[11]..""..color[9]..""..pl[id].name.." used"..color[11].." @tempban")
  223. if player(t,"usgn")==0 then
  224. msg2(id,color[4]..""..color[2]..""..player(t,"name").." was not logged in to USGN.")
  225. msg(color[9]..""..player(id,"name").." "..color[9].."used: "..color[11].."@tempban")
  226. parse('banip '..player(t,"ip")..' '..duration..' "'..r)
  227. return 1
  228. else
  229. parse('banusgn '..player(t,"usgn")..' '..duration..' "'..r)
  230. return 1
  231. end
  232. else
  233. error(id,txt,1)
  234. return 1
  235. end
  236. end
  237. if txt=="@public" then
  238. if pl[id].lvl >= 5 then
  239. msg(color[9]..""..player(id,"name").." "..color[9].."used: "..color[11].."@public")
  240. parse("sv_msg \169255220000public settings: ©000255000ENABLED@C")
  241. parse("restartround")
  242. parse("sv_fow 0")
  243. parse("mp_startmoney 16000")
  244. parse("mp_roundtime 2")
  245. parse("mp_buytime 100000")
  246. parse("mp_freezetime 2")
  247. parse("sv_specmode 1")
  248. parse("sv_password")
  249. parse("sv_msg ©000255000$16000: | RT: 2 | Fow: Disabled | FT: 3 | No Pass | Usgnonly: Disable")
  250. parse("sv_name aM' » Gaming")
  251. return 1
  252. else
  253. error(id,txt,1)
  254. return 1
  255. end
  256. end
  257. if txt=="@mix" then
  258. if pl[id].lvl >= 5 then
  259. msg(color[9]..""..player(id,"name").." "..color[9].."used: "..color[11].."@mix")
  260. parse("sv_msg \169255220000mix settings: ©000255000ENABLED@C")
  261. parse("sv_msg ©255255255Get ready for the mix@C")
  262. parse("sv_msg ©255000000GL ©255255255& ©255000000 HF!@C")
  263. parse("sv_msg ©000255000LIVE!@C")
  264. parse("sv_fow 1")
  265. parse("mp_startmoney 800")
  266. parse("mp_roundtime 2")
  267. parse("sv_name aM' » mixteam")
  268. parse("sv_password match")
  269. parse("mp_buytime 0.25")
  270. parse("mp_freezetime 7")
  271. parse("sv_specmode 2")
  272. parse("mp_pinglimit 0")
  273. parse("restartround")
  274. parse("sv_msg ©000255000$800: | RT: 2 | Fow: Enabled | FT: 7 | Password: match | Usgnonly: Enabled")
  275. return 1
  276. else
  277. error(id,txt,1)
  278. return 1
  279. end
  280. end
  281. if txt:sub(1,6)=="@unban" then
  282. if pl[id].lvl >= 10 then
  283. mask = txt:sub(8)
  284. parse("unban "..mask)
  285. msg(color[9]..""..player(id,"name").." "..color[9].."used: "..color[11].."@unban")
  286. msg2(id,color[1].."You have unbanned: "..color[1]..""..mask)
  287. return 1
  288. else
  289. error(id,txt,1)
  290. return 1
  291. end
  292. end
  293. if txt=="@live" then
  294. if pl[id].lvl >= 10 then
  295. msg(color[9]..""..player(id,"name").." "..color[9].."used: "..color[11].."@live")
  296. parse("sv_msg ©255255255Get ready for the mix@C")
  297. parse("sv_fow 1")
  298. parse("mp_startmoney 800")
  299. parse("mp_roundtime 2")
  300. parse("mp_buytime 0.25")
  301. parse("mp_freezetime 7")
  302. parse("sv_specmode 2")
  303. parse("mp_pinglimit 0")
  304. parse("mp_maxclientsip 1")
  305. parse("sv_maxplayers 16")
  306. parse("mp_autoteambalance 0")
  307. parse("mp_kickpercent 0.0")
  308. parse("transfer_speed 250")
  309. parse("mp_damagefactor 1.0")
  310. parse("sv_maptransfer 1")
  311. parse("mp_antispeeder 0")
  312. parse("mp_postspawn 0")
  313. parse("mp_maxrconfails 5")
  314. parse("sv_friendlyfire 0")
  315. parse("mp_smokeblock 1")
  316. parse("restartround")
  317. parse("sv_msg ©255000000GL ©255255255& ©255000000 HF!@C")
  318. parse("sv_msg ©000255000LIVE!@C")
  319. return 1
  320. else
  321. error(id,txt,1)
  322. return 1
  323. end
  324. end
  325. if txt:sub(1,5)=="@mute" then
  326. if pl[id].lvl >= 10 then
  327. t = tonumber(txt:sub(7,8))
  328. reason = txt:sub(9)
  329. if pl[t].lvl >= 10 then
  330. msg2(id, "\169255000000Error, can't @mute a administration member.")
  331. return 1
  332. end
  333. if not player(t,"exists") then error(id,txt,2) return 1 end
  334. if player(t,"bot")==true then error(id,txt,10) return 1 end
  335. if pl[t].muted==false then
  336. pl[t].muted=true
  337. msg(color[9]..""..player(id,"name").." "..color[9].."used: "..color[11].."@mute")
  338. return 1
  339. else
  340. pl[t].muted=true
  341. error(id,txt,9)
  342. return 1
  343. end
  344. else
  345. error(id,txt,1)
  346. return 1
  347. end
  348. end
  349. if txt:sub(1,5)=="@kill" then
  350. if pl[id].lvl >= 5 then
  351. t = tonumber(txt:sub(7,8))
  352. if pl[t].lvl >= 10 then
  353. msg2(id, "\169255000000Error, can't @kill a administration member.")
  354. return 1
  355. end
  356. if not player(t,"exists") then error(id,txt,2) return 1 end
  357. parse("killplayer "..t)
  358. msg(color[9]..""..player(id,"name").." "..color[9].."used: "..color[11].."@kill")
  359. return 1
  360. else
  361. error(id,txt,1)
  362. return 1
  363. end
  364. end
  365. if txt:sub(1,5)=="@slap" then
  366. if pl[id].lvl >= 5 then
  367. t = tonumber(txt:sub(7,8))
  368. if pl[t].lvl >= 10 then
  369. msg2(id, "\169255000000Error, can't @slap a administration member.")
  370. return 1
  371. end
  372. if not player(t,"exists") then error(id,txt,2) return 1 end
  373. msg(color[9]..""..player(id,"name").." "..color[9].."used: "..color[11].."@slap")
  374. parse("slap "..t)
  375. return 1
  376. else
  377. error(id,txt,1)
  378. return 1
  379. end
  380. end
  381. if txt:sub(1,6)=="@equip" then
  382. if pl[id].lvl >= 10 then
  383. t = tonumber(txt:sub(8,9))
  384. if pl[t].lvl >= 10 then
  385. msg2(id, "\169255000000Error, can't @equip a administration member.")
  386. return 1
  387. end
  388. item = tonumber(txt:sub(10,12))
  389. parse("equip "..t.." "..item)
  390. msg(color[9]..""..player(id,"name").." "..color[9].."used: "..color[11].."@equip")
  391. msg2(t,color[1]..""..pl[id].name.." gave you item \169000255000#"..item)
  392. return 1
  393. else
  394. error(id,txt,1)
  395. return 1
  396. end
  397. end
  398. if txt:sub(1,6)=="@strip" then
  399. if pl[id].lvl >= 5 then
  400. t = tonumber(txt:sub(8,9))
  401. if pl[t].lvl >= 10 then
  402. msg2(id, "\169255000000Error, can't @strip a administration member.")
  403. return 1
  404. end
  405. if not player(t,"exists") then error(id,txt,2) return 1 end
  406. msg(color[9]..""..player(id,"name").." "..color[9].."used: "..color[11].."@strip")
  407. parse("strip "..t)
  408. return 1
  409. else
  410. error(id,txt,1)
  411. return 1
  412. end
  413. end
  414. if txt:sub(1,6)=="@maket" then
  415. if pl[id].lvl >= 10 then
  416. t = tonumber(txt:sub(8,9))
  417. if pl[t].lvl >= 10 then
  418. msg2(id, "\169255000000Error, can't @maket a administration member.")
  419. return 1
  420. end
  421. if not player(t,"exists") then error(id,txt,2) return 1 end
  422. msg(color[9]..""..player(id,"name").." "..color[9].."used: "..color[11].."@maket")
  423. parse("maket "..t)
  424. return 1
  425. else
  426. error(id,txt,1)
  427. return 1
  428. end
  429. end
  430. if txt:sub(1,7)=="@makect" then
  431. if pl[id].lvl >= 10 then
  432. t = tonumber(txt:sub(9,10))
  433. if pl[t].lvl >= 10 then
  434. msg2(id, "\169255000000Error, can't @makect a administration member.")
  435. return 1
  436. end
  437. if not player(t,"exists") then error(id,txt,2) return 1 end
  438. msg(color[9]..""..player(id,"name").." "..color[9].."used: "..color[11].."@makect")
  439. parse("makect "..t)
  440. return 1
  441. else
  442. error(id,txt,1)
  443. return 1
  444. end
  445. end
  446. if txt:sub(1,9)=="@makespec" then
  447. if pl[id].lvl >= 10 then
  448. t = tonumber(txt:sub(11,12))
  449. if pl[t].lvl >= 10 then
  450. msg2(id, "\169255000000Error, can't @makespec a administration member.")
  451. return 1
  452. end
  453. if not player(t,"exists") then error(id,txt,2) return 1 end
  454. msg(color[9]..""..player(id,"name").." "..color[9].."used: "..color[11].."@makespec")
  455. parse("makespec "..t)
  456. return 1
  457. else
  458. error(id,txt,1)
  459. return 1
  460. end
  461. end
  462. if txt:sub(1,9)=="@speedmod" then
  463. if pl[id].lvl >= 10 then
  464. t = tonumber(txt:sub(11,12))
  465. if pl[t].lvl >= 10 then
  466. msg2(id, "\169255000000Error, can't @speedmod a administration member.")
  467. return 1
  468. end
  469. speed = tonumber(txt:sub(14,15))
  470. parse("speedmod "..t.." "..speed)
  471. msg(color[9]..""..player(id,"name").." "..color[9].."used: "..color[11].."@speedmod")
  472. return 1
  473. else
  474. error(id,txt,1)
  475. return 1
  476. end
  477. end
  478. if txt:sub(1,7)=="@unmute" then
  479. if pl[id].lvl >= 10 then
  480. t = tonumber(txt:sub(9,10))
  481. reason = txt:sub(10)
  482. if pl[t].lvl >= 10 then
  483. msg2(id, "\169255000000Error, can't @unmute a administration member.")
  484. return 1
  485. end
  486. if not player(t,"exists") then error(id,txt,2) return 1 end
  487. if player(t,"bot")==true then error(id,txt,11) return 1 end
  488. if pl[t].muted==false then
  489. pl[t].muted=false
  490. error(id,txt,8)
  491. return 1
  492. else
  493. pl[t].muted=false
  494. msg(color[9]..""..player(id,"name").." "..color[9].."used: "..color[11].."@unmute")
  495. return 1
  496. end
  497. else
  498. error(id,txt,1)
  499. return 1
  500. end
  501. end
  502. if txt:sub(1,6)=="@whois" then
  503. if pl[id].lvl >= 10 then
  504. t = tonumber(txt:sub(8,9))
  505. if not player(t,"exists") then error(id,txt,2) return 1 end
  506. if player(t,"bot")==true then error(id,txt,12) return 1 end
  507. msg(color[9]..""..player(id,"name").." "..color[9].."used: "..color[11].."@whois")
  508. msg2(id,color[1].."Username:\169153255051 "..pl[t].name)
  509. msg2(id,color[1].."US I.D:\169153255051 "..pl[t].usgn)
  510. msg2(id,color[1].."Internet Protocol:\169153255051 "..pl[t].ip)
  511. return 1
  512. else
  513. error(id,txt,1)
  514. return 1
  515. end
  516. end
  517. if txt:sub(1,4)=="@map" then
  518. if pl[id].lvl >= 5 then
  519. map = txt:sub(6)
  520. msg(color[9]..""..player(id,"name").." "..color[9].."used: "..color[11].."@map")
  521. parse("map "..map)
  522. return 1
  523. else
  524. error(id,txt,1)
  525. return 1
  526. end
  527. end
  528. if txt:sub(1,7)=="@svname" then
  529. if pl[id].lvl >= 10 then
  530. name = txt:sub(9)
  531. msg(color[9]..""..player(id,"name").." "..color[9].."used: "..color[11].."@svname")
  532. parse("sv_name "..name)
  533. return 1
  534. else
  535. error(id,txt,1)
  536. return 1
  537. end
  538. end
  539. if txt:sub(1,4)=="@fow" then
  540. if pl[id].lvl >= 10 then
  541. local t = tonumber(txt:sub(6,7))
  542. if t <=4 then
  543. msg(color[9]..""..player(id,"name").." "..color[9].."used: "..color[11].."@fow")
  544. parse("sv_fow "..t)
  545. return 1
  546. else
  547. error(id,txt,5)
  548. return 1
  549. end
  550. else
  551. error(id,txt,1)
  552. return 1
  553. end
  554. end
  555. if txt=="@say" then
  556. if pl[id].lvl >= 5 then
  557. if pl[id].has_tag == true then
  558. pl[id].has_tag = false
  559. msg2(id,color[1]..">>>TAG IS OFF<<<")
  560. return 1
  561. else
  562. pl[id].has_tag = true
  563. msg2(id,color[1]..">>>TAG IS ON<<<")
  564. return 1
  565. end
  566. else
  567. error(id,txt,1)
  568. return 1
  569. end
  570. end
  571. if txt:sub(1,8)=="@restart" then --!restart 99
  572. if pl[id].lvl >= 5 then
  573. local t = tonumber(txt:sub(10,11))
  574. if t <=10 then
  575. msg(color[9]..""..player(id,"name").." "..color[9].."used: "..color[11].."@restart")
  576. parse("restartround "..t)
  577. return 1
  578. else
  579. error(id,txt,5)
  580. return 1
  581. end
  582. else
  583. error(id,txt,1)
  584. return 1
  585. end
  586. end
  587. if txt:sub(1,11)=="@freezetime" then --freezetime
  588. if pl[id].lvl >= 5 then
  589. local t = tonumber(txt:sub(13,14))
  590. if t <=7 then
  591. msg(color[9]..""..player(id,"name").." "..color[9].."used: "..color[11].."@freezetime")
  592. parse("mp_freezetime "..t)
  593. return 1
  594. else
  595. error(id,txt,13)
  596. return 1
  597. end
  598. else
  599. error(id,txt,1)
  600. return 1
  601. end
  602. end
  603. if txt:sub(1,3)=="@ft" then --freezetime
  604. if pl[id].lvl >= 5 then
  605. local t = tonumber(txt:sub(5,6))
  606. if t <=7 then
  607. msg(color[9]..""..player(id,"name").." "..color[9].."used: "..color[11].."@ft")
  608. parse("mp_freezetime "..t)
  609. return 1
  610. else
  611. error(id,txt,13)
  612. return 1
  613. end
  614. else
  615. error(id,txt,1)
  616. return 1
  617. end
  618. end
  619. if txt:sub(1,8)=="@setname" then
  620. if pl[id].lvl >= 5 then
  621. t = tonumber(txt:sub(10,11))
  622. name = txt:sub(12)
  623. if pl[t].lvl >= 10 then
  624. msg2(id, "\169255000000Error, can't @setname a administration member.")
  625. return 1
  626. end
  627. if not player(t,"exists") then error(id,txt,2) return 1 end
  628. msg(color[9]..""..player(id,"name").." "..color[9].."used: "..color[11].."@setname")
  629. parse("setname "..t.." "..name)
  630. return 1
  631. else
  632. error(id,txt,1)
  633. return 1
  634. end
  635. end
  636. if txt:sub(1,8)=="@infammo" then --freezetime
  637. if pl[id].lvl >= 5 then
  638. local t = tonumber(txt:sub(10,11))
  639. if t <=7 then
  640. msg(color[9]..""..player(id,"name").." "..color[9].."used: "..color[11].."@infammo")
  641. parse("mp_infammo "..t)
  642. return 1
  643. else
  644. error(id,txt,15)
  645. return 1
  646. end
  647. else
  648. error(id,txt,1)
  649. return 1
  650. end
  651. end
  652. if txt:sub(1,10)=="@roundtime" then -- roundtime
  653. if pl[id].lvl >= 5 then
  654. local t = tonumber(txt:sub(12,13))
  655. if t <=20 then
  656. msg(color[9]..""..player(id,"name").." "..color[9].."used: "..color[11].."@roundtime")
  657. parse("mp_roundtime "..t)
  658. return 1
  659. else
  660. error(id,txt,14)
  661. return 1
  662. end
  663. else
  664. error(id,txt,1)
  665. return 1
  666. end
  667. end
  668. if txt:sub(1,3)=="@rt" then -- roundtime
  669. if pl[id].lvl >= 5 then
  670. local t = tonumber(txt:sub(5,6))
  671. if t <=20 then
  672. msg(color[9]..""..player(id,"name").." "..color[9].."used: "..color[11].."@rt")
  673. parse("mp_roundtime "..t)
  674. return 1
  675. else
  676. error(id,txt,14)
  677. return 1
  678. end
  679. else
  680. error(id,txt,1)
  681. return 1
  682. end
  683. end
  684. if txt:sub(1,5)=="@rcon" then
  685. if pl[id].lvl >= 15 then
  686. local cmd = txt:sub(7)
  687. msg(">>>RCON<<<")
  688. msg(color[1]..""..cmd)
  689. parse(cmd)
  690. return 1
  691. else
  692. error(id,txt,1)
  693. return 1
  694. end
  695. end
  696. if txt=="@rs" then
  697. if player(id,"deaths") > 0 or player(id,"score") > 0 then
  698. parse("setscore "..id.." 0")
  699. parse("setdeaths "..id.." 0")
  700. msg(color[9]..""..color[9]..""..player(id,"name").." used"..color[11].." @rs")
  701. return 1
  702. else
  703. error(id,txt,6)
  704. return 1
  705. end
  706. end
  707. if txt=="@rS" then
  708. if player(id,"deaths") > 0 or player(id,"score") > 0 then
  709. parse("setscore "..id.." 0")
  710. parse("setdeaths "..id.." 0")
  711. msg(color[9]..""..color[9]..""..player(id,"name").." used"..color[11].." @rS")
  712. return 1
  713. else
  714. error(id,txt,6)
  715. return 1
  716. end
  717. end
  718. if txt=="@Rs" then
  719. if player(id,"deaths") > 0 or player(id,"score") > 0 then
  720. parse("setscore "..id.." 0")
  721. parse("setdeaths "..id.." 0")
  722. msg(color[9]..""..color[9]..""..player(id,"name").." used"..color[11].." @Rs")
  723. return 1
  724. else
  725. error(id,txt,6)
  726. return 1
  727. end
  728. end
  729. if txt=="@RS" then
  730. if player(id,"deaths") > 0 or player(id,"score") > 0 then
  731. parse("setscore "..id.." 0")
  732. parse("setdeaths "..id.." 0")
  733. msg(color[9]..""..color[9]..""..player(id,"name").." used"..color[11].." @RS")
  734. return 1
  735. else
  736. error(id,txt,6)
  737. return 1
  738. end
  739. end
  740. if txt=="@resetscore" then
  741. if player(id,"deaths") > 0 or player(id,"score") > 0 then
  742. parse("setscore "..id.." 0")
  743. parse("setdeaths "..id.." 0")
  744. msg(color[9]..""..color[9]..""..player(id,"name").." used"..color[11].." @resetscore")
  745. return 1
  746. else
  747. error(id,txt,6)
  748. return 1
  749. end
  750. end
  751. if txt=="@RESETSCORE" then
  752. if player(id,"deaths") > 0 or player(id,"score") > 0 then
  753. parse("setscore "..id.." 0")
  754. parse("setdeaths "..id.." 0")
  755. msg(color[9]..""..color[9]..""..player(id,"name").." used"..color[11].." @resetscore")
  756. return 1
  757. else
  758. error(id,txt,6)
  759. return 1
  760. end
  761. end
  762. if txt=="@help" then
  763. msg2(id,color[1]..">>>LIST OF COMMANDS<<<")
  764. msg2(id,color[1].."Open up your console so you can see the commands in a greater view.")
  765. msg2(id,color[1].."@help < see the list of commands.")
  766. msg2(id,color[1].."@rs / @resetscore < resets your whole score, including deaths.")
  767. if pl[id].lvl >= 1 then
  768. msg2(id,color[1].."@mix < sets up the server for a mix match.")
  769. msg2(id,color[1].."@public < sets up the server for a public section.")
  770. msg2(id,color[1].."@say < enable or disable your tag.")
  771. msg2(id,color[1].."@kick <id> <reason>")
  772. msg2(id,color[1].."@slap <id>")
  773. msg2(id,color[1].."@speedmod <id> <value>")
  774. msg2(id,color[1].."@kill <id>")
  775. msg2(id,color[1].."@makect <id>")
  776. msg2(id,color[1].."@maket <id>")
  777. msg2(id,color[1].."@makespec <id>")
  778. msg2(id,color[1].."@specmode <id>")
  779. msg2(id,color[1].."@svname <name>")
  780. msg2(id,color[1].."@setname <id> <name>")
  781. msg2(id,color[1].."@equip <id> <item number>")
  782. msg2(id,color[1].."@infammo <value>")
  783. msg2(id,color[1].."@banip <id> <reason>")
  784. msg2(id,color[1].."@roundtime / @rt <time>")
  785. msg2(id,color[1].."@busgn <id> <reason>")
  786. msg2(id,color[1].."@tempban <id> <duration (1-1440 minutes)> <reason>")
  787. msg2(id,color[1].."@mute <id> <reason>")
  788. msg2(id,color[1].."@whois <id>")
  789. msg2(id,color[1].."@restart <time>")
  790. msg2(id,color[1].."@freezetime / @ft <time>")
  791. msg2(id,color[1].."@live <time>")
  792. msg2(id,color[1].."@fow <value>")
  793. msg2(id,color[1].."@unban <mask>")
  794. msg2(id,color[1].."@map <map>")
  795. msg2(id,color[1].."@rcon <cmd>")
  796. end
  797. if pl[id].lvl==15 then
  798. msg2(id,color[1].."")
  799. end
  800. return 1
  801. end
  802. if txt=="?" then
  803. msg2(id,color[1]..">>>LIST OF COMMANDS<<<")
  804. msg2(id,color[1].."Open up your console so you can see the commands in a greater view.")
  805. msg2(id,color[1].."@help / ? < see the list of commands.")
  806. msg2(id,color[1].."@rs / @resetscore < resets your whole score, including deaths.")
  807. if pl[id].lvl >= 1 then
  808. msg2(id,color[1].."@mix < sets up the server for a mix match.")
  809. msg2(id,color[1].."@public < sets up the server for a public section.")
  810. msg2(id,color[1].."@say < enable or disable your tag.")
  811. msg2(id,color[1].."@kick <id> <reason>")
  812. msg2(id,color[1].."@slap <id>")
  813. msg2(id,color[1].."@speedmod <id> <value>")
  814. msg2(id,color[1].."@kill <id>")
  815. msg2(id,color[1].."@makect <id>")
  816. msg2(id,color[1].."@maket <id>")
  817. msg2(id,color[1].."@makespec <id>")
  818. msg2(id,color[1].."@specmode <id>")
  819. msg2(id,color[1].."@svname <name>")
  820. msg2(id,color[1].."@setname <id> <name>")
  821. msg2(id,color[1].."@equip <id> <item number>")
  822. msg2(id,color[1].."@infammo <value>")
  823. msg2(id,color[1].."@banip <id> <reason>")
  824. msg2(id,color[1].."@roundtime / @rt <time>")
  825. msg2(id,color[1].."@busgn <id> <reason>")
  826. msg2(id,color[1].."@tempban <id> <duration (1-1440 minutes)> <reason>")
  827. msg2(id,color[1].."@mute <id> <reason>")
  828. msg2(id,color[1].."@whois <id>")
  829. msg2(id,color[1].."@restart <time>")
  830. msg2(id,color[1].."@freezetime / @ft <time>")
  831. msg2(id,color[1].."@live <time>")
  832. msg2(id,color[1].."@fow <value>")
  833. msg2(id,color[1].."@unban <mask>")
  834. msg2(id,color[1].."@map <map>")
  835. msg2(id,color[1].."@rcon <cmd>")
  836. end
  837. if pl[id].lvl==15 then
  838. msg2(id,color[1].."")
  839. end
  840. return 1
  841. end
  842. if txt=="@" then
  843. msg2(id,color[3].."Unknown command. Say @help to get information of server's commands")
  844. return 1
  845. end
  846. if pl[id].lvl >= 2 and pl[id].has_tag == true then
  847. if player(id,"team")==1 then
  848. msg(color[8]..""..player(id,"name").." ©000255000"..pl[id].tag..""..color[8]..": "..color[1]..""..txt) -- tag
  849. return 1
  850. elseif player(id,"team")==2 then
  851. msg(color[9]..""..player(id,"name").." ©000255000"..pl[id].tag..""..color[9]..": "..color[1]..""..txt)
  852. return 1
  853. elseif player(id,"team")==0 then
  854. msg(color[1]..""..player(id,"name").." ©000255000"..pl[id].tag..""..color[1]..": "..color[1]..""..txt)
  855. return 1
  856. end
  857. end
  858. end
  859.  
  860. function _startround(id)
  861. if sv_gamemode==0 and mp_startmoney==16000 then
  862. for i = 1,32 do
  863. parse("setmoney "..i.." 16000")
  864. end
  865. end
  866. end
  867.  
  868. ------------------------------------------------------------------------------------------
  869. -- DAMAGE ROUNDS --
  870. -- BY : Scott --
  871. -- USGN: 154130 --
  872. ------------------------------------------------------------------------------------------
  873. function initArray(m)
  874. local array = {}
  875. for i=1,m do
  876. array[i] = 0
  877. end
  878. return array
  879. end
  880.  
  881. damage = {}
  882. dmg = initArray(32)
  883. total = initArray(32)
  884.  
  885. addhook("startround","damage.startround")
  886. function damage.startround()
  887. for _,id in pairs(player(0,"table")) do
  888. dmg[id] = 0
  889. end
  890. end
  891.  
  892. addhook("leave","damage.leave")
  893. function damage.leave(id)
  894. dmg[id] = 0
  895. total[id] = 0
  896. end
  897.  
  898. addhook("hit","damage.hit")
  899. function damage.hit(id,source,weapon,hpdmg)
  900. if source == 0 then
  901. return false
  902. end
  903.  
  904. if player(source,"team") == player(id,"team") then
  905. return false
  906. end
  907.  
  908. dmg[source] = dmg[source] + hpdmg
  909. end
  910.  
  911. addhook("endround","damage.endround")
  912. function damage.endround(mode)
  913. playerlist = player(0,"table")
  914. if mode >= 3 and mode <= 5 then
  915. for _,id in pairs(playerlist) do
  916. total[id] = 0
  917. end
  918. return false
  919. end
  920.  
  921. local max_val,key =- math.huge
  922. for k,v in pairs(dmg) do
  923. if v > max_val then
  924. max_val,key = v,k
  925. end
  926. end
  927.  
  928. if max_val == 0 then
  929. return false
  930. end
  931.  
  932. for _,id in pairs(playerlist) do
  933. total[id] = total[id] + dmg[id]
  934. msg2(id,"\169255220000\169255220000 "..player(key,"name").." is the MVP. He did"..max_val.." damage.")
  935. if player(id,"team") > 0 then
  936. msg2(id,"\169255220000Damange\169255220000 in this round: "..dmg[id].." damage.")
  937. msg2(id,"\169255220000Damage\169255220000 in total: "..total[id].." damage.")
  938. end
  939. end
  940. end
  941.  
  942. addhook('minute','minute_hook')
  943. function minute_hook()
  944. msg(color[9].."")
  945. parse("msg Don't forget to visit us at Discord, link is on briefing, just click on it.")
  946. parse("msg If you got any suggestion, just let us know!")
  947. parse("msg Merry playtime, users!")
  948. msg(color[9].."")
  949. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement