Advertisement
Guest User

Untitled

a guest
Aug 16th, 2014
281
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 45.98 KB | None | 0 0
  1. ----------------------------------------------------
  2. -- Multigame 2 SE script by mat5b ------------------
  3. -- Thanks to BartNixon for sound design and ideas --
  4. ----------------------------------------------------
  5. mg={}
  6. -- Special Edition for Ax3 -------------------------
  7. -- Server Settings: --------------------------------
  8.  
  9. mg.scram=1 -- Allow team scrambling on the server (1 - on; 0 - off)
  10. mg.winrow=4 -- If a team wins this amount of times in a row, the teams get scrambled
  11. mg.hattrans=0.1 -- Hat transparency during games (0.0 min. - 1.0 max.)
  12. mg.idletime=60 -- Max time (in seconds) of choosing a game
  13. mg.specialcap=3 -- Amount of rounds between being able to choose *special* games
  14. mg.specialchat=1 -- Allow the rcon admins and the map makers to be recognised on the server (1 - on; 0 - off)
  15. mg.removepowerups=1 -- Remove powerups from the floor after running over them while already carrying one
  16. mg.endsounds=1 -- Play and display a random message every time the round ends (1 - on; 0 - off)
  17. mg.endmusic=1 -- Play music at the end of rounds (1 - on; 0 - off)
  18. mg.prices={30,20,35,40,50,25,15,45} -- Adjust prices of the hats (in order as they appear on the menu)
  19. mg.rconcommands=0 -- Allow for rcon console commands for rcon admins (mg_next <ID> - sets the next player) (1 - on; 0 - off)
  20.  
  21. -- End of Settings ---------------------------------
  22.  
  23. parse('sv_gamemode 0') -- Required
  24. parse('mp_antispeeder 0')
  25. parse('mp_radar 0')
  26. parse('sv_fow 0')
  27. if mg.scram==1 then
  28. parse("mp_autoteambalance 1")
  29. end
  30. parse('mp_supply_items "30,32,51,52,53,46,47,48"')
  31. function array(d,s)
  32. local t={}
  33. for i=1,d do
  34. t[i]=s
  35. end
  36. return t
  37. end
  38. function getplayers()
  39. local s={}
  40. for id=1,32 do
  41. if player(id,"exists") and player(id,"team")~=0 and not player(id,"bot") then
  42. table.insert(s,id)
  43. end
  44. end
  45. return s
  46. end
  47. function getallplayers()
  48. local s={}
  49. for id=1,32 do
  50. if player(id,"exists") and player(id,"team")~=0 and player(id,"health")>0 then
  51. table.insert(s,id)
  52. end
  53. end
  54. return s
  55. end
  56. function checkbots()
  57. local s={}
  58. for id=1,32 do
  59. if player(id,"exists") and player(id,"team")~=0 and player(id,"bot") then
  60. table.insert(s,id)
  61. end
  62. end
  63. return #s
  64. end
  65. function tp(id,d,s)
  66. local x=d*32+16
  67. local y=s*32+16
  68. parse("setpos "..id.." "..x.." "..y)
  69. end
  70. function searcht(t,p)
  71. local d=0
  72. for i=1,#t do
  73. if t[i]==p then
  74. d=i
  75. break
  76. end
  77. end
  78. return d
  79. end
  80. function mg.info(game,a)
  81. msg("©255255255"..player(mg.player,"name").." chose "..game.."! Prepare "..a.."!")
  82. end
  83. function mg.gamestuff(h1,n,d)
  84. mg.info(n,d)
  85. if mg.selgame==22 then
  86. mg.gametimer=2
  87. else
  88. mg.gametimer=5
  89. end
  90. mg.plch=0
  91. addhook("second",h1)
  92. for id=1,32 do
  93. if mg.hatimg[id]~=0 then
  94. tween_alpha(mg.hatimg[id],5000,mg.hattrans)
  95. end
  96. end
  97. end
  98. function mg.tablecheck(id)
  99. if mg.hatdel[id]~=0 or mg.score[id]~=0 or mg.player==id or mg.next==id or mg.hatimg[id]~=0 or mg.powerup[id]~=0 or mg.last==id or mg.hat[id]~=0 or mg.powerupimg[id]~=0 or mg.hatimg[id]~=0 then
  100. return 1
  101. end
  102. return 0
  103. end
  104.  
  105. math.randomseed(os.time())
  106. mg.hatdel=array(32,0)
  107. mg.score=array(32,0)
  108. mg.hat=array(32,0)
  109. mg.hatimg=array(32,0)
  110. mg.powerup=array(32,0)
  111. mg.powerupimg=array(32,0)
  112. mg.player=0
  113. mg.last=0
  114. mg.game=0
  115. mg.gametimer=0
  116. mg.plch=2
  117. mg.teams={"T","CT","VIP"}
  118. mg.list={"dualbombs","escort","pointtick","meleemadness","explosionwar","flagging","bunker","terraingain","shields","flamewar","starchase","darkroom","explosives","pistolpower","riflerampage","snipershotdown","nadespam","shotgunshuffle","campersparadise","winterwarfare","gungroup","footrace"}
  119. mg.powerups={65,77,45,64,69}
  120. mg.selgame=0
  121. mg.next=0
  122. mg.winrow_t=0
  123. mg.winrow_ct=0
  124. mg.scrambling=0
  125. mg.star=0
  126. mg.starman=0
  127. mg.cap=0
  128. mg.idletimer=mg.idletime
  129. mg.breakablesx={21,22,22,23,23,23,24,24,24,25,25,25,26,26,26,27,27,28}
  130. mg.breakablesy={38,37,38,36,37,38,36,37,38,36,37,38,36,37,38,37,38,38}
  131. mg.palette={}
  132. mg.rx=0
  133. mg.ry=0
  134. function rcol()
  135. local r,g,b
  136. for i=1,100 do
  137. r=math.random(100,255)
  138. g=math.random(100,255)
  139. b=math.random(100,255)
  140. mg.palette[i] = "©"..r..""..g..""..b..""
  141. end
  142. end
  143. rcol()
  144.  
  145. function sv_sound3(snd,x,y)
  146. for id=1,32 do
  147. if player(id,"exists") then
  148. if x>=player(id,"x")-300 and x<=player(id,"x")+300 and y>=player(id,"y")-300 and y<=player(id,"y")+300 then
  149. parse("sv_sound2 "..id.." \""..snd.."")
  150. end
  151. end
  152. end
  153. end
  154.  
  155. addhook("hit","mg.hit")
  156. function mg.hit(id,s,w,h,a)
  157. if mg.game==0 then
  158. return 1
  159. end
  160. if mg.starman==id then
  161. return 1
  162. end
  163. if mg.selgame==22 and w==77 then
  164. local x=player(id,"tilex")
  165. local y=player(id,"tiley")
  166. if tile(x-2,y,"walkable") then
  167. parse("setpos "..id.." "..((player(id,"tilex")-2)*32+16).." "..player(id,"y"))
  168. else
  169. if tile(x,y-2,"walkable") then
  170. parse("setpos "..id.." "..(player(id,"x")).." "..((player(id,"tiley")-2)*32+16))
  171. else
  172. parse("speedmod "..id.." -20")
  173. timer(750,"parse","speedmod "..id.." 10")
  174. end
  175. end
  176. elseif mg.selgame==22 and w==45 then
  177. parse("strip "..s.." 45")
  178. parse("speedmod "..id.." -20")
  179. timer(750,"parse","speedmod "..id.." 10")
  180. elseif mg.selgame==22 and w==69 then
  181. parse("strip "..s.." 69")
  182. local px=player(id,"x")
  183. local py=player(id,"y")
  184. local sx=player(s,"x")
  185. local sy=player(s,"y")
  186. parse("setpos "..id.." "..sx.." "..sy.."")
  187. parse("setpos "..s.." "..px.." "..py.."")
  188. end
  189. if mg.selgame==22 then
  190. return 1
  191. end
  192. end
  193.  
  194. addhook("startround","mg.startround")
  195. function mg.startround()
  196. mg.gametimer=0
  197. mg.plch=2
  198. mg.game=0
  199. mg.player=0
  200. mg.idletimer=mg.idletime
  201. if mg.cap>0 then
  202. mg.cap=mg.cap-1
  203. end
  204. if game("sv_gamemode")~=0 then
  205. parse("sv_gamemode 0")
  206. end
  207. local p=getplayers() --without bots
  208. local b=getallplayers() --with them
  209. local c=p
  210. if p==b or #b<=1 then
  211. msg("©255255255Not enough players to begin!")
  212. else
  213. if checkbots()~=0 and #p<1 then
  214. msg("©255255255Not enough players to begin!")
  215. else
  216. if mg.next==0 then
  217. mg.player=p[math.random(1,#p)]
  218. if mg.last==0 then
  219. mg.last=mg.player
  220. else
  221. if #p==1 then
  222. mg.player=mg.last
  223. else
  224. mg.pos=searcht(p,mg.last)
  225. table.remove(p,mg.pos)
  226. mg.player=p[math.random(1,#p)]
  227. mg.last=mg.player
  228. end
  229. end
  230. if #c==1 then
  231. mg.next=mg.player
  232. else
  233. mg.pos=searcht(c,mg.player)
  234. table.remove(c,mg.pos)
  235. mg.next=c[math.random(1,#c)]
  236. end
  237. else
  238. mg.player=mg.next
  239. if #p==1 then
  240. mg.next=mg.player
  241. else
  242. mg.pos=searcht(c,mg.player)
  243. table.remove(c,mg.pos)
  244. if #c==0 then
  245. mg.next=mg.player
  246. else
  247. mg.next=c[math.random(1,#c)]
  248. end
  249. end
  250. end
  251. tp(mg.player,100,100)
  252. parse("sv_sound2 "..mg.player.." \"mat5b/gman_choose"..math.random(1,2)..".wav\"")
  253. msg("©255255255"..player(mg.player,"name").." ("..mg.teams[player(mg.player,"team")]..") can choose the game! (Next up: "..player(mg.next,"name").."!)")
  254. end
  255. end
  256. for i=1,#player(0,"table") do
  257. parse("speedmod "..player(0,"table")[i].." 0")
  258. parse("setarmor "..player(0,"table")[i].." 0")
  259. if mg.hat[player(0,"table")[i]]~=0 then
  260. if mg.hat[player(0,"table")[i]]~=1 and mg.hat[player(0,"table")[i]]~=2 and mg.hat[player(0,"table")[i]]~=7 then
  261. mg.hatimg[player(0,"table")[i]]=image("gfx/mat5b/hat_"..mg.hat[player(0,"table")[i]]..".png",1,0,200+player(0,"table")[i])
  262. else
  263. mg.hatimg[player(0,"table")[i]]=image("gfx/mat5b/hat_"..mg.hat[player(0,"table")[i]].."_r.png",1,0,200+player(0,"table")[i])
  264. end
  265. imagealpha(mg.hatimg[player(0,"table")[i]],1.0)
  266. end
  267. end
  268. end
  269.  
  270. addhook("endround","mg.endround")
  271. function mg.endround(m)
  272. freetimer()
  273. mg.game=0
  274. mg.plch=2
  275. mg.rx=0
  276. mg.ry=0
  277. if mg.selgame==11 and mg.starman~=0 then
  278. mg.star=0
  279. mg.starman=0
  280. freehook("move","mg.move")
  281. parse("trigger star1")
  282. if ring1~=0 then
  283. freeimage(ring1)
  284. ring1=0
  285. end
  286. if ring2~=0 then
  287. freeimage(ring2)
  288. ring2=0
  289. end
  290. if ring3~=0 then
  291. freeimage(ring3)
  292. ring3=0
  293. end
  294. if bigskin~=0 then
  295. freeimage(bigskin)
  296. bigskin=0
  297. end
  298. end
  299. if mg.selgame==22 then
  300. if mg.counter~=0 then
  301. freeimage(mg.counter)
  302. end
  303. mg.counter=0
  304. for id=1,32 do
  305. if mg.powerupimg[id]~=0 then
  306. freeimage(mg.powerupimg[id])
  307. end
  308. mg.powerupimg[id]=0
  309. mg.powerup[id]=0
  310. end
  311. freeimage(mg.pocketimg)
  312. mg.pocketimg=0
  313. parse("trigger racemusic")
  314. freehook("ms100","mg.racetrans")
  315. end
  316. if mg.selgame~=0 then
  317. freehook("second","mg."..mg.list[mg.selgame].."")
  318. end
  319. if mg.endsounds==1 then
  320. local r=math.random(1,5)
  321. if r==1 then
  322. msg("©255255255GET MAD!")
  323. parse("sv_sound \"mat5b/get_mad.ogg\"")
  324. elseif r==2 then
  325. msg("©255255255AMAZING!")
  326. parse("sv_sound \"mat5b/amazing.ogg\"")
  327. elseif r==3 then
  328. msg("©255255255HASTA LA VISTA, BABY!")
  329. parse("sv_sound \"mat5b/hasta.ogg\"")
  330. elseif r==4 then
  331. msg("©255255255DO A BARREL ROLL!")
  332. parse("sv_sound \"mat5b/barrel.ogg\"")
  333. elseif r==5 then
  334. msg("©255255255SPAAAAAAAAACE!")
  335. parse("sv_sound \"mat5b/space.ogg\"")
  336. end
  337. end
  338. if mg.endmusic==1 then
  339. parse("sv_sound \"mat5b/end_"..math.random(1,10)..".ogg\"")
  340. end
  341. for i=1,#player(0,"table") do
  342. parse("speedmod "..player(0,"table")[i].." 0")
  343. parse("setarmor "..player(0,"table")[i].." 0")
  344. if mg.hatimg[player(0,"table")[i]]~=0 then
  345. tween_alpha(mg.hatimg[player(0,"table")[i]],1000,1)
  346. end
  347. end
  348. for id=1,32 do
  349. if not player(id,"exists") and mg.tablecheck(id)==1 then
  350. mg.leave(id)
  351. end
  352. end
  353. mg.selgame=0
  354. if mg.scram==1 then
  355. if m==1 or m==20 or m==40 or m==30 or m==50 then
  356. mg.winrow_t=mg.winrow_t+1
  357. mg.winrow_ct=0
  358. if mg.winrow_t==mg.winrow then
  359. local r=math.random(1,3)
  360. if r==1 then
  361. msg("©255255255Let's even this out. TEAM SCRAMBLE! (death by scramble not counted towards ranking)")
  362. parse("sv_sound \"mat5b/scramble1.ogg\"")
  363. elseif r==2 then
  364. msg("©255255255Commence TEAM SCRAMBLE, NOW! (death by scramble not counted towards ranking)")
  365. parse("sv_sound \"mat5b/scramble2.ogg\"")
  366. elseif r==3 then
  367. msg("©255255255TEAMS are being SCRAMBLED! (death by scramble not counted towards ranking)")
  368. parse("sv_sound \"mat5b/scramble3.ogg\"")
  369. end
  370. mg.winrow_t=0
  371. mg.scrambling=1
  372. mg.scramble()
  373. end
  374. elseif m==2 or m==21 or m==41 or m==31 or m==51 then
  375. mg.winrow_ct=mg.winrow_ct+1
  376. mg.winrow_t=0
  377. if mg.winrow_ct==mg.winrow then
  378. local r=math.random(1,3)
  379. if r==1 then
  380. msg("©255255255Let's even this out. TEAM SCRAMBLE! (death by scramble not counted towards ranking)")
  381. parse("sv_sound \"mat5b/scramble1.ogg\"")
  382. elseif r==2 then -- Excellent job figuring the last clue out.
  383. msg("©255255255Commence TEAM SCRAMBLE, NOW! (death by scramble not counted towards ranking)") -- How's it going? Found all the clues so far?
  384. parse("sv_sound \"mat5b/scramble2.ogg\"") -- The puzzle pieces are almost all at their place.
  385. elseif r==3 then -- There's two of them missing though.
  386. msg("©255255255TEAMS are being SCRAMBLED! (death by scramble not counted towards ranking)") -- Here they are:
  387. parse("sv_sound \"mat5b/scramble3.ogg\"") -- First one: http://www.youtube.com/watch?v=Ic2Zh2HmBJ8
  388. end -- Second one: Find it outside of The Safe (-100;-20) (X) <-10;30> (Y)
  389. mg.winrow_ct=0 -- Good luck!
  390. mg.scrambling=1 -- Signed - Hate Same Egg
  391. mg.scramble()
  392. end
  393. end
  394. end
  395. end
  396.  
  397. function mg.scramble()
  398. local d=0
  399. for id=1,#player(0,"table") do
  400. if player(player(0,"table")[id],"exists") and player(player(0,"table")[id],"team")>0 then
  401. if player(player(0,"table")[id],"health")>0 then
  402. d=1
  403. end
  404. if math.random(1,2)==1 then
  405. timer(math.random(100,1000),"parse","maket "..player(0,"table")[id].."")
  406. else
  407. timer(math.random(100,1000),"parse","makect "..player(0,"table")[id].."")
  408. end
  409. if d==1 then
  410. parse("setdeaths "..player(0,"table")[id].." "..player(player(0,"table")[id],"deaths")-1)
  411. d=0
  412. end
  413. end
  414. end
  415. end
  416.  
  417. addhook("use","mg.use")
  418. function mg.use(id,e)
  419. if mg.hatdel[id]==0 and e==0 and mg.hat[id]~=0 and mg.selgame~=22 then
  420. if mg.hat[id]~=1 and mg.hat[id]~=2 and mg.hat[id]~=7 then
  421. sv_sound3("mat5b/hat_"..mg.hat[id]..".ogg\"",player(id,"x"),player(id,"y"))
  422. else
  423. sv_sound3("mat5b/hat_"..mg.hat[id].."_r.ogg\"",player(id,"x"),player(id,"y"))
  424. end
  425. mg.hatdel[id]=5
  426. end
  427. if mg.selgame==22 and mg.powerup[id]~=0 then
  428. if mg.powerup[id]==65 then
  429. parse("speedmod "..id.." 20")
  430. sv_sound3("mat5b/powerup1.ogg",player(id,"x"),player(id,"y"))
  431. parse('effect "flare" '..player(id,"x")..' '..player(id,"y")..' 1 1 0 '..math.random(0,255)..' 0')
  432. timer(1000,"parse","speedmod "..id.." 10")
  433. elseif mg.powerup[id]==77 then
  434. parse("equip "..id.." 77")
  435. parse('effect "flare" '..player(id,"x")..' '..player(id,"y")..' 1 3 0 0 '..math.random(0,255)..'')
  436. parse("setweapon "..id.." 77")
  437. elseif mg.powerup[id]==45 then
  438. parse("equip "..id.." 45")
  439. parse('effect "flare" '..player(id,"x")..' '..player(id,"y")..' 1 3 '..math.random(0,255)..' 0 0')
  440. parse("setweapon "..id.." 45")
  441. elseif mg.powerup[id]==64 then
  442. parse("speedmod "..id.." 30")
  443. sv_sound3("mat5b/powerup2.ogg",player(id,"x"),player(id,"y"))
  444. parse('effect "flare" '..player(id,"x")..' '..player(id,"y")..' 1 1 0 '..math.random(125,255)..' 0')
  445. timer(1500,"parse","speedmod "..id.." 10")
  446. elseif mg.powerup[id]==69 then
  447. parse("equip "..id.." 69")
  448. parse('effect "flare" '..player(id,"x")..' '..player(id,"y")..' 1 3 '..math.random(125,255)..' '..math.random(125,255)..' 0')
  449. parse("setweapon "..id.." 69")
  450. end
  451. mg.powerup[id]=0
  452. freeimage(mg.powerupimg[id])
  453. mg.powerupimg[id]=0
  454. end
  455. end
  456.  
  457. addhook("movetile","mg.movetile")
  458. function mg.movetile(id,x,y)
  459. if id==mg.player then
  460. if x==96 and y==80 then
  461. mg.gamestuff("mg.dualbombs","DUAL BOMBS","for explosive action")
  462. mg.selgame=1
  463. elseif x==99 and y==80 then
  464. mg.gamestuff("mg.escort","HOSTAGE ESCORTING","to run like hell")
  465. mg.selgame=2
  466. elseif x==96 and y==82 then
  467. mg.gamestuff("mg.pointtick","CORNER CATASTROPHY","for a lot of BS shots")
  468. mg.selgame=3
  469. elseif x==101 and y==80 then
  470. mg.gamestuff("mg.meleemadness","MELEE MADNESS","for a battle of sticks")
  471. mg.selgame=4
  472. elseif x==104 and y==80 then
  473. mg.gamestuff("mg.explosionwar","EXPLOSION WAR","for quick thinking")
  474. mg.selgame=5
  475. elseif x==104 and y==82 then
  476. mg.gamestuff("mg.flagging","FLAGGING","for tactical planning")
  477. mg.selgame=6
  478. elseif x==104 and y==84 then
  479. mg.gamestuff("mg.bunker","BUNKER TIME","for tactical engineering! Protip: Build supplies")
  480. mg.selgame=7
  481. elseif x==96 and y==84 then
  482. mg.gamestuff("mg.terraingain","TERRAIN GAIN","to capture points")
  483. mg.selgame=8
  484. elseif x==102 and y==84 then
  485. mg.gamestuff("mg.shields","SHIELDS AND SWORDS","your hack'n'slash skills")
  486. mg.selgame=9
  487. elseif x==98 and y==84 then
  488. mg.gamestuff("mg.flamewar","FLAME WAR","for lots of heat")
  489. mg.selgame=10
  490. elseif x==100 and y==78 then
  491. mg.gamestuff("mg.starchase","STARMAN CHASE","to get stomped on")
  492. mg.selgame=11
  493. mg.cap=mg.specialcap+1
  494. elseif x==100 and y==79 then
  495. if mg.cap>0 then
  496. msg2(mg.player,"©255255255Sorry, but you need to wait "..mg.cap.." more round(s) before choosing this kind of game.")
  497. tp(mg.player,100,80)
  498. end
  499. elseif x==61 and y==18 then
  500. mg.gamestuff("mg.darkroom","DARK ROOM","for some blind shooting")
  501. mg.selgame=12
  502. elseif x==61 and y==22 then
  503. mg.gamestuff("mg.explosives","EXPLOSIVES EVERYWHERE","to get blown up")
  504. mg.selgame=13
  505. elseif x==61 and y==24 then
  506. mg.gamestuff("mg.pistolpower","PISTOL POWER","for quick action")
  507. mg.selgame=14
  508. elseif x==61 and y==16 then
  509. mg.gamestuff("mg.riflerampage","RIFLE RAMPAGE","for your classic CS2D action")
  510. mg.selgame=15
  511. elseif x==63 and y==16 then
  512. mg.gamestuff("mg.snipershotdown","SNIPER SHOT DOWN","for quickscoping action")
  513. mg.selgame=16
  514. elseif x==65 and y==16 then
  515. mg.gamestuff("mg.nadespam","GRENADE SPAM","to spam grenades (duh)")
  516. mg.selgame=17
  517. elseif x==65 and y==18 then
  518. mg.gamestuff("mg.shotgunshuffle","SHOTGUN SHUFFLE","for close quarters fighting")
  519. mg.selgame=18
  520. elseif x==65 and y==22 then
  521. mg.gamestuff("mg.campersparadise","CAMPER'S PARADISE","for long range shenanigans")
  522. mg.selgame=19
  523. elseif x==65 and y==24 then
  524. mg.gamestuff("mg.winterwarfare","WINTER WARFARE","to fight using puny snowballs")
  525. mg.selgame=20
  526. elseif x==63 and y==24 then
  527. mg.gamestuff("mg.gungroup","GUN GROUP","for a wise gun choice")
  528. mg.selgame=21
  529. elseif x==59 and y==20 then
  530. mg.selgame=22
  531. mg.gamestuff("mg.footrace","FOOT RACE","to run a lot")
  532. mg.cap=mg.specialcap+1
  533. elseif x==60 and y==20 then
  534. if mg.cap>0 then
  535. msg2(mg.player,"©255255255Sorry, but you need to wait "..mg.cap.." more round(s) before choosing this kind of game.")
  536. tp(mg.player,62,20)
  537. end
  538. end
  539. end
  540. if mg.selgame==11 then
  541. if x==36 and y==158 and mg.star==1 then
  542. mg.star=0
  543. mg.starman=id
  544. local all=player(0,"tableliving")
  545. for i=1,#all do
  546. parse("speedmod "..all[i].." -100")
  547. end
  548. ring1=image("gfx/mat5b/wave.png",player(mg.starman,"x"),player(mg.starman,"y"),0)
  549. imagescale(ring1,0.1,0.1)
  550. tween_scale(ring1,2000,60,60)
  551. timer(1000,"mg.freeride","d")
  552. timer(2000,"mg.freeride","e")
  553. timer(5000,"mg.freeride","f")
  554. timer(2700,"mg.freeride","mini")
  555. timer(4700,"mg.freeride","minitwo")
  556. timer(7000,"mg.freeride","g")
  557. timer(7950,"mg.freeride","h")
  558. end
  559. end
  560. if mg.selgame==22 then
  561. if x==231 and player(id,"health")>0 then
  562. if player(id,"team")==1 then
  563. parse("trigger twin")
  564. else
  565. parse("trigger ctwin")
  566. end
  567. msg("©255255255"..player(id,"name").." has won the race for the "..mg.teams[player(id,"team")].."s!")
  568. end
  569. end
  570. end
  571.  
  572. function mg.move(id,x,y)
  573. if id==mg.starman then
  574. local team={}
  575. local selfteam={}
  576. if player(id,"team")==1 then
  577. team=player(0,"team2living")
  578. selfteam=player(0,"team1living")
  579. else
  580. team=player(0,"team1living")
  581. selfteam=player(0,"team2living")
  582. end
  583. for i=1,#team do
  584. if x>=player(team[i],"x")-64 and x<=player(team[i],"x")+64 and y>=player(team[i],"y")-64 and y<=player(team[i],"y")+64 then
  585. parse("customkill "..mg.starman.." STOMPED_ON "..team[i].."")
  586. end
  587. if math.random(1,2)==1 then
  588. parse("shake "..team[i].." "..math.random(1,5).."")
  589. end
  590. if #team<=2 or #selfteam<2 then
  591. parse("speedmod "..team[i].." -15")
  592. elseif #team==0 then
  593. parse("speedmod "..player(0,"table")[i].." 0")
  594. end
  595. end
  596. end
  597. end
  598.  
  599. function mg.dualbombs()
  600. if mg.gametimer<=0 then
  601. local t=player(0,"team1living")
  602. local ct=player(0,"team2living")
  603. freehook("second","mg.dualbombs")
  604. mg.game=1
  605. parse("spawnitem 55 100 48")
  606. for i=1,#t do
  607. tp(t[i],math.random(99,104),53)
  608. parse("equip "..t[i].." 30")
  609. parse("setweapon "..t[i].." 30")
  610. end
  611. for i=1,#ct do
  612. tp(ct[i],math.random(99,104),28)
  613. parse("equip "..ct[i].." 32")
  614. parse("setweapon "..ct[i].." 32")
  615. end
  616. end
  617. end
  618. function mg.escort()
  619. if mg.gametimer<=0 then
  620. local t=player(0,"team1living")
  621. local ct=player(0,"team2living")
  622. freehook("second","mg.escort")
  623. mg.game=1
  624. for i=1,#t do
  625. tp(t[i],math.random(158,160),math.random(24,26))
  626. parse("equip "..t[i].." 22")
  627. parse("setweapon "..t[i].." 22")
  628. end
  629. for i=1,#ct do
  630. tp(ct[i],math.random(157,161),51)
  631. parse("equip "..ct[i].." 22")
  632. parse("setweapon "..ct[i].." 22")
  633. end
  634. end
  635. end
  636. function mg.pointtick()
  637. if mg.gametimer<=0 then
  638. local t=player(0,"team1living")
  639. local ct=player(0,"team2living")
  640. freehook("second","mg.pointtick")
  641. mg.game=1
  642. for i=1,#t do
  643. tp(t[i],math.random(154,156),math.random(76,78))
  644. parse("equip "..t[i].." 34")
  645. parse("setweapon "..t[i].." 34")
  646. end
  647. for i=1,#ct do
  648. tp(ct[i],math.random(162,164),math.random(84,86))
  649. parse("equip "..ct[i].." 34")
  650. parse("setweapon "..ct[i].." 34")
  651. end
  652. end
  653. end
  654. function mg.meleemadness()
  655. if mg.gametimer<=0 then
  656. local t=player(0,"tableliving")
  657. freehook("second","mg.meleemadness")
  658. mg.game=1
  659. for i=1,#t do
  660. tp(t[i],math.random(63,74),math.random(68,80))
  661. parse("equip "..t[i].." 78")
  662. parse("equip "..t[i].." 85")
  663. parse("setweapon "..t[i].." 78")
  664. end
  665. end
  666. end
  667. function mg.explosionwar()
  668. if mg.gametimer<=0 then
  669. local t=player(0,"team1living")
  670. local ct=player(0,"team2living")
  671. freehook("second","mg.explosionwar")
  672. mg.game=1
  673. for i=1,#t do
  674. tp(t[i],math.random(159,162),106)
  675. parse("equip "..t[i].." 49")
  676. parse("setweapon "..t[i].." 49")
  677. end
  678. for i=1,#ct do
  679. tp(ct[i],math.random(159,162),118)
  680. parse("equip "..ct[i].." 49")
  681. parse("setweapon "..ct[i].." 49")
  682. end
  683. end
  684. end
  685. function mg.flagging()
  686. if mg.gametimer<=0 then
  687. local t=player(0,"team1living")
  688. local ct=player(0,"team2living")
  689. freehook("second","mg.flagging")
  690. mg.game=1
  691. for i=1,#t do
  692. tp(t[i],math.random(29,33),81)
  693. parse("equip "..t[i].." 30")
  694. parse("setweapon "..t[i].." 30")
  695. end
  696. for i=1,#ct do
  697. tp(ct[i],math.random(29,33),65)
  698. parse("equip "..ct[i].." 32")
  699. parse("setweapon "..ct[i].." 32")
  700. end
  701. end
  702. end
  703. function mg.bunker()
  704. if mg.gametimer<=0 then
  705. local t=player(0,"team1living")
  706. local ct=player(0,"team2living")
  707. freehook("second","mg.bunker")
  708. mg.game=1
  709. for i=1,#t do
  710. tp(t[i],math.random(127,138),66)
  711. parse("equip "..t[i].." 74")
  712. parse("setweapon "..t[i].." 74")
  713. parse("setarmor "..t[i].." 201")
  714. end
  715. for i=1,#ct do
  716. tp(ct[i],math.random(127,138),90)
  717. parse("equip "..ct[i].." 74")
  718. parse("setweapon "..ct[i].." 74")
  719. parse("setarmor "..ct[i].." 201")
  720. end
  721. end
  722. end
  723. function mg.terraingain()
  724. if mg.gametimer<=0 then
  725. local t=player(0,"team1living")
  726. local ct=player(0,"team2living")
  727. freehook("second","mg.terraingain")
  728. mg.game=1
  729. for i=1,#t do
  730. tp(t[i],math.random(31,32),math.random(103,108))
  731. end
  732. for i=1,#ct do
  733. tp(ct[i],math.random(31,32),math.random(122,127))
  734. end
  735. end
  736. end
  737. function mg.shields()
  738. if mg.gametimer<=0 then
  739. local t=player(0,"tableliving")
  740. freehook("second","mg.shields")
  741. mg.game=1
  742. for i=1,#t do
  743. tp(t[i],math.random(124,135),math.random(118,129))
  744. parse("equip "..t[i].." 69")
  745. parse("equip "..t[i].." 41")
  746. parse("setweapon "..t[i].." 41")
  747. parse("strip "..t[i].." 50")
  748. end
  749. end
  750. end
  751. function mg.flamewar()
  752. if mg.gametimer<=0 then
  753. local t=player(0,"team1living")
  754. local ct=player(0,"team2living")
  755. freehook("second","mg.flamewar")
  756. mg.game=1
  757. for i=1,#t do
  758. tp(t[i],math.random(86,87),math.random(126,127))
  759. parse("equip "..t[i].." 46")
  760. parse("setweapon "..t[i].." 46")
  761. end
  762. for i=1,#ct do
  763. tp(ct[i],math.random(98,99),math.random(138,139))
  764. parse("equip "..ct[i].." 46")
  765. parse("setweapon "..ct[i].." 46")
  766. end
  767. end
  768. end
  769. function mg.starchase()
  770. if mg.gametimer<=0 then
  771. local t=player(0,"team1living")
  772. local ct=player(0,"team2living")
  773. freehook("second","mg.starchase")
  774. mg.game=1
  775. mg.star=1
  776. if math.random(1,2)==1 then
  777. for i=1,#t do
  778. tp(t[i],22,math.random(147,169))
  779. end
  780. for i=1,#ct do
  781. tp(ct[i],50,math.random(147,169))
  782. end
  783. else
  784. for i=1,#t do
  785. tp(t[i],50,math.random(147,169))
  786. end
  787. for i=1,#ct do
  788. tp(ct[i],22,math.random(147,169))
  789. end
  790. end
  791. end
  792. end
  793. function mg.darkroom()
  794. if mg.gametimer<=0 then
  795. local t=player(0,"team1living")
  796. local ct=player(0,"team2living")
  797. freehook("second","mg.darkroom")
  798. mg.game=1
  799. local r=math.random(1,5)
  800. local w=10
  801. if r==1 then
  802. w=math.random(10,11)
  803. elseif r==2 then
  804. w=math.random(20,24)
  805. elseif r==3 then
  806. w=30
  807. elseif r==5 then
  808. w=32
  809. elseif r==4 then
  810. w=math.random(38,40)
  811. end
  812. if math.random(1,2)==1 then
  813. for i=1,#t do
  814. tp(t[i],math.random(164,170),math.random(144,161))
  815. parse("equip "..t[i].." "..w.."")
  816. parse("setweapon "..t[i].." "..w.."")
  817. end
  818. for i=1,#ct do
  819. tp(ct[i],math.random(175,181),math.random(144,161))
  820. parse("equip "..ct[i].." "..w.."")
  821. parse("setweapon "..ct[i].." "..w.."")
  822. end
  823. else
  824. for i=1,#t do
  825. tp(t[i],math.random(175,181),math.random(144,161))
  826. parse("equip "..t[i].." "..w.."")
  827. parse("setweapon "..t[i].." "..w.."")
  828. end
  829. for i=1,#ct do
  830. tp(ct[i],math.random(164,170),math.random(144,161))
  831. parse("equip "..ct[i].." "..w.."")
  832. parse("setweapon "..ct[i].." "..w.."")
  833. end
  834. end
  835. end
  836. end
  837. function mg.explosives()
  838. if mg.gametimer<=0 then
  839. local t=player(0,"tableliving")
  840. freehook("second","mg.explosives")
  841. mg.game=1
  842. for i=1,#t do
  843. tp(t[i],math.random(129,134),math.random(155,160))
  844. end
  845. end
  846. end
  847. function mg.pistolpower()
  848. if mg.gametimer<=0 then
  849. local t=player(0,"team1living")
  850. local ct=player(0,"team2living")
  851. freehook("second","mg.pistolpower")
  852. mg.game=1
  853. for i=1,#t do
  854. tp(t[i],math.random(72,73),math.random(160,161))
  855. parse("equip "..t[i].." 2")
  856. parse("setweapon "..t[i].." 2")
  857. end
  858. for i=1,#ct do
  859. tp(ct[i],math.random(93,94),math.random(160,161))
  860. parse("equip "..ct[i].." 1")
  861. parse("setweapon "..ct[i].." 1")
  862. end
  863. end
  864. end
  865. function mg.riflerampage()
  866. if mg.gametimer<=0 then
  867. local t=player(0,"team1living")
  868. local ct=player(0,"team2living")
  869. freehook("second","mg.riflerampage")
  870. mg.game=1
  871. for i=1,#t do
  872. parse("equip "..t[i].." 30")
  873. parse("setweapon "..t[i].." 30")
  874. tp(t[i],math.random(192,194),math.random(25,27))
  875. end
  876. for i=1,#ct do
  877. parse("equip "..ct[i].." 32")
  878. parse("setweapon "..ct[i].." 32")
  879. tp(ct[i],math.random(215,217),math.random(44,46))
  880. end
  881. end
  882. end
  883. function mg.snipershotdown()
  884. if mg.gametimer<=0 then
  885. local t=player(0,"team1living")
  886. local ct=player(0,"team2living")
  887. freehook("second","mg.snipershotdown")
  888. mg.game=1
  889. if math.random(1,2)==1 then
  890. for i=1,#t do
  891. tp(t[i],math.random(195,200),math.random(63,65))
  892. parse("equip "..t[i].." 34")
  893. parse("equip "..t[i].." 35")
  894. parse("setweapon "..t[i].." 35")
  895. end
  896. for i=1,#ct do
  897. tp(ct[i],math.random(208,213),math.random(84,86))
  898. parse("equip "..ct[i].." 34")
  899. parse("equip "..ct[i].." 35")
  900. parse("setweapon "..ct[i].." 35")
  901. end
  902. else
  903. for i=1,#t do
  904. tp(t[i],math.random(208,213),math.random(84,86))
  905. parse("equip "..t[i].." 34")
  906. parse("equip "..t[i].." 35")
  907. parse("setweapon "..t[i].." 35")
  908. end
  909. for i=1,#ct do
  910. tp(ct[i],math.random(195,200),math.random(63,65))
  911. parse("equip "..ct[i].." 34")
  912. parse("equip "..ct[i].." 35")
  913. parse("setweapon "..ct[i].." 35")
  914. end
  915. end
  916. end
  917. end
  918. function mg.nadespam()
  919. if mg.gametimer<=0 then
  920. local t=player(0,"team1living")
  921. local ct=player(0,"team2living")
  922. freehook("second","mg.nadespam")
  923. mg.game=1
  924. if math.random(1,2)==1 then
  925. for i=1,#t do
  926. tp(t[i],25,math.random(192,198))
  927. end
  928. for i=1,#ct do
  929. tp(ct[i],37,math.random(192,198))
  930. end
  931. else
  932. for i=1,#t do
  933. tp(t[i],37,math.random(192,198))
  934. end
  935. for i=1,#ct do
  936. tp(ct[i],25,math.random(192,198))
  937. end
  938. end
  939. end
  940. end
  941. function mg.shotgunshuffle()
  942. if mg.gametimer<=0 then
  943. local t=player(0,"team1living")
  944. local ct=player(0,"team2living")
  945. freehook("second","mg.shotgunshuffle")
  946. mg.game=1
  947. for i=1,#t do
  948. tp(t[i],math.random(19,20),math.random(217,218))
  949. parse("equip "..t[i].." 10")
  950. parse("equip "..t[i].." 11")
  951. parse("setweapon "..t[i].." 10")
  952. end
  953. for i=1,#ct do
  954. tp(ct[i],math.random(33,34),math.random(229,230))
  955. parse("equip "..ct[i].." 10")
  956. parse("equip "..ct[i].." 11")
  957. parse("setweapon "..ct[i].." 10")
  958. end
  959. end
  960. end
  961. function mg.campersparadise()
  962. if mg.gametimer<=0 then
  963. local t=player(0,"team1living")
  964. local ct=player(0,"team2living")
  965. freehook("second","mg.campersparadise")
  966. mg.game=1
  967. for i=1,#t do
  968. tp(t[i],math.random(200,217),123)
  969. parse("equip "..t[i].." 37")
  970. parse("setweapon "..t[i].." 37")
  971. end
  972. for i=1,#ct do
  973. tp(ct[i],math.random(200,217),105)
  974. parse("equip "..ct[i].." 36")
  975. parse("setweapon "..ct[i].." 36")
  976. end
  977. end
  978. end
  979. function mg.winterwarfare()
  980. if mg.gametimer<=0 then
  981. local t=player(0,"team1living")
  982. local ct=player(0,"team2living")
  983. freehook("second","mg.winterwarfare")
  984. mg.game=1
  985. if math.random(1,2)==1 then
  986. for i=1,#t do
  987. tp(t[i],math.random(209,223),math.random(159,160))
  988. parse("equip "..t[i].." 75")
  989. parse("setweapon "..t[i].." 75")
  990. end
  991. for i=1,#ct do
  992. tp(ct[i],math.random(209,223),math.random(144,145))
  993. parse("equip "..ct[i].." 75")
  994. parse("setweapon "..ct[i].." 75")
  995. end
  996. else
  997. for i=1,#t do
  998. tp(t[i],math.random(209,223),math.random(144,145))
  999. parse("equip "..t[i].." 75")
  1000. parse("setweapon "..t[i].." 75")
  1001. end
  1002. for i=1,#ct do
  1003. tp(ct[i],math.random(209,223),math.random(159,160))
  1004. parse("equip "..ct[i].." 75")
  1005. parse("setweapon "..ct[i].." 75")
  1006. end
  1007. end
  1008. end
  1009. end
  1010. function mg.gungroup()
  1011. if mg.gametimer<=0 then
  1012. local t=player(0,"team1living")
  1013. local ct=player(0,"team2living")
  1014. freehook("second","mg.gungroup")
  1015. mg.game=1
  1016. for i=1,#t do
  1017. tp(t[i],math.random(51,53),math.random(231,233))
  1018. end
  1019. for i=1,#ct do
  1020. tp(ct[i],math.random(66,68),math.random(218,220))
  1021. end
  1022. end
  1023. end
  1024. function mg.footrace()
  1025. if mg.gametimer==1 then
  1026. parse("sv_sound \"mat5b/raceintro.ogg\"")
  1027. end
  1028. if mg.gametimer<=0 then
  1029. local t=player(0,"tableliving")
  1030. freehook("second","mg.footrace")
  1031. mg.game=1
  1032. for i=1,#t do
  1033. tp(t[i],89,191)
  1034. end
  1035. mg.rx=95*32+16
  1036. mg.ry=189*32+16
  1037. addhook("ms100","mg.racetrans")
  1038. end
  1039. end
  1040.  
  1041. function mg.racetrans()
  1042. if mg.rx>82*32+16 then
  1043. mg.rx=mg.rx-16
  1044. mg.ry=mg.ry-math.random(-2,2)
  1045. for id=1,#player(0,"tableliving") do
  1046. parse("setpos "..player(0,"tableliving")[id].." "..mg.rx.." "..mg.ry.."")
  1047. end
  1048. else
  1049. local t=player(0,"tableliving")
  1050. parse("trigger overlaponce")
  1051. for i=1,#t do
  1052. tp(t[i],82,math.random(180,196))
  1053. mg.powerup[t[i]]=0
  1054. end
  1055. mg.pocketimg=image("gfx/mat5b/hud_powerup.png",320,413,2)
  1056. imagealpha(mg.pocketimg,0)
  1057. tween_alpha(mg.pocketimg,3000,1)
  1058. tween_color(mg.pocketimg,3000,math.random(0,255),math.random(0,255),math.random(0,255))
  1059. freehook("ms100","mg.racetrans")
  1060. timer(900,"mg.racetranstwo","g")
  1061. timer(1000,"mg.racetranstwo","d")
  1062. timer(1900,"mg.racetranstwo","e")
  1063. timer(2000,"mg.racetranstwo","r")
  1064. timer(2900,"mg.racetranstwo","t")
  1065. timer(3000,"mg.racetranstwo","y")
  1066. timer(3900,"mg.racetranstwo","u")
  1067. timer(4000,"mg.racetranstwo","i")
  1068. end
  1069. end
  1070. function mg.racetranstwo(m)
  1071. if m=="g" then
  1072. mg.counter=image("gfx/mat5b/three.png",320,120,2)
  1073. imagealpha(mg.counter,0)
  1074. tween_alpha(mg.counter,100,1)
  1075. tween_scale(mg.counter,100,2,2)
  1076. elseif m=="d" then
  1077. parse("sv_sound \"mat5b/three.ogg\"")
  1078. tween_alpha(mg.counter,500,0)
  1079. tween_scale(mg.counter,500,3,3)
  1080. elseif m=="e" then
  1081. freeimage(mg.counter)
  1082. mg.counter=image("gfx/mat5b/two.png",320,120,2)
  1083. imagealpha(mg.counter,0)
  1084. tween_alpha(mg.counter,100,1)
  1085. tween_scale(mg.counter,100,2,2)
  1086. elseif m=="r" then
  1087. parse("sv_sound \"mat5b/two.ogg\"")
  1088. tween_alpha(mg.counter,500,0)
  1089. tween_scale(mg.counter,500,3,3)
  1090. elseif m=="t" then
  1091. freeimage(mg.counter)
  1092. mg.counter=image("gfx/mat5b/one.png",320,120,2)
  1093. imagealpha(mg.counter,0)
  1094. tween_alpha(mg.counter,100,1)
  1095. tween_scale(mg.counter,100,2,2)
  1096. elseif m=="y" then
  1097. parse("sv_sound \"mat5b/one.ogg\"")
  1098. tween_alpha(mg.counter,500,0)
  1099. tween_scale(mg.counter,500,3,3)
  1100. elseif m=="u" then
  1101. freeimage(mg.counter)
  1102. mg.counter=image("gfx/mat5b/go.png",320,120,2)
  1103. imagealpha(mg.counter,0)
  1104. tween_alpha(mg.counter,100,1)
  1105. tween_scale(mg.counter,100,2,2)
  1106. elseif m=="i" then
  1107. parse("sv_sound \"mat5b/go.ogg\"")
  1108. tween_alpha(mg.counter,500,0)
  1109. tween_scale(mg.counter,500,3,3)
  1110. timer(500,"mg.racetransthree")
  1111. parse("trigger raceonce")
  1112. for id=1,#player(0,"tableliving") do
  1113. parse("speedmod "..player(0,"tableliving")[id].." 10")
  1114. end
  1115. end
  1116. end
  1117. function mg.racetransthree()
  1118. freeimage(mg.counter)
  1119. mg.counter=0
  1120. end
  1121. function mg.freeride(m)
  1122. if m=="d" then
  1123. freeimage(ring1)
  1124. ring2=image("gfx/mat5b/wave.png",player(mg.starman,"x"),player(mg.starman,"y"),0)
  1125. imagescale(ring2,0.1,0.1)
  1126. tween_scale(ring2,2000,60,60)
  1127. elseif m=="e" then
  1128. freeimage(ring2)
  1129. if player(mg.starman,"team")==1 then
  1130. bigskin=image("gfx/mat5b/bigt"..(player(mg.starman,"look")+1)..".png",1,0,200+mg.starman)
  1131. else
  1132. bigskin=image("gfx/mat5b/bigct"..(player(mg.starman,"look")+1)..".png",1,0,200+mg.starman)
  1133. end
  1134. imagescale(bigskin,0.25,0.25)
  1135. ring3=image("gfx/mat5b/wave1.png",player(mg.starman,"x"),player(mg.starman,"y"),1)
  1136. imagescale(ring3,0.1,0.1)
  1137. tween_scale(ring3,2000,60,60)
  1138. elseif m=="f" then
  1139. imagescale(bigskin,1.5,1.5)
  1140. imagecolor(bigskin,128,128,128)
  1141. imagealpha(bigskin,0.8,0.8)
  1142. tween_alpha(ring3,3000,0)
  1143. elseif m=="mini" then
  1144. if player(mg.starman,"team")==1 then
  1145. mini={}
  1146. mini[1]=image("gfx/mat5b/bigt"..(player(mg.starman,"look")+1)..".png",player(mg.starman,"x")-600,player(mg.starman,"y")-30,1)
  1147. mini[2]=image("gfx/mat5b/bigt"..(player(mg.starman,"look")+1)..".png",player(mg.starman,"x")-600,player(mg.starman,"y")-180,1)
  1148. mini[3]=image("gfx/mat5b/bigt"..(player(mg.starman,"look")+1)..".png",player(mg.starman,"x")-600,player(mg.starman,"y")+80,1)
  1149. mini[4]=image("gfx/mat5b/bigt"..(player(mg.starman,"look")+1)..".png",player(mg.starman,"x")-600,player(mg.starman,"y")+175,1)
  1150. mini[5]=image("gfx/mat5b/bigt"..(player(mg.starman,"look")+1)..".png",player(mg.starman,"x")-600,player(mg.starman,"y")-105,1)
  1151. else
  1152. mini={}
  1153. mini[1]=image("gfx/mat5b/bigct"..(player(mg.starman,"look")+1)..".png",player(mg.starman,"x")-600,player(mg.starman,"y")-30,1)
  1154. mini[2]=image("gfx/mat5b/bigct"..(player(mg.starman,"look")+1)..".png",player(mg.starman,"x")-600,player(mg.starman,"y")-180,1)
  1155. mini[3]=image("gfx/mat5b/bigct"..(player(mg.starman,"look")+1)..".png",player(mg.starman,"x")-600,player(mg.starman,"y")+80,1)
  1156. mini[4]=image("gfx/mat5b/bigct"..(player(mg.starman,"look")+1)..".png",player(mg.starman,"x")-600,player(mg.starman,"y")+175,1)
  1157. mini[5]=image("gfx/mat5b/bigct"..(player(mg.starman,"look")+1)..".png",player(mg.starman,"x")-600,player(mg.starman,"y")-105,1)
  1158. end
  1159. imagepos(mini[1],player(mg.starman,"x")-600,player(mg.starman,"y")-30,90)
  1160. imagepos(mini[2],player(mg.starman,"x")-600,player(mg.starman,"y")-200,90)
  1161. imagepos(mini[3],player(mg.starman,"x")-600,player(mg.starman,"y")+80,90)
  1162. imagepos(mini[4],player(mg.starman,"x")-600,player(mg.starman,"y")+175,90)
  1163. imagepos(mini[5],player(mg.starman,"x")-600,player(mg.starman,"y")-105,90)
  1164. imagescale(mini[1],0.6,0.6)
  1165. imagescale(mini[2],0.9,0.9)
  1166. imagescale(mini[3],1.1,1.1)
  1167. imagescale(mini[4],1.2,1.2)
  1168. imagescale(mini[5],0.3,0.3)
  1169. for g=1,5 do
  1170. imagealpha(mini[g],0)
  1171. end
  1172. tween_move(mini[1],1000,player(mg.starman,"x")+140,player(mg.starman,"y")-30)
  1173. tween_move(mini[2],1000,player(mg.starman,"x")-60,player(mg.starman,"y")-180)
  1174. tween_move(mini[3],1000,player(mg.starman,"x")+40,player(mg.starman,"y")+80)
  1175. tween_move(mini[4],1000,player(mg.starman,"x")-175,player(mg.starman,"y")+175)
  1176. tween_move(mini[5],1000,player(mg.starman,"x")+10,player(mg.starman,"y")-105)
  1177. for n=1,5 do
  1178. tween_alpha(mini[n],1000,1)
  1179. end
  1180. elseif m=="minitwo" then
  1181. tween_move(mini[1],1000,player(mg.starman,"x")+600,player(mg.starman,"y")-30)
  1182. tween_move(mini[2],1000,player(mg.starman,"x")+600,player(mg.starman,"y")-180)
  1183. tween_move(mini[3],1000,player(mg.starman,"x")+600,player(mg.starman,"y")+80)
  1184. tween_move(mini[4],1000,player(mg.starman,"x")+600,player(mg.starman,"y")+175)
  1185. tween_move(mini[5],1000,player(mg.starman,"x")+600,player(mg.starman,"y")-105)
  1186. for i=1,5 do
  1187. tween_alpha(mini[i],2000,0)
  1188. end
  1189. elseif m=="g" then
  1190. tween_color(bigskin,1000,255,255,255)
  1191. tween_alpha(bigskin,1000,1)
  1192. elseif m=="h" then
  1193. parse("trigger star1")
  1194. local all=player(0,"tableliving")
  1195. for i=1,#all do
  1196. parse("speedmod "..all[i].." 1")
  1197. end
  1198. parse("speedmod "..mg.starman.." -10")
  1199. addhook("move","mg.move")
  1200. for d=1,5 do
  1201. freeimage(mini[d])
  1202. end
  1203. mini={}
  1204. end
  1205. end
  1206.  
  1207. addhook("second","mg.second")
  1208. function mg.second()
  1209. if mg.player~=0 and mg.game==0 and mg.gametimer<=0 and mg.selgame==0 then
  1210. if mg.idletimer>0 then
  1211. mg.idletimer=mg.idletimer-1
  1212. elseif mg.idletimer<=0 then
  1213. if math.random(1,2)==1 then
  1214. msg("©255255255"..player(mg.player,"name").." took to long to choose a game!")
  1215. tp(mg.player,24,23)
  1216. timer(3000,"parse","trigger kabonce")
  1217. timer(12000,"parse","trigger draw")
  1218. else
  1219. msg("©255255255"..player(mg.player,"name").." took to long to choose a game! Restarting...")
  1220. parse("trigger draw")
  1221. end
  1222. mg.idletimer=mg.idletime
  1223. end
  1224. end
  1225. if mg.gametimer>0 then
  1226. mg.gametimer=mg.gametimer-1
  1227. end
  1228. if mg.selgame~=22 then
  1229. if mg.gametimer==2 then
  1230. parse("sv_sound \"mat5b/three.ogg\"")
  1231. elseif mg.gametimer==1 then
  1232. parse("sv_sound \"mat5b/two.ogg\"")
  1233. elseif mg.gametimer==0 then
  1234. if mg.plch==0 then
  1235. parse("sv_sound \"mat5b/one.ogg\"")
  1236. mg.plch=1
  1237. elseif mg.plch==1 then
  1238. parse("sv_sound \"mat5b/go.ogg\"")
  1239. mg.plch=2
  1240. end
  1241. end
  1242. end
  1243. for id=1,#player(0,"tableliving") do
  1244. if mg.hatdel[id]>0 then
  1245. mg.hatdel[id]=mg.hatdel[id]-1
  1246. end
  1247. end
  1248. end
  1249.  
  1250. addhook("objectkill","mg.breaky")
  1251. function mg.breaky(i,id)
  1252. local x=object(i,"tilex")
  1253. local y=object(i,"tiley")
  1254. for a=1,#mg.breakablesx do
  1255. if x==mg.breakablesx[a] and y==mg.breakablesy[a] then
  1256. mg.score[id]=mg.score[id]+1
  1257. if mg.score[id]==10 then
  1258. mg.score[id]=0
  1259. parse("setscore "..id.." "..(player(id,"score")+1).."")
  1260. msg2(id,"©255255255Got a point!")
  1261. else
  1262. msg2(id,"©255255255"..(10-mg.score[id]).." left to get a point!")
  1263. end
  1264. end
  1265. end
  1266. end
  1267.  
  1268. addhook("leave","mg.leave")
  1269. function mg.leave(id)
  1270. if id==mg.player then
  1271. mg.player=0
  1272. if mg.game==0 then
  1273. parse("trigger draw")
  1274. end
  1275. end
  1276. if id==mg.last then
  1277. mg.last=0
  1278. end
  1279. if id==mg.next then
  1280. mg.next=0
  1281. end
  1282. if id==mg.starman then
  1283. mg.star=0
  1284. mg.starman=0
  1285. freehook("move","mg.move")
  1286. freetimer()
  1287. parse("trigger draw")
  1288. end
  1289. mg.score[id]=0
  1290. mg.hatdel[id]=0
  1291. if mg.hatimg[id]~=0 then
  1292. freeimage(mg.hatimg[id])
  1293. end
  1294. mg.hatimg[id]=0
  1295. mg.hat[id]=0
  1296. if mg.powerupimg[id]~=0 then
  1297. freeimage(mg.powerupimg[id])
  1298. end
  1299. mg.powerupimg[id]=0
  1300. mg.powerup[id]=0
  1301. end
  1302.  
  1303. addhook("team","mg.team")
  1304. function mg.team(id,t)
  1305. if id==mg.last then
  1306. mg.last=0
  1307. end
  1308. if id==mg.next then
  1309. mg.next=0
  1310. end
  1311. if id==mg.starman then
  1312. mg.star=0
  1313. mg.starman=0
  1314. parse("trigger draw")
  1315. end
  1316. mg.score[id]=0
  1317. mg.hatdel[id]=0
  1318. if mg.hatimg[id]~=0 then
  1319. freeimage(mg.hatimg[id])
  1320. end
  1321. mg.hatimg[id]=0
  1322. end
  1323.  
  1324. addhook("spawn","mg.spawn")
  1325. function mg.spawn(id)
  1326. if mg.game==1 then
  1327. parse("customkill "..id.." NO_RESPAWNING_AFTER_A_GAME_STARTS "..id.."")
  1328. end
  1329. end
  1330.  
  1331. addhook("objectupgrade","mg.objectupgrade")
  1332. function mg.objectupgrade(i,id,p)
  1333. if tonumber(object(i,"type"))==9 and p>=20 then
  1334. local x=object(i,"tilex")
  1335. local y=object(i,"tiley")
  1336. parse("killobject "..i)
  1337. parse("spawnobject 15 "..x.." "..y.." 0 1 "..player(id,"team").." "..id)
  1338. if player(id,"team")==1 then
  1339. parse('effect "colorsmoke" '..(x*32+16)..' '..(y*32+16)..' 1 1 255 0 0')
  1340. else
  1341. parse('effect "colorsmoke" '..(x*32+16)..' '..(y*32+16)..' 1 1 0 0 255')
  1342. end
  1343. end
  1344. end
  1345.  
  1346. addhook("usebutton","mg.usebutton")
  1347. function mg.usebutton(id,x,y)
  1348. if x==12 and y==34 then
  1349. menu(id,"Hat Dispenser Menu,Take Off,Pocik | "..mg.prices[1].." points,Povar | "..mg.prices[2].." points,Beavis | "..mg.prices[3].." points,Gravity Cat | "..mg.prices[4].." points,Duke Nukem | "..mg.prices[5].." points,Chewbacca | "..mg.prices[6].." points,Advokat | "..mg.prices[7].." points,Chuck Norris | "..mg.prices[8].." points")
  1350. end
  1351. end
  1352.  
  1353. addhook("triggerentity","mg.triggerentity")
  1354. function mg.triggerentity(x,y)
  1355. if (x==97 and y==94) or (x==103 and y==102) then
  1356. local r=math.random(1,3)
  1357. if r==1 then
  1358. msg2(mg.player,"©255255255A horrible chill goes down your spine...")
  1359. elseif r==2 then
  1360. msg2(mg.player,"©255255255You feel an evil presence watching you...")
  1361. else
  1362. msg2(mg.player,"©255255255Screams echo around you...")
  1363. end
  1364. end
  1365. end
  1366.  
  1367. addhook("menu","mg.menu")
  1368. function mg.menu(id,m,s)
  1369. if m=="Hat Dispenser Menu" then
  1370. if s==1 then
  1371. if mg.hatimg[id]~=0 then
  1372. freeimage(mg.hatimg[id])
  1373. end
  1374. mg.hatimg[id]=0
  1375. elseif s>=2 and s<=9 then
  1376. if player(id,"score")>=mg.prices[s-1] then
  1377. if mg.hatimg[id]~=0 then
  1378. freeimage(mg.hatimg[id])
  1379. end
  1380. mg.hat[id]=s-1
  1381. if mg.hat[id]~=1 and mg.hat[id]~=2 and mg.hat[id]~=7 then
  1382. mg.hatimg[id]=image("gfx/mat5b/hat_"..(s-1)..".png",1,0,200+id)
  1383. else
  1384. mg.hatimg[id]=image("gfx/mat5b/hat_"..(s-1).."_r.png",1,0,200+id)
  1385. end
  1386. if mg.game==1 or mg.gametimer>0 then
  1387. imagealpha(mg.hatimg[id],mg.hattrans)
  1388. else
  1389. imagealpha(mg.hatimg[id],1.0)
  1390. end
  1391. parse("setscore "..id.." "..player(id,"score")-mg.prices[s-1])
  1392. else
  1393. msg2(id,"©255255255Not enough score!")
  1394. end
  1395. end
  1396. end
  1397. end
  1398.  
  1399. addhook("die","mg.die")
  1400. function mg.die(id)
  1401. if player(id,"team")>0 and #player(0,"team"..player(id,"team").."living")>1 and mg.game==1 then
  1402. parse("sv_sound2 "..id.." \"mat5b/die_"..math.random(1,5)..".ogg\"")
  1403. end
  1404. if id==mg.player and mg.game==0 then
  1405. mg.player=0
  1406. parse("trigger draw")
  1407. end
  1408. if id==mg.starman then
  1409. mg.star=0
  1410. mg.starman=0
  1411. freehook("move","mg.move")
  1412. freetimer()
  1413. parse("trigger draw")
  1414. end
  1415. mg.hatdel[id]=0
  1416. if mg.hatimg[id]~=0 then
  1417. freeimage(mg.hatimg[id])
  1418. end
  1419. mg.hatimg[id]=0
  1420. end
  1421.  
  1422. addhook("say","mg.say",2)
  1423. function mg.say(id,t)
  1424. if t=="!credits" or t=="!CREDITS" then
  1425. msg2(id,"©255255255Multigame 2, a project by mat5b (BetaM) and BartNixon")
  1426. msg2(id,"©255255255Thanks go out to the following people: KimKat (inspiration), BlazingEyed (long term graditude)")
  1427. msg2(id,"©255255255The people who provided useful feedback & suggestions: Mane22, Left 4 n00b, Darknob")
  1428. msg2(id,"©255255255And the following testers: pepetime, RICO, Apf3l, SuperNova, DarqKniFe,")
  1429. msg2(id,"©255255255×Ðø©tø®×, »Pro Ninja«, <<<<<<NuNz>>>>>>, turk, Pa[TR]oN,")
  1430. msg2(id,"©255255255x.Joker.x, Player (the one that has an USGN ID)")
  1431. msg2(id,"©255255255If you can't see the credits, open the console (or beat the boss (coming soon))")
  1432. return 1
  1433. elseif t=="!settings" or t=="!SETTINGS" then
  1434. msg2(id,"©255255255Multigame Setttings:")
  1435. msg2(id,"©255255255Scrambling: "..mg.scram.." (1-on; 0-off)")
  1436. msg2(id,"©255255255Scramble rounds: "..mg.winrow.." rounds")
  1437. msg2(id,"©255255255Special Games Cap: "..mg.specialcap.." rounds")
  1438. msg2(id,"©255255255Idle time for the choosing player: "..mg.idletime.." seconds")
  1439. msg2(id,"©255255255Powerup removal: "..mg.removepowerups.." (1-on; 0-off)")
  1440. return 1
  1441. end
  1442. if mg.specialchat==1 then
  1443. if player(id,"usgn")==8235 then
  1444. if t=="rank" then
  1445. return 0
  1446. else
  1447. rcol()
  1448. if player(id,"team")>0 then
  1449. msg(""..mg.palette[math.random(1,#mg.palette)].."["..mg.teams[player(id,"team")].."] mat5b (Designer): "..t)
  1450. else
  1451. msg(""..mg.palette[math.random(1,#mg.palette)].."[Spec] mat5b (Designer): "..t)
  1452. end
  1453. return 1
  1454. end
  1455. elseif player(id,"usgn")==11148 then
  1456. if t=="rank" then
  1457. return 0
  1458. else
  1459. rcol()
  1460. if player(id,"team")>0 then
  1461. msg(""..mg.palette[math.random(1,#mg.palette)].."["..mg.teams[player(id,"team")].."] BartNixon (Designer): "..t)
  1462. else
  1463. msg(""..mg.palette[math.random(1,#mg.palette)].."[Spec] BartNixon (Designer): "..t)
  1464. end
  1465. return 1
  1466. end
  1467. end
  1468. if player(id,"rcon") then
  1469. if t=="rank" then
  1470. return 0
  1471. else
  1472. rcol()
  1473. if player(id,"team")>0 then
  1474. msg(""..mg.palette[math.random(1,#mg.palette)].."["..mg.teams[player(id,"team")].."] "..player(id,"name")..": "..t)
  1475. else
  1476. msg(""..mg.palette[math.random(1,#mg.palette)].."[Spec] "..player(id,"name")..": "..t)
  1477. end
  1478. return 1
  1479. end
  1480. end
  1481. end
  1482. end
  1483.  
  1484. addhook("walkover","mg.walkover")
  1485. function mg.walkover(id,iid,w)
  1486. if w==75 and mg.selgame==22 and mg.powerupimg[id]==0 then
  1487. mg.powerupimg[id]=image("gfx/mat5b/hud_unknown.png",320,420,2,id)
  1488. imagecolor(mg.powerupimg[id],math.random(50,255),math.random(50,255),math.random(50,255))
  1489. parse("sv_sound2 "..id.." \"items/pickup.wav\"")
  1490. parse('effect "flare" '..player(id,"x")..' '..player(id,"y")..' 1 3 '..math.random(50,255)..' '..math.random(50,255)..' '..math.random(50,255)..'')
  1491. timer(3000,"mg.genpower",""..id.."")
  1492. parse("removeitem "..iid)
  1493. return 1
  1494. end
  1495. if w==75 and mg.selgame==22 and mg.powerupimg[id]~=0 then
  1496. if mg.removepowerups==1 then
  1497. parse("removeitem "..iid)
  1498. end
  1499. return 1
  1500. end
  1501. end
  1502.  
  1503. function mg.genpower(i)
  1504. local id=tonumber(i)
  1505. freeimage(mg.powerupimg[id])
  1506. mg.powerup[id]=mg.powerups[math.random(1,#mg.powerups)]
  1507. mg.powerupimg[id]=image("gfx/mat5b/power_"..itemtype(mg.powerup[id],"name")..".png",320,420,2,id)
  1508. parse("sv_sound2 "..id.." \"mat5b/powerup_chime.ogg\"")
  1509. end
  1510.  
  1511. if mg.rconcommands==1 then
  1512. addhook("rcon","mg.rconcom")
  1513. addhook("parse","mg.rconcom")
  1514. end
  1515. function mg.rconcom(t,id)
  1516. if t:find("mg_next") then
  1517. local d=tonumber(t:sub(9))
  1518. if d~=0 and d~=nil then
  1519. if player(d,"exists") and player(d,"team")>0 then
  1520. mg.next=d
  1521. msg("©255255255The next choosing player has been changed to ("..mg.teams[player(mg.player,"team")]..") "..player(d,"name").."!")
  1522. else
  1523. if id~=nil then
  1524. msg2(id,"©255255255Player doesn't exist!")
  1525. else
  1526. print("©255255255Player doesn't exist!")
  1527. end
  1528. end
  1529. else
  1530. if d~=nil then
  1531. if id~=nil then
  1532. msg2(id,"©255255255Invalid ID! (it must be a number)")
  1533. else
  1534. print("©255255255Invalid ID! (it must be a number)")
  1535. end
  1536. else
  1537. if id~=nil then
  1538. msg2(id,"©255255255The next player is ("..mg.teams[player(mg.player,"team")]..") "..player(mg.next,"name").."")
  1539. else
  1540. print("©255255255The next player is ("..mg.teams[player(mg.player,"team")]..") "..player(mg.next,"name").."")
  1541. end
  1542. end
  1543. end
  1544. return 1
  1545. end
  1546. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement