Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ----------------------------------------------------
- -- Multigame 2 SE script by mat5b ------------------
- -- Thanks to BartNixon for sound design and ideas --
- ----------------------------------------------------
- mg={}
- -- Special Edition for Ax3 -------------------------
- -- Server Settings: --------------------------------
- mg.scram=1 -- Allow team scrambling on the server (1 - on; 0 - off)
- mg.winrow=4 -- If a team wins this amount of times in a row, the teams get scrambled
- mg.hattrans=0.1 -- Hat transparency during games (0.0 min. - 1.0 max.)
- mg.idletime=60 -- Max time (in seconds) of choosing a game
- mg.specialcap=3 -- Amount of rounds between being able to choose *special* games
- mg.specialchat=1 -- Allow the rcon admins and the map makers to be recognised on the server (1 - on; 0 - off)
- mg.removepowerups=1 -- Remove powerups from the floor after running over them while already carrying one
- mg.endsounds=1 -- Play and display a random message every time the round ends (1 - on; 0 - off)
- mg.endmusic=1 -- Play music at the end of rounds (1 - on; 0 - off)
- mg.prices={30,20,35,40,50,25,15,45} -- Adjust prices of the hats (in order as they appear on the menu)
- mg.rconcommands=0 -- Allow for rcon console commands for rcon admins (mg_next <ID> - sets the next player) (1 - on; 0 - off)
- -- End of Settings ---------------------------------
- parse('sv_gamemode 0') -- Required
- parse('mp_antispeeder 0')
- parse('mp_radar 0')
- parse('sv_fow 0')
- if mg.scram==1 then
- parse("mp_autoteambalance 1")
- end
- parse('mp_supply_items "30,32,51,52,53,46,47,48"')
- function array(d,s)
- local t={}
- for i=1,d do
- t[i]=s
- end
- return t
- end
- function getplayers()
- local s={}
- for id=1,32 do
- if player(id,"exists") and player(id,"team")~=0 and not player(id,"bot") then
- table.insert(s,id)
- end
- end
- return s
- end
- function getallplayers()
- local s={}
- for id=1,32 do
- if player(id,"exists") and player(id,"team")~=0 and player(id,"health")>0 then
- table.insert(s,id)
- end
- end
- return s
- end
- function checkbots()
- local s={}
- for id=1,32 do
- if player(id,"exists") and player(id,"team")~=0 and player(id,"bot") then
- table.insert(s,id)
- end
- end
- return #s
- end
- function tp(id,d,s)
- local x=d*32+16
- local y=s*32+16
- parse("setpos "..id.." "..x.." "..y)
- end
- function searcht(t,p)
- local d=0
- for i=1,#t do
- if t[i]==p then
- d=i
- break
- end
- end
- return d
- end
- function mg.info(game,a)
- msg("©255255255"..player(mg.player,"name").." chose "..game.."! Prepare "..a.."!")
- end
- function mg.gamestuff(h1,n,d)
- mg.info(n,d)
- if mg.selgame==22 then
- mg.gametimer=2
- else
- mg.gametimer=5
- end
- mg.plch=0
- addhook("second",h1)
- for id=1,32 do
- if mg.hatimg[id]~=0 then
- tween_alpha(mg.hatimg[id],5000,mg.hattrans)
- end
- end
- end
- function mg.tablecheck(id)
- 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
- return 1
- end
- return 0
- end
- math.randomseed(os.time())
- mg.hatdel=array(32,0)
- mg.score=array(32,0)
- mg.hat=array(32,0)
- mg.hatimg=array(32,0)
- mg.powerup=array(32,0)
- mg.powerupimg=array(32,0)
- mg.player=0
- mg.last=0
- mg.game=0
- mg.gametimer=0
- mg.plch=2
- mg.teams={"T","CT","VIP"}
- mg.list={"dualbombs","escort","pointtick","meleemadness","explosionwar","flagging","bunker","terraingain","shields","flamewar","starchase","darkroom","explosives","pistolpower","riflerampage","snipershotdown","nadespam","shotgunshuffle","campersparadise","winterwarfare","gungroup","footrace"}
- mg.powerups={65,77,45,64,69}
- mg.selgame=0
- mg.next=0
- mg.winrow_t=0
- mg.winrow_ct=0
- mg.scrambling=0
- mg.star=0
- mg.starman=0
- mg.cap=0
- mg.idletimer=mg.idletime
- mg.breakablesx={21,22,22,23,23,23,24,24,24,25,25,25,26,26,26,27,27,28}
- mg.breakablesy={38,37,38,36,37,38,36,37,38,36,37,38,36,37,38,37,38,38}
- mg.palette={}
- mg.rx=0
- mg.ry=0
- function rcol()
- local r,g,b
- for i=1,100 do
- r=math.random(100,255)
- g=math.random(100,255)
- b=math.random(100,255)
- mg.palette[i] = "©"..r..""..g..""..b..""
- end
- end
- rcol()
- function sv_sound3(snd,x,y)
- for id=1,32 do
- if player(id,"exists") then
- 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
- parse("sv_sound2 "..id.." \""..snd.."")
- end
- end
- end
- end
- addhook("hit","mg.hit")
- function mg.hit(id,s,w,h,a)
- if mg.game==0 then
- return 1
- end
- if mg.starman==id then
- return 1
- end
- if mg.selgame==22 and w==77 then
- local x=player(id,"tilex")
- local y=player(id,"tiley")
- if tile(x-2,y,"walkable") then
- parse("setpos "..id.." "..((player(id,"tilex")-2)*32+16).." "..player(id,"y"))
- else
- if tile(x,y-2,"walkable") then
- parse("setpos "..id.." "..(player(id,"x")).." "..((player(id,"tiley")-2)*32+16))
- else
- parse("speedmod "..id.." -20")
- timer(750,"parse","speedmod "..id.." 10")
- end
- end
- elseif mg.selgame==22 and w==45 then
- parse("strip "..s.." 45")
- parse("speedmod "..id.." -20")
- timer(750,"parse","speedmod "..id.." 10")
- elseif mg.selgame==22 and w==69 then
- parse("strip "..s.." 69")
- local px=player(id,"x")
- local py=player(id,"y")
- local sx=player(s,"x")
- local sy=player(s,"y")
- parse("setpos "..id.." "..sx.." "..sy.."")
- parse("setpos "..s.." "..px.." "..py.."")
- end
- if mg.selgame==22 then
- return 1
- end
- end
- addhook("startround","mg.startround")
- function mg.startround()
- mg.gametimer=0
- mg.plch=2
- mg.game=0
- mg.player=0
- mg.idletimer=mg.idletime
- if mg.cap>0 then
- mg.cap=mg.cap-1
- end
- if game("sv_gamemode")~=0 then
- parse("sv_gamemode 0")
- end
- local p=getplayers() --without bots
- local b=getallplayers() --with them
- local c=p
- if p==b or #b<=1 then
- msg("©255255255Not enough players to begin!")
- else
- if checkbots()~=0 and #p<1 then
- msg("©255255255Not enough players to begin!")
- else
- if mg.next==0 then
- mg.player=p[math.random(1,#p)]
- if mg.last==0 then
- mg.last=mg.player
- else
- if #p==1 then
- mg.player=mg.last
- else
- mg.pos=searcht(p,mg.last)
- table.remove(p,mg.pos)
- mg.player=p[math.random(1,#p)]
- mg.last=mg.player
- end
- end
- if #c==1 then
- mg.next=mg.player
- else
- mg.pos=searcht(c,mg.player)
- table.remove(c,mg.pos)
- mg.next=c[math.random(1,#c)]
- end
- else
- mg.player=mg.next
- if #p==1 then
- mg.next=mg.player
- else
- mg.pos=searcht(c,mg.player)
- table.remove(c,mg.pos)
- if #c==0 then
- mg.next=mg.player
- else
- mg.next=c[math.random(1,#c)]
- end
- end
- end
- tp(mg.player,100,100)
- parse("sv_sound2 "..mg.player.." \"mat5b/gman_choose"..math.random(1,2)..".wav\"")
- msg("©255255255"..player(mg.player,"name").." ("..mg.teams[player(mg.player,"team")]..") can choose the game! (Next up: "..player(mg.next,"name").."!)")
- end
- end
- for i=1,#player(0,"table") do
- parse("speedmod "..player(0,"table")[i].." 0")
- parse("setarmor "..player(0,"table")[i].." 0")
- if mg.hat[player(0,"table")[i]]~=0 then
- 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
- mg.hatimg[player(0,"table")[i]]=image("gfx/mat5b/hat_"..mg.hat[player(0,"table")[i]]..".png",1,0,200+player(0,"table")[i])
- else
- 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])
- end
- imagealpha(mg.hatimg[player(0,"table")[i]],1.0)
- end
- end
- end
- addhook("endround","mg.endround")
- function mg.endround(m)
- freetimer()
- mg.game=0
- mg.plch=2
- mg.rx=0
- mg.ry=0
- if mg.selgame==11 and mg.starman~=0 then
- mg.star=0
- mg.starman=0
- freehook("move","mg.move")
- parse("trigger star1")
- if ring1~=0 then
- freeimage(ring1)
- ring1=0
- end
- if ring2~=0 then
- freeimage(ring2)
- ring2=0
- end
- if ring3~=0 then
- freeimage(ring3)
- ring3=0
- end
- if bigskin~=0 then
- freeimage(bigskin)
- bigskin=0
- end
- end
- if mg.selgame==22 then
- if mg.counter~=0 then
- freeimage(mg.counter)
- end
- mg.counter=0
- for id=1,32 do
- if mg.powerupimg[id]~=0 then
- freeimage(mg.powerupimg[id])
- end
- mg.powerupimg[id]=0
- mg.powerup[id]=0
- end
- freeimage(mg.pocketimg)
- mg.pocketimg=0
- parse("trigger racemusic")
- freehook("ms100","mg.racetrans")
- end
- if mg.selgame~=0 then
- freehook("second","mg."..mg.list[mg.selgame].."")
- end
- if mg.endsounds==1 then
- local r=math.random(1,5)
- if r==1 then
- msg("©255255255GET MAD!")
- parse("sv_sound \"mat5b/get_mad.ogg\"")
- elseif r==2 then
- msg("©255255255AMAZING!")
- parse("sv_sound \"mat5b/amazing.ogg\"")
- elseif r==3 then
- msg("©255255255HASTA LA VISTA, BABY!")
- parse("sv_sound \"mat5b/hasta.ogg\"")
- elseif r==4 then
- msg("©255255255DO A BARREL ROLL!")
- parse("sv_sound \"mat5b/barrel.ogg\"")
- elseif r==5 then
- msg("©255255255SPAAAAAAAAACE!")
- parse("sv_sound \"mat5b/space.ogg\"")
- end
- end
- if mg.endmusic==1 then
- parse("sv_sound \"mat5b/end_"..math.random(1,10)..".ogg\"")
- end
- for i=1,#player(0,"table") do
- parse("speedmod "..player(0,"table")[i].." 0")
- parse("setarmor "..player(0,"table")[i].." 0")
- if mg.hatimg[player(0,"table")[i]]~=0 then
- tween_alpha(mg.hatimg[player(0,"table")[i]],1000,1)
- end
- end
- for id=1,32 do
- if not player(id,"exists") and mg.tablecheck(id)==1 then
- mg.leave(id)
- end
- end
- mg.selgame=0
- if mg.scram==1 then
- if m==1 or m==20 or m==40 or m==30 or m==50 then
- mg.winrow_t=mg.winrow_t+1
- mg.winrow_ct=0
- if mg.winrow_t==mg.winrow then
- local r=math.random(1,3)
- if r==1 then
- msg("©255255255Let's even this out. TEAM SCRAMBLE! (death by scramble not counted towards ranking)")
- parse("sv_sound \"mat5b/scramble1.ogg\"")
- elseif r==2 then
- msg("©255255255Commence TEAM SCRAMBLE, NOW! (death by scramble not counted towards ranking)")
- parse("sv_sound \"mat5b/scramble2.ogg\"")
- elseif r==3 then
- msg("©255255255TEAMS are being SCRAMBLED! (death by scramble not counted towards ranking)")
- parse("sv_sound \"mat5b/scramble3.ogg\"")
- end
- mg.winrow_t=0
- mg.scrambling=1
- mg.scramble()
- end
- elseif m==2 or m==21 or m==41 or m==31 or m==51 then
- mg.winrow_ct=mg.winrow_ct+1
- mg.winrow_t=0
- if mg.winrow_ct==mg.winrow then
- local r=math.random(1,3)
- if r==1 then
- msg("©255255255Let's even this out. TEAM SCRAMBLE! (death by scramble not counted towards ranking)")
- parse("sv_sound \"mat5b/scramble1.ogg\"")
- elseif r==2 then -- Excellent job figuring the last clue out.
- msg("©255255255Commence TEAM SCRAMBLE, NOW! (death by scramble not counted towards ranking)") -- How's it going? Found all the clues so far?
- parse("sv_sound \"mat5b/scramble2.ogg\"") -- The puzzle pieces are almost all at their place.
- elseif r==3 then -- There's two of them missing though.
- msg("©255255255TEAMS are being SCRAMBLED! (death by scramble not counted towards ranking)") -- Here they are:
- parse("sv_sound \"mat5b/scramble3.ogg\"") -- First one: http://www.youtube.com/watch?v=Ic2Zh2HmBJ8
- end -- Second one: Find it outside of The Safe (-100;-20) (X) <-10;30> (Y)
- mg.winrow_ct=0 -- Good luck!
- mg.scrambling=1 -- Signed - Hate Same Egg
- mg.scramble()
- end
- end
- end
- end
- function mg.scramble()
- local d=0
- for id=1,#player(0,"table") do
- if player(player(0,"table")[id],"exists") and player(player(0,"table")[id],"team")>0 then
- if player(player(0,"table")[id],"health")>0 then
- d=1
- end
- if math.random(1,2)==1 then
- timer(math.random(100,1000),"parse","maket "..player(0,"table")[id].."")
- else
- timer(math.random(100,1000),"parse","makect "..player(0,"table")[id].."")
- end
- if d==1 then
- parse("setdeaths "..player(0,"table")[id].." "..player(player(0,"table")[id],"deaths")-1)
- d=0
- end
- end
- end
- end
- addhook("use","mg.use")
- function mg.use(id,e)
- if mg.hatdel[id]==0 and e==0 and mg.hat[id]~=0 and mg.selgame~=22 then
- if mg.hat[id]~=1 and mg.hat[id]~=2 and mg.hat[id]~=7 then
- sv_sound3("mat5b/hat_"..mg.hat[id]..".ogg\"",player(id,"x"),player(id,"y"))
- else
- sv_sound3("mat5b/hat_"..mg.hat[id].."_r.ogg\"",player(id,"x"),player(id,"y"))
- end
- mg.hatdel[id]=5
- end
- if mg.selgame==22 and mg.powerup[id]~=0 then
- if mg.powerup[id]==65 then
- parse("speedmod "..id.." 20")
- sv_sound3("mat5b/powerup1.ogg",player(id,"x"),player(id,"y"))
- parse('effect "flare" '..player(id,"x")..' '..player(id,"y")..' 1 1 0 '..math.random(0,255)..' 0')
- timer(1000,"parse","speedmod "..id.." 10")
- elseif mg.powerup[id]==77 then
- parse("equip "..id.." 77")
- parse('effect "flare" '..player(id,"x")..' '..player(id,"y")..' 1 3 0 0 '..math.random(0,255)..'')
- parse("setweapon "..id.." 77")
- elseif mg.powerup[id]==45 then
- parse("equip "..id.." 45")
- parse('effect "flare" '..player(id,"x")..' '..player(id,"y")..' 1 3 '..math.random(0,255)..' 0 0')
- parse("setweapon "..id.." 45")
- elseif mg.powerup[id]==64 then
- parse("speedmod "..id.." 30")
- sv_sound3("mat5b/powerup2.ogg",player(id,"x"),player(id,"y"))
- parse('effect "flare" '..player(id,"x")..' '..player(id,"y")..' 1 1 0 '..math.random(125,255)..' 0')
- timer(1500,"parse","speedmod "..id.." 10")
- elseif mg.powerup[id]==69 then
- parse("equip "..id.." 69")
- parse('effect "flare" '..player(id,"x")..' '..player(id,"y")..' 1 3 '..math.random(125,255)..' '..math.random(125,255)..' 0')
- parse("setweapon "..id.." 69")
- end
- mg.powerup[id]=0
- freeimage(mg.powerupimg[id])
- mg.powerupimg[id]=0
- end
- end
- addhook("movetile","mg.movetile")
- function mg.movetile(id,x,y)
- if id==mg.player then
- if x==96 and y==80 then
- mg.gamestuff("mg.dualbombs","DUAL BOMBS","for explosive action")
- mg.selgame=1
- elseif x==99 and y==80 then
- mg.gamestuff("mg.escort","HOSTAGE ESCORTING","to run like hell")
- mg.selgame=2
- elseif x==96 and y==82 then
- mg.gamestuff("mg.pointtick","CORNER CATASTROPHY","for a lot of BS shots")
- mg.selgame=3
- elseif x==101 and y==80 then
- mg.gamestuff("mg.meleemadness","MELEE MADNESS","for a battle of sticks")
- mg.selgame=4
- elseif x==104 and y==80 then
- mg.gamestuff("mg.explosionwar","EXPLOSION WAR","for quick thinking")
- mg.selgame=5
- elseif x==104 and y==82 then
- mg.gamestuff("mg.flagging","FLAGGING","for tactical planning")
- mg.selgame=6
- elseif x==104 and y==84 then
- mg.gamestuff("mg.bunker","BUNKER TIME","for tactical engineering! Protip: Build supplies")
- mg.selgame=7
- elseif x==96 and y==84 then
- mg.gamestuff("mg.terraingain","TERRAIN GAIN","to capture points")
- mg.selgame=8
- elseif x==102 and y==84 then
- mg.gamestuff("mg.shields","SHIELDS AND SWORDS","your hack'n'slash skills")
- mg.selgame=9
- elseif x==98 and y==84 then
- mg.gamestuff("mg.flamewar","FLAME WAR","for lots of heat")
- mg.selgame=10
- elseif x==100 and y==78 then
- mg.gamestuff("mg.starchase","STARMAN CHASE","to get stomped on")
- mg.selgame=11
- mg.cap=mg.specialcap+1
- elseif x==100 and y==79 then
- if mg.cap>0 then
- msg2(mg.player,"©255255255Sorry, but you need to wait "..mg.cap.." more round(s) before choosing this kind of game.")
- tp(mg.player,100,80)
- end
- elseif x==61 and y==18 then
- mg.gamestuff("mg.darkroom","DARK ROOM","for some blind shooting")
- mg.selgame=12
- elseif x==61 and y==22 then
- mg.gamestuff("mg.explosives","EXPLOSIVES EVERYWHERE","to get blown up")
- mg.selgame=13
- elseif x==61 and y==24 then
- mg.gamestuff("mg.pistolpower","PISTOL POWER","for quick action")
- mg.selgame=14
- elseif x==61 and y==16 then
- mg.gamestuff("mg.riflerampage","RIFLE RAMPAGE","for your classic CS2D action")
- mg.selgame=15
- elseif x==63 and y==16 then
- mg.gamestuff("mg.snipershotdown","SNIPER SHOT DOWN","for quickscoping action")
- mg.selgame=16
- elseif x==65 and y==16 then
- mg.gamestuff("mg.nadespam","GRENADE SPAM","to spam grenades (duh)")
- mg.selgame=17
- elseif x==65 and y==18 then
- mg.gamestuff("mg.shotgunshuffle","SHOTGUN SHUFFLE","for close quarters fighting")
- mg.selgame=18
- elseif x==65 and y==22 then
- mg.gamestuff("mg.campersparadise","CAMPER'S PARADISE","for long range shenanigans")
- mg.selgame=19
- elseif x==65 and y==24 then
- mg.gamestuff("mg.winterwarfare","WINTER WARFARE","to fight using puny snowballs")
- mg.selgame=20
- elseif x==63 and y==24 then
- mg.gamestuff("mg.gungroup","GUN GROUP","for a wise gun choice")
- mg.selgame=21
- elseif x==59 and y==20 then
- mg.selgame=22
- mg.gamestuff("mg.footrace","FOOT RACE","to run a lot")
- mg.cap=mg.specialcap+1
- elseif x==60 and y==20 then
- if mg.cap>0 then
- msg2(mg.player,"©255255255Sorry, but you need to wait "..mg.cap.." more round(s) before choosing this kind of game.")
- tp(mg.player,62,20)
- end
- end
- end
- if mg.selgame==11 then
- if x==36 and y==158 and mg.star==1 then
- mg.star=0
- mg.starman=id
- local all=player(0,"tableliving")
- for i=1,#all do
- parse("speedmod "..all[i].." -100")
- end
- ring1=image("gfx/mat5b/wave.png",player(mg.starman,"x"),player(mg.starman,"y"),0)
- imagescale(ring1,0.1,0.1)
- tween_scale(ring1,2000,60,60)
- timer(1000,"mg.freeride","d")
- timer(2000,"mg.freeride","e")
- timer(5000,"mg.freeride","f")
- timer(2700,"mg.freeride","mini")
- timer(4700,"mg.freeride","minitwo")
- timer(7000,"mg.freeride","g")
- timer(7950,"mg.freeride","h")
- end
- end
- if mg.selgame==22 then
- if x==231 and player(id,"health")>0 then
- if player(id,"team")==1 then
- parse("trigger twin")
- else
- parse("trigger ctwin")
- end
- msg("©255255255"..player(id,"name").." has won the race for the "..mg.teams[player(id,"team")].."s!")
- end
- end
- end
- function mg.move(id,x,y)
- if id==mg.starman then
- local team={}
- local selfteam={}
- if player(id,"team")==1 then
- team=player(0,"team2living")
- selfteam=player(0,"team1living")
- else
- team=player(0,"team1living")
- selfteam=player(0,"team2living")
- end
- for i=1,#team do
- 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
- parse("customkill "..mg.starman.." STOMPED_ON "..team[i].."")
- end
- if math.random(1,2)==1 then
- parse("shake "..team[i].." "..math.random(1,5).."")
- end
- if #team<=2 or #selfteam<2 then
- parse("speedmod "..team[i].." -15")
- elseif #team==0 then
- parse("speedmod "..player(0,"table")[i].." 0")
- end
- end
- end
- end
- function mg.dualbombs()
- if mg.gametimer<=0 then
- local t=player(0,"team1living")
- local ct=player(0,"team2living")
- freehook("second","mg.dualbombs")
- mg.game=1
- parse("spawnitem 55 100 48")
- for i=1,#t do
- tp(t[i],math.random(99,104),53)
- parse("equip "..t[i].." 30")
- parse("setweapon "..t[i].." 30")
- end
- for i=1,#ct do
- tp(ct[i],math.random(99,104),28)
- parse("equip "..ct[i].." 32")
- parse("setweapon "..ct[i].." 32")
- end
- end
- end
- function mg.escort()
- if mg.gametimer<=0 then
- local t=player(0,"team1living")
- local ct=player(0,"team2living")
- freehook("second","mg.escort")
- mg.game=1
- for i=1,#t do
- tp(t[i],math.random(158,160),math.random(24,26))
- parse("equip "..t[i].." 22")
- parse("setweapon "..t[i].." 22")
- end
- for i=1,#ct do
- tp(ct[i],math.random(157,161),51)
- parse("equip "..ct[i].." 22")
- parse("setweapon "..ct[i].." 22")
- end
- end
- end
- function mg.pointtick()
- if mg.gametimer<=0 then
- local t=player(0,"team1living")
- local ct=player(0,"team2living")
- freehook("second","mg.pointtick")
- mg.game=1
- for i=1,#t do
- tp(t[i],math.random(154,156),math.random(76,78))
- parse("equip "..t[i].." 34")
- parse("setweapon "..t[i].." 34")
- end
- for i=1,#ct do
- tp(ct[i],math.random(162,164),math.random(84,86))
- parse("equip "..ct[i].." 34")
- parse("setweapon "..ct[i].." 34")
- end
- end
- end
- function mg.meleemadness()
- if mg.gametimer<=0 then
- local t=player(0,"tableliving")
- freehook("second","mg.meleemadness")
- mg.game=1
- for i=1,#t do
- tp(t[i],math.random(63,74),math.random(68,80))
- parse("equip "..t[i].." 78")
- parse("equip "..t[i].." 85")
- parse("setweapon "..t[i].." 78")
- end
- end
- end
- function mg.explosionwar()
- if mg.gametimer<=0 then
- local t=player(0,"team1living")
- local ct=player(0,"team2living")
- freehook("second","mg.explosionwar")
- mg.game=1
- for i=1,#t do
- tp(t[i],math.random(159,162),106)
- parse("equip "..t[i].." 49")
- parse("setweapon "..t[i].." 49")
- end
- for i=1,#ct do
- tp(ct[i],math.random(159,162),118)
- parse("equip "..ct[i].." 49")
- parse("setweapon "..ct[i].." 49")
- end
- end
- end
- function mg.flagging()
- if mg.gametimer<=0 then
- local t=player(0,"team1living")
- local ct=player(0,"team2living")
- freehook("second","mg.flagging")
- mg.game=1
- for i=1,#t do
- tp(t[i],math.random(29,33),81)
- parse("equip "..t[i].." 30")
- parse("setweapon "..t[i].." 30")
- end
- for i=1,#ct do
- tp(ct[i],math.random(29,33),65)
- parse("equip "..ct[i].." 32")
- parse("setweapon "..ct[i].." 32")
- end
- end
- end
- function mg.bunker()
- if mg.gametimer<=0 then
- local t=player(0,"team1living")
- local ct=player(0,"team2living")
- freehook("second","mg.bunker")
- mg.game=1
- for i=1,#t do
- tp(t[i],math.random(127,138),66)
- parse("equip "..t[i].." 74")
- parse("setweapon "..t[i].." 74")
- parse("setarmor "..t[i].." 201")
- end
- for i=1,#ct do
- tp(ct[i],math.random(127,138),90)
- parse("equip "..ct[i].." 74")
- parse("setweapon "..ct[i].." 74")
- parse("setarmor "..ct[i].." 201")
- end
- end
- end
- function mg.terraingain()
- if mg.gametimer<=0 then
- local t=player(0,"team1living")
- local ct=player(0,"team2living")
- freehook("second","mg.terraingain")
- mg.game=1
- for i=1,#t do
- tp(t[i],math.random(31,32),math.random(103,108))
- end
- for i=1,#ct do
- tp(ct[i],math.random(31,32),math.random(122,127))
- end
- end
- end
- function mg.shields()
- if mg.gametimer<=0 then
- local t=player(0,"tableliving")
- freehook("second","mg.shields")
- mg.game=1
- for i=1,#t do
- tp(t[i],math.random(124,135),math.random(118,129))
- parse("equip "..t[i].." 69")
- parse("equip "..t[i].." 41")
- parse("setweapon "..t[i].." 41")
- parse("strip "..t[i].." 50")
- end
- end
- end
- function mg.flamewar()
- if mg.gametimer<=0 then
- local t=player(0,"team1living")
- local ct=player(0,"team2living")
- freehook("second","mg.flamewar")
- mg.game=1
- for i=1,#t do
- tp(t[i],math.random(86,87),math.random(126,127))
- parse("equip "..t[i].." 46")
- parse("setweapon "..t[i].." 46")
- end
- for i=1,#ct do
- tp(ct[i],math.random(98,99),math.random(138,139))
- parse("equip "..ct[i].." 46")
- parse("setweapon "..ct[i].." 46")
- end
- end
- end
- function mg.starchase()
- if mg.gametimer<=0 then
- local t=player(0,"team1living")
- local ct=player(0,"team2living")
- freehook("second","mg.starchase")
- mg.game=1
- mg.star=1
- if math.random(1,2)==1 then
- for i=1,#t do
- tp(t[i],22,math.random(147,169))
- end
- for i=1,#ct do
- tp(ct[i],50,math.random(147,169))
- end
- else
- for i=1,#t do
- tp(t[i],50,math.random(147,169))
- end
- for i=1,#ct do
- tp(ct[i],22,math.random(147,169))
- end
- end
- end
- end
- function mg.darkroom()
- if mg.gametimer<=0 then
- local t=player(0,"team1living")
- local ct=player(0,"team2living")
- freehook("second","mg.darkroom")
- mg.game=1
- local r=math.random(1,5)
- local w=10
- if r==1 then
- w=math.random(10,11)
- elseif r==2 then
- w=math.random(20,24)
- elseif r==3 then
- w=30
- elseif r==5 then
- w=32
- elseif r==4 then
- w=math.random(38,40)
- end
- if math.random(1,2)==1 then
- for i=1,#t do
- tp(t[i],math.random(164,170),math.random(144,161))
- parse("equip "..t[i].." "..w.."")
- parse("setweapon "..t[i].." "..w.."")
- end
- for i=1,#ct do
- tp(ct[i],math.random(175,181),math.random(144,161))
- parse("equip "..ct[i].." "..w.."")
- parse("setweapon "..ct[i].." "..w.."")
- end
- else
- for i=1,#t do
- tp(t[i],math.random(175,181),math.random(144,161))
- parse("equip "..t[i].." "..w.."")
- parse("setweapon "..t[i].." "..w.."")
- end
- for i=1,#ct do
- tp(ct[i],math.random(164,170),math.random(144,161))
- parse("equip "..ct[i].." "..w.."")
- parse("setweapon "..ct[i].." "..w.."")
- end
- end
- end
- end
- function mg.explosives()
- if mg.gametimer<=0 then
- local t=player(0,"tableliving")
- freehook("second","mg.explosives")
- mg.game=1
- for i=1,#t do
- tp(t[i],math.random(129,134),math.random(155,160))
- end
- end
- end
- function mg.pistolpower()
- if mg.gametimer<=0 then
- local t=player(0,"team1living")
- local ct=player(0,"team2living")
- freehook("second","mg.pistolpower")
- mg.game=1
- for i=1,#t do
- tp(t[i],math.random(72,73),math.random(160,161))
- parse("equip "..t[i].." 2")
- parse("setweapon "..t[i].." 2")
- end
- for i=1,#ct do
- tp(ct[i],math.random(93,94),math.random(160,161))
- parse("equip "..ct[i].." 1")
- parse("setweapon "..ct[i].." 1")
- end
- end
- end
- function mg.riflerampage()
- if mg.gametimer<=0 then
- local t=player(0,"team1living")
- local ct=player(0,"team2living")
- freehook("second","mg.riflerampage")
- mg.game=1
- for i=1,#t do
- parse("equip "..t[i].." 30")
- parse("setweapon "..t[i].." 30")
- tp(t[i],math.random(192,194),math.random(25,27))
- end
- for i=1,#ct do
- parse("equip "..ct[i].." 32")
- parse("setweapon "..ct[i].." 32")
- tp(ct[i],math.random(215,217),math.random(44,46))
- end
- end
- end
- function mg.snipershotdown()
- if mg.gametimer<=0 then
- local t=player(0,"team1living")
- local ct=player(0,"team2living")
- freehook("second","mg.snipershotdown")
- mg.game=1
- if math.random(1,2)==1 then
- for i=1,#t do
- tp(t[i],math.random(195,200),math.random(63,65))
- parse("equip "..t[i].." 34")
- parse("equip "..t[i].." 35")
- parse("setweapon "..t[i].." 35")
- end
- for i=1,#ct do
- tp(ct[i],math.random(208,213),math.random(84,86))
- parse("equip "..ct[i].." 34")
- parse("equip "..ct[i].." 35")
- parse("setweapon "..ct[i].." 35")
- end
- else
- for i=1,#t do
- tp(t[i],math.random(208,213),math.random(84,86))
- parse("equip "..t[i].." 34")
- parse("equip "..t[i].." 35")
- parse("setweapon "..t[i].." 35")
- end
- for i=1,#ct do
- tp(ct[i],math.random(195,200),math.random(63,65))
- parse("equip "..ct[i].." 34")
- parse("equip "..ct[i].." 35")
- parse("setweapon "..ct[i].." 35")
- end
- end
- end
- end
- function mg.nadespam()
- if mg.gametimer<=0 then
- local t=player(0,"team1living")
- local ct=player(0,"team2living")
- freehook("second","mg.nadespam")
- mg.game=1
- if math.random(1,2)==1 then
- for i=1,#t do
- tp(t[i],25,math.random(192,198))
- end
- for i=1,#ct do
- tp(ct[i],37,math.random(192,198))
- end
- else
- for i=1,#t do
- tp(t[i],37,math.random(192,198))
- end
- for i=1,#ct do
- tp(ct[i],25,math.random(192,198))
- end
- end
- end
- end
- function mg.shotgunshuffle()
- if mg.gametimer<=0 then
- local t=player(0,"team1living")
- local ct=player(0,"team2living")
- freehook("second","mg.shotgunshuffle")
- mg.game=1
- for i=1,#t do
- tp(t[i],math.random(19,20),math.random(217,218))
- parse("equip "..t[i].." 10")
- parse("equip "..t[i].." 11")
- parse("setweapon "..t[i].." 10")
- end
- for i=1,#ct do
- tp(ct[i],math.random(33,34),math.random(229,230))
- parse("equip "..ct[i].." 10")
- parse("equip "..ct[i].." 11")
- parse("setweapon "..ct[i].." 10")
- end
- end
- end
- function mg.campersparadise()
- if mg.gametimer<=0 then
- local t=player(0,"team1living")
- local ct=player(0,"team2living")
- freehook("second","mg.campersparadise")
- mg.game=1
- for i=1,#t do
- tp(t[i],math.random(200,217),123)
- parse("equip "..t[i].." 37")
- parse("setweapon "..t[i].." 37")
- end
- for i=1,#ct do
- tp(ct[i],math.random(200,217),105)
- parse("equip "..ct[i].." 36")
- parse("setweapon "..ct[i].." 36")
- end
- end
- end
- function mg.winterwarfare()
- if mg.gametimer<=0 then
- local t=player(0,"team1living")
- local ct=player(0,"team2living")
- freehook("second","mg.winterwarfare")
- mg.game=1
- if math.random(1,2)==1 then
- for i=1,#t do
- tp(t[i],math.random(209,223),math.random(159,160))
- parse("equip "..t[i].." 75")
- parse("setweapon "..t[i].." 75")
- end
- for i=1,#ct do
- tp(ct[i],math.random(209,223),math.random(144,145))
- parse("equip "..ct[i].." 75")
- parse("setweapon "..ct[i].." 75")
- end
- else
- for i=1,#t do
- tp(t[i],math.random(209,223),math.random(144,145))
- parse("equip "..t[i].." 75")
- parse("setweapon "..t[i].." 75")
- end
- for i=1,#ct do
- tp(ct[i],math.random(209,223),math.random(159,160))
- parse("equip "..ct[i].." 75")
- parse("setweapon "..ct[i].." 75")
- end
- end
- end
- end
- function mg.gungroup()
- if mg.gametimer<=0 then
- local t=player(0,"team1living")
- local ct=player(0,"team2living")
- freehook("second","mg.gungroup")
- mg.game=1
- for i=1,#t do
- tp(t[i],math.random(51,53),math.random(231,233))
- end
- for i=1,#ct do
- tp(ct[i],math.random(66,68),math.random(218,220))
- end
- end
- end
- function mg.footrace()
- if mg.gametimer==1 then
- parse("sv_sound \"mat5b/raceintro.ogg\"")
- end
- if mg.gametimer<=0 then
- local t=player(0,"tableliving")
- freehook("second","mg.footrace")
- mg.game=1
- for i=1,#t do
- tp(t[i],89,191)
- end
- mg.rx=95*32+16
- mg.ry=189*32+16
- addhook("ms100","mg.racetrans")
- end
- end
- function mg.racetrans()
- if mg.rx>82*32+16 then
- mg.rx=mg.rx-16
- mg.ry=mg.ry-math.random(-2,2)
- for id=1,#player(0,"tableliving") do
- parse("setpos "..player(0,"tableliving")[id].." "..mg.rx.." "..mg.ry.."")
- end
- else
- local t=player(0,"tableliving")
- parse("trigger overlaponce")
- for i=1,#t do
- tp(t[i],82,math.random(180,196))
- mg.powerup[t[i]]=0
- end
- mg.pocketimg=image("gfx/mat5b/hud_powerup.png",320,413,2)
- imagealpha(mg.pocketimg,0)
- tween_alpha(mg.pocketimg,3000,1)
- tween_color(mg.pocketimg,3000,math.random(0,255),math.random(0,255),math.random(0,255))
- freehook("ms100","mg.racetrans")
- timer(900,"mg.racetranstwo","g")
- timer(1000,"mg.racetranstwo","d")
- timer(1900,"mg.racetranstwo","e")
- timer(2000,"mg.racetranstwo","r")
- timer(2900,"mg.racetranstwo","t")
- timer(3000,"mg.racetranstwo","y")
- timer(3900,"mg.racetranstwo","u")
- timer(4000,"mg.racetranstwo","i")
- end
- end
- function mg.racetranstwo(m)
- if m=="g" then
- mg.counter=image("gfx/mat5b/three.png",320,120,2)
- imagealpha(mg.counter,0)
- tween_alpha(mg.counter,100,1)
- tween_scale(mg.counter,100,2,2)
- elseif m=="d" then
- parse("sv_sound \"mat5b/three.ogg\"")
- tween_alpha(mg.counter,500,0)
- tween_scale(mg.counter,500,3,3)
- elseif m=="e" then
- freeimage(mg.counter)
- mg.counter=image("gfx/mat5b/two.png",320,120,2)
- imagealpha(mg.counter,0)
- tween_alpha(mg.counter,100,1)
- tween_scale(mg.counter,100,2,2)
- elseif m=="r" then
- parse("sv_sound \"mat5b/two.ogg\"")
- tween_alpha(mg.counter,500,0)
- tween_scale(mg.counter,500,3,3)
- elseif m=="t" then
- freeimage(mg.counter)
- mg.counter=image("gfx/mat5b/one.png",320,120,2)
- imagealpha(mg.counter,0)
- tween_alpha(mg.counter,100,1)
- tween_scale(mg.counter,100,2,2)
- elseif m=="y" then
- parse("sv_sound \"mat5b/one.ogg\"")
- tween_alpha(mg.counter,500,0)
- tween_scale(mg.counter,500,3,3)
- elseif m=="u" then
- freeimage(mg.counter)
- mg.counter=image("gfx/mat5b/go.png",320,120,2)
- imagealpha(mg.counter,0)
- tween_alpha(mg.counter,100,1)
- tween_scale(mg.counter,100,2,2)
- elseif m=="i" then
- parse("sv_sound \"mat5b/go.ogg\"")
- tween_alpha(mg.counter,500,0)
- tween_scale(mg.counter,500,3,3)
- timer(500,"mg.racetransthree")
- parse("trigger raceonce")
- for id=1,#player(0,"tableliving") do
- parse("speedmod "..player(0,"tableliving")[id].." 10")
- end
- end
- end
- function mg.racetransthree()
- freeimage(mg.counter)
- mg.counter=0
- end
- function mg.freeride(m)
- if m=="d" then
- freeimage(ring1)
- ring2=image("gfx/mat5b/wave.png",player(mg.starman,"x"),player(mg.starman,"y"),0)
- imagescale(ring2,0.1,0.1)
- tween_scale(ring2,2000,60,60)
- elseif m=="e" then
- freeimage(ring2)
- if player(mg.starman,"team")==1 then
- bigskin=image("gfx/mat5b/bigt"..(player(mg.starman,"look")+1)..".png",1,0,200+mg.starman)
- else
- bigskin=image("gfx/mat5b/bigct"..(player(mg.starman,"look")+1)..".png",1,0,200+mg.starman)
- end
- imagescale(bigskin,0.25,0.25)
- ring3=image("gfx/mat5b/wave1.png",player(mg.starman,"x"),player(mg.starman,"y"),1)
- imagescale(ring3,0.1,0.1)
- tween_scale(ring3,2000,60,60)
- elseif m=="f" then
- imagescale(bigskin,1.5,1.5)
- imagecolor(bigskin,128,128,128)
- imagealpha(bigskin,0.8,0.8)
- tween_alpha(ring3,3000,0)
- elseif m=="mini" then
- if player(mg.starman,"team")==1 then
- mini={}
- mini[1]=image("gfx/mat5b/bigt"..(player(mg.starman,"look")+1)..".png",player(mg.starman,"x")-600,player(mg.starman,"y")-30,1)
- mini[2]=image("gfx/mat5b/bigt"..(player(mg.starman,"look")+1)..".png",player(mg.starman,"x")-600,player(mg.starman,"y")-180,1)
- mini[3]=image("gfx/mat5b/bigt"..(player(mg.starman,"look")+1)..".png",player(mg.starman,"x")-600,player(mg.starman,"y")+80,1)
- mini[4]=image("gfx/mat5b/bigt"..(player(mg.starman,"look")+1)..".png",player(mg.starman,"x")-600,player(mg.starman,"y")+175,1)
- mini[5]=image("gfx/mat5b/bigt"..(player(mg.starman,"look")+1)..".png",player(mg.starman,"x")-600,player(mg.starman,"y")-105,1)
- else
- mini={}
- mini[1]=image("gfx/mat5b/bigct"..(player(mg.starman,"look")+1)..".png",player(mg.starman,"x")-600,player(mg.starman,"y")-30,1)
- mini[2]=image("gfx/mat5b/bigct"..(player(mg.starman,"look")+1)..".png",player(mg.starman,"x")-600,player(mg.starman,"y")-180,1)
- mini[3]=image("gfx/mat5b/bigct"..(player(mg.starman,"look")+1)..".png",player(mg.starman,"x")-600,player(mg.starman,"y")+80,1)
- mini[4]=image("gfx/mat5b/bigct"..(player(mg.starman,"look")+1)..".png",player(mg.starman,"x")-600,player(mg.starman,"y")+175,1)
- mini[5]=image("gfx/mat5b/bigct"..(player(mg.starman,"look")+1)..".png",player(mg.starman,"x")-600,player(mg.starman,"y")-105,1)
- end
- imagepos(mini[1],player(mg.starman,"x")-600,player(mg.starman,"y")-30,90)
- imagepos(mini[2],player(mg.starman,"x")-600,player(mg.starman,"y")-200,90)
- imagepos(mini[3],player(mg.starman,"x")-600,player(mg.starman,"y")+80,90)
- imagepos(mini[4],player(mg.starman,"x")-600,player(mg.starman,"y")+175,90)
- imagepos(mini[5],player(mg.starman,"x")-600,player(mg.starman,"y")-105,90)
- imagescale(mini[1],0.6,0.6)
- imagescale(mini[2],0.9,0.9)
- imagescale(mini[3],1.1,1.1)
- imagescale(mini[4],1.2,1.2)
- imagescale(mini[5],0.3,0.3)
- for g=1,5 do
- imagealpha(mini[g],0)
- end
- tween_move(mini[1],1000,player(mg.starman,"x")+140,player(mg.starman,"y")-30)
- tween_move(mini[2],1000,player(mg.starman,"x")-60,player(mg.starman,"y")-180)
- tween_move(mini[3],1000,player(mg.starman,"x")+40,player(mg.starman,"y")+80)
- tween_move(mini[4],1000,player(mg.starman,"x")-175,player(mg.starman,"y")+175)
- tween_move(mini[5],1000,player(mg.starman,"x")+10,player(mg.starman,"y")-105)
- for n=1,5 do
- tween_alpha(mini[n],1000,1)
- end
- elseif m=="minitwo" then
- tween_move(mini[1],1000,player(mg.starman,"x")+600,player(mg.starman,"y")-30)
- tween_move(mini[2],1000,player(mg.starman,"x")+600,player(mg.starman,"y")-180)
- tween_move(mini[3],1000,player(mg.starman,"x")+600,player(mg.starman,"y")+80)
- tween_move(mini[4],1000,player(mg.starman,"x")+600,player(mg.starman,"y")+175)
- tween_move(mini[5],1000,player(mg.starman,"x")+600,player(mg.starman,"y")-105)
- for i=1,5 do
- tween_alpha(mini[i],2000,0)
- end
- elseif m=="g" then
- tween_color(bigskin,1000,255,255,255)
- tween_alpha(bigskin,1000,1)
- elseif m=="h" then
- parse("trigger star1")
- local all=player(0,"tableliving")
- for i=1,#all do
- parse("speedmod "..all[i].." 1")
- end
- parse("speedmod "..mg.starman.." -10")
- addhook("move","mg.move")
- for d=1,5 do
- freeimage(mini[d])
- end
- mini={}
- end
- end
- addhook("second","mg.second")
- function mg.second()
- if mg.player~=0 and mg.game==0 and mg.gametimer<=0 and mg.selgame==0 then
- if mg.idletimer>0 then
- mg.idletimer=mg.idletimer-1
- elseif mg.idletimer<=0 then
- if math.random(1,2)==1 then
- msg("©255255255"..player(mg.player,"name").." took to long to choose a game!")
- tp(mg.player,24,23)
- timer(3000,"parse","trigger kabonce")
- timer(12000,"parse","trigger draw")
- else
- msg("©255255255"..player(mg.player,"name").." took to long to choose a game! Restarting...")
- parse("trigger draw")
- end
- mg.idletimer=mg.idletime
- end
- end
- if mg.gametimer>0 then
- mg.gametimer=mg.gametimer-1
- end
- if mg.selgame~=22 then
- if mg.gametimer==2 then
- parse("sv_sound \"mat5b/three.ogg\"")
- elseif mg.gametimer==1 then
- parse("sv_sound \"mat5b/two.ogg\"")
- elseif mg.gametimer==0 then
- if mg.plch==0 then
- parse("sv_sound \"mat5b/one.ogg\"")
- mg.plch=1
- elseif mg.plch==1 then
- parse("sv_sound \"mat5b/go.ogg\"")
- mg.plch=2
- end
- end
- end
- for id=1,#player(0,"tableliving") do
- if mg.hatdel[id]>0 then
- mg.hatdel[id]=mg.hatdel[id]-1
- end
- end
- end
- addhook("objectkill","mg.breaky")
- function mg.breaky(i,id)
- local x=object(i,"tilex")
- local y=object(i,"tiley")
- for a=1,#mg.breakablesx do
- if x==mg.breakablesx[a] and y==mg.breakablesy[a] then
- mg.score[id]=mg.score[id]+1
- if mg.score[id]==10 then
- mg.score[id]=0
- parse("setscore "..id.." "..(player(id,"score")+1).."")
- msg2(id,"©255255255Got a point!")
- else
- msg2(id,"©255255255"..(10-mg.score[id]).." left to get a point!")
- end
- end
- end
- end
- addhook("leave","mg.leave")
- function mg.leave(id)
- if id==mg.player then
- mg.player=0
- if mg.game==0 then
- parse("trigger draw")
- end
- end
- if id==mg.last then
- mg.last=0
- end
- if id==mg.next then
- mg.next=0
- end
- if id==mg.starman then
- mg.star=0
- mg.starman=0
- freehook("move","mg.move")
- freetimer()
- parse("trigger draw")
- end
- mg.score[id]=0
- mg.hatdel[id]=0
- if mg.hatimg[id]~=0 then
- freeimage(mg.hatimg[id])
- end
- mg.hatimg[id]=0
- mg.hat[id]=0
- if mg.powerupimg[id]~=0 then
- freeimage(mg.powerupimg[id])
- end
- mg.powerupimg[id]=0
- mg.powerup[id]=0
- end
- addhook("team","mg.team")
- function mg.team(id,t)
- if id==mg.last then
- mg.last=0
- end
- if id==mg.next then
- mg.next=0
- end
- if id==mg.starman then
- mg.star=0
- mg.starman=0
- parse("trigger draw")
- end
- mg.score[id]=0
- mg.hatdel[id]=0
- if mg.hatimg[id]~=0 then
- freeimage(mg.hatimg[id])
- end
- mg.hatimg[id]=0
- end
- addhook("spawn","mg.spawn")
- function mg.spawn(id)
- if mg.game==1 then
- parse("customkill "..id.." NO_RESPAWNING_AFTER_A_GAME_STARTS "..id.."")
- end
- end
- addhook("objectupgrade","mg.objectupgrade")
- function mg.objectupgrade(i,id,p)
- if tonumber(object(i,"type"))==9 and p>=20 then
- local x=object(i,"tilex")
- local y=object(i,"tiley")
- parse("killobject "..i)
- parse("spawnobject 15 "..x.." "..y.." 0 1 "..player(id,"team").." "..id)
- if player(id,"team")==1 then
- parse('effect "colorsmoke" '..(x*32+16)..' '..(y*32+16)..' 1 1 255 0 0')
- else
- parse('effect "colorsmoke" '..(x*32+16)..' '..(y*32+16)..' 1 1 0 0 255')
- end
- end
- end
- addhook("usebutton","mg.usebutton")
- function mg.usebutton(id,x,y)
- if x==12 and y==34 then
- 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")
- end
- end
- addhook("triggerentity","mg.triggerentity")
- function mg.triggerentity(x,y)
- if (x==97 and y==94) or (x==103 and y==102) then
- local r=math.random(1,3)
- if r==1 then
- msg2(mg.player,"©255255255A horrible chill goes down your spine...")
- elseif r==2 then
- msg2(mg.player,"©255255255You feel an evil presence watching you...")
- else
- msg2(mg.player,"©255255255Screams echo around you...")
- end
- end
- end
- addhook("menu","mg.menu")
- function mg.menu(id,m,s)
- if m=="Hat Dispenser Menu" then
- if s==1 then
- if mg.hatimg[id]~=0 then
- freeimage(mg.hatimg[id])
- end
- mg.hatimg[id]=0
- elseif s>=2 and s<=9 then
- if player(id,"score")>=mg.prices[s-1] then
- if mg.hatimg[id]~=0 then
- freeimage(mg.hatimg[id])
- end
- mg.hat[id]=s-1
- if mg.hat[id]~=1 and mg.hat[id]~=2 and mg.hat[id]~=7 then
- mg.hatimg[id]=image("gfx/mat5b/hat_"..(s-1)..".png",1,0,200+id)
- else
- mg.hatimg[id]=image("gfx/mat5b/hat_"..(s-1).."_r.png",1,0,200+id)
- end
- if mg.game==1 or mg.gametimer>0 then
- imagealpha(mg.hatimg[id],mg.hattrans)
- else
- imagealpha(mg.hatimg[id],1.0)
- end
- parse("setscore "..id.." "..player(id,"score")-mg.prices[s-1])
- else
- msg2(id,"©255255255Not enough score!")
- end
- end
- end
- end
- addhook("die","mg.die")
- function mg.die(id)
- if player(id,"team")>0 and #player(0,"team"..player(id,"team").."living")>1 and mg.game==1 then
- parse("sv_sound2 "..id.." \"mat5b/die_"..math.random(1,5)..".ogg\"")
- end
- if id==mg.player and mg.game==0 then
- mg.player=0
- parse("trigger draw")
- end
- if id==mg.starman then
- mg.star=0
- mg.starman=0
- freehook("move","mg.move")
- freetimer()
- parse("trigger draw")
- end
- mg.hatdel[id]=0
- if mg.hatimg[id]~=0 then
- freeimage(mg.hatimg[id])
- end
- mg.hatimg[id]=0
- end
- addhook("say","mg.say",2)
- function mg.say(id,t)
- if t=="!credits" or t=="!CREDITS" then
- msg2(id,"©255255255Multigame 2, a project by mat5b (BetaM) and BartNixon")
- msg2(id,"©255255255Thanks go out to the following people: KimKat (inspiration), BlazingEyed (long term graditude)")
- msg2(id,"©255255255The people who provided useful feedback & suggestions: Mane22, Left 4 n00b, Darknob")
- msg2(id,"©255255255And the following testers: pepetime, RICO, Apf3l, SuperNova, DarqKniFe,")
- msg2(id,"©255255255×Ðø©tø®×, »Pro Ninja«, <<<<<<NuNz>>>>>>, turk, Pa[TR]oN,")
- msg2(id,"©255255255x.Joker.x, Player (the one that has an USGN ID)")
- msg2(id,"©255255255If you can't see the credits, open the console (or beat the boss (coming soon))")
- return 1
- elseif t=="!settings" or t=="!SETTINGS" then
- msg2(id,"©255255255Multigame Setttings:")
- msg2(id,"©255255255Scrambling: "..mg.scram.." (1-on; 0-off)")
- msg2(id,"©255255255Scramble rounds: "..mg.winrow.." rounds")
- msg2(id,"©255255255Special Games Cap: "..mg.specialcap.." rounds")
- msg2(id,"©255255255Idle time for the choosing player: "..mg.idletime.." seconds")
- msg2(id,"©255255255Powerup removal: "..mg.removepowerups.." (1-on; 0-off)")
- return 1
- end
- if mg.specialchat==1 then
- if player(id,"usgn")==8235 then
- if t=="rank" then
- return 0
- else
- rcol()
- if player(id,"team")>0 then
- msg(""..mg.palette[math.random(1,#mg.palette)].."["..mg.teams[player(id,"team")].."] mat5b (Designer): "..t)
- else
- msg(""..mg.palette[math.random(1,#mg.palette)].."[Spec] mat5b (Designer): "..t)
- end
- return 1
- end
- elseif player(id,"usgn")==11148 then
- if t=="rank" then
- return 0
- else
- rcol()
- if player(id,"team")>0 then
- msg(""..mg.palette[math.random(1,#mg.palette)].."["..mg.teams[player(id,"team")].."] BartNixon (Designer): "..t)
- else
- msg(""..mg.palette[math.random(1,#mg.palette)].."[Spec] BartNixon (Designer): "..t)
- end
- return 1
- end
- end
- if player(id,"rcon") then
- if t=="rank" then
- return 0
- else
- rcol()
- if player(id,"team")>0 then
- msg(""..mg.palette[math.random(1,#mg.palette)].."["..mg.teams[player(id,"team")].."] "..player(id,"name")..": "..t)
- else
- msg(""..mg.palette[math.random(1,#mg.palette)].."[Spec] "..player(id,"name")..": "..t)
- end
- return 1
- end
- end
- end
- end
- addhook("walkover","mg.walkover")
- function mg.walkover(id,iid,w)
- if w==75 and mg.selgame==22 and mg.powerupimg[id]==0 then
- mg.powerupimg[id]=image("gfx/mat5b/hud_unknown.png",320,420,2,id)
- imagecolor(mg.powerupimg[id],math.random(50,255),math.random(50,255),math.random(50,255))
- parse("sv_sound2 "..id.." \"items/pickup.wav\"")
- parse('effect "flare" '..player(id,"x")..' '..player(id,"y")..' 1 3 '..math.random(50,255)..' '..math.random(50,255)..' '..math.random(50,255)..'')
- timer(3000,"mg.genpower",""..id.."")
- parse("removeitem "..iid)
- return 1
- end
- if w==75 and mg.selgame==22 and mg.powerupimg[id]~=0 then
- if mg.removepowerups==1 then
- parse("removeitem "..iid)
- end
- return 1
- end
- end
- function mg.genpower(i)
- local id=tonumber(i)
- freeimage(mg.powerupimg[id])
- mg.powerup[id]=mg.powerups[math.random(1,#mg.powerups)]
- mg.powerupimg[id]=image("gfx/mat5b/power_"..itemtype(mg.powerup[id],"name")..".png",320,420,2,id)
- parse("sv_sound2 "..id.." \"mat5b/powerup_chime.ogg\"")
- end
- if mg.rconcommands==1 then
- addhook("rcon","mg.rconcom")
- addhook("parse","mg.rconcom")
- end
- function mg.rconcom(t,id)
- if t:find("mg_next") then
- local d=tonumber(t:sub(9))
- if d~=0 and d~=nil then
- if player(d,"exists") and player(d,"team")>0 then
- mg.next=d
- msg("©255255255The next choosing player has been changed to ("..mg.teams[player(mg.player,"team")]..") "..player(d,"name").."!")
- else
- if id~=nil then
- msg2(id,"©255255255Player doesn't exist!")
- else
- print("©255255255Player doesn't exist!")
- end
- end
- else
- if d~=nil then
- if id~=nil then
- msg2(id,"©255255255Invalid ID! (it must be a number)")
- else
- print("©255255255Invalid ID! (it must be a number)")
- end
- else
- if id~=nil then
- msg2(id,"©255255255The next player is ("..mg.teams[player(mg.player,"team")]..") "..player(mg.next,"name").."")
- else
- print("©255255255The next player is ("..mg.teams[player(mg.player,"team")]..") "..player(mg.next,"name").."")
- end
- end
- end
- return 1
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement