• GM: Blah is causing errors
    20 replies, posted
I'm very new to lua , and I've been trying out a script , but it keeps not loading on me. Because of GM: stuff. here's a line from init.lua which is considered an error: [code] function GM:PlayerInitialSpawn( ply ) [/code] Then here's the area from shared [code]GM.Name = "inputhere" GM.Author = "Instant Mix" GM.Email = "hoopdedoo@hotmail.co.uk" GM.Website = "N/A" --Set the atuhor's nose [/code] For some reason these are causing errors. Why?
Please list the errors
Unless you are defining a gamemode you can not use the GM syntax. You would have to use [url=http://wiki.garrysmod.com/?title=hook.Add]hook.Add[/url] for it. If it really is a gamemode make sure you are running it as one, not just opening it once ingame.
Which file are you putting these functions? shared, init or cl_init?
[QUOTE=Justin37111;18138035]Please list the errors[/QUOTE] Working on it. I remember it just didn't like the GM part of it. [editline]03:56PM[/editline] [QUOTE=Crazy Quebec;18140079]Unless you are defining a gamemode you can not use the GM syntax. You would have to use [url=http://wiki.garrysmod.com/?title=hook.Add]hook.Add[/url] for it. If it really is a gamemode make sure you are running it as one, not just opening it once ingame.[/QUOTE] I'm running it as a gamemode. [editline]03:57PM[/editline] [QUOTE=Helix Alioth;18143296]Which file are you putting these functions? shared, init or cl_init?[/QUOTE] like totally don't read my post. It clearly says " in init.lua it says" and "in shared"
Post the entire code and the error or we obviously can't help. We aren't mind readers.
Without seeing the code, you've most likely fucked up above PlayerInitialSpawn and that's where its catching the error.
cl_init.lua [code] include( 'shared.lua' ) --Tell the client to load shared.lua function set_team() local frame = vgui.Create( "DFrame" ) frame:SetPos( ScrW() / 2 + ((ScrW() / 2)-(frame:GetWide() / 2)),ScrH() / 2 + ((ScrH() / 2)-(frame:GetTall() / 2)) ) --Set the window in the middle of the players screen/game window frame:SetSize( ScrW() / 2, ScrH() / 2) --Set the size frame:SetTitle( "Set Side" ) --Set title frame:SetVisible( true ) frame:SetDraggable( false ) frame:ShowCloseButton( true ) frame:MakePopup() team_1 = vgui.Create( "DButton", frame ) team_1:SetPos( frame:GetTall() / 2,frame:GetWide() / 3 + 32 ) --Place it half way on the tall and 5 units in horizontal team_1:SetSize( 25, 50 ) team_1:SetText( "Amplus" ) team_1.DoClick = function() --Make the player join team 1 RunConsoleCommand( "team_1" ) end team_2 = vgui.Create( "DButton", frame ) team_2:SetPos( frame:GetTall() / 2, frame:GetWide() / 2 ) --Place it next to our previous one team_2:SetSize( 50, 100 ) team_2:SetText( "Vektor" ) team_2.DoClick = function() --Make the player join team 2 RunConsoleCommand( "team_2" ) end team_3 = vgui.Create( "DButton", frame ) team_3:SetPos( frame:GetTall() / 2, frame:GetWide() - 32 ) --Place it next to our previous one team_3:SetSize( 50, 100 ) team_3:SetText( "Spectate" ) team_3.DoClick = function() --Make the player join team 2 RunConsoleCommand( "team_3" ) end concommand.Add( "team_menu", set_team) end function PlyrVew( ply, origin, angles, fov ) local view = {} view.origin = PlyrGlobVew view.angles = angles + Angle(65,0,0) return view end -- ALL THE SHIT IN HERE IS ABOUT DAT SHIT ABOUT MOVIN YOUR VIEW DAWG -- THIS BE MAKIN YO VIEW GO LEFT MOTHERFUCKA function ViewThink() if gui.MouseX <= 32 then if (CurTime() >= NextPrintTime) then PlyrGlobVew = PlyrGlobVew - Vector(4,0,0) NextPrintTime = CurTime() + 0.1 end end end -- THIS BE MAKIN YO VIEW GO RIGHT MOTHERFUCKA function ViewThink() if gui.MouseX >= ScrW - 32 then if (CurTime() >= NextPrintTime) then PlyrGlobVew = PlyrGlobVew + Vector(4,0,0) NextPrintTime = CurTime() + 0.1 end end end -- THIS BE MAKIN YO VIEW GO UP MOTHERFUCKA function ViewThink() if gui.MouseY <= 32 then if (CurTime() >= NextPrintTime) then PlyrGlobVew = PlyrGlobVew - Vector(0,4,0) NextPrintTime = CurTime() + 0.1 end end end -- THIS BE MAKIN YO VIEW GO DOWN MOTHERFUCKA function ViewThink() if gui.MouseX >= ScrH - 32 then if (CurTime() >= NextPrintTime) then PlyrGlobVew = PlyrGlobVew + Vector(0,32,0) NextPrintTime = CurTime() + 0.1 end end end -- DIS BE DE END OF DAT SHIT YO -- DIS BE DA START OF DEM HOOKS ND VARIABLES DAWG hook.Add("Think", "ViewThink", ViewThink) gui.EnableScreenClicker( true) hook.Add("CalcView", "PlyrVew", PlyrVew) NextPrintTime = 0 [/code] init.lua [code]AddCSLuaFile( "cl_init.lua" ) --Tell the server that the client needs to download cl_init.lua AddCSLuaFile( "shared.lua" ) --Tell the server that the client needs to download shared.lua include( 'shared.lua' ) --Tell the server to load shared.lua function GM:PlayerInitialSpawn( ply ) ply:SetTeam( 4 ) --Add the player to team 4 end --End the "when player first joins server and spawns" function function team_1( ply ) ply:SetTeam( 1 ) end function team_2( ply ) ply:SetTeam( 2 ) end function team_3( ply ) ply:SetTeam( 3 ) end if ply:Team() == 1 then ply:ChatPrint( "Hello Commander. You have chosen the wise deicision to choose the Amplus team. We Wish you luck.") end if ply:Team() == 2 then ply:ChatPrint( "Welcome Comrade! You have selected Vektor as your side! I have to say , even I couldn't make decisions that good!") end if ply:Team() == 2 then ply:ChatPrint( "You are spectating the Match. Don't be an idiot and give away the position of the Amplus armies to Vektor.") end concommand.Add( "team_1", team_1 ) concommand.Add( "team_2", team_2 ) concommand.Add( "team_3", team_3 ) PlyrGlobVew = Vector(0,0,0) [/code] shared.lua [code]GM.Name = "gRTS" GM.Author = "Instant Mix" GM.Email = "hoopdedoo@hotmail.co.uk" GM.Website = "N/A" --Set the atuhor's nose team.SetUp( 3, "Spectator", Color( 125, 125, 125, 255 ) ) --Here we make the team Guests team.SetUp( 1, "Amplus", Color( 255, 0, 0, 255 ) ) --Here we make the team Amplus team.SetUp( 2, "Vektor", Color( 0, 0, 255, 255) ) -- Here we make the team Vektor team.SetUp( 4, "Joining", Color( 0, 255, 0, 255) ) -- Here we make the team those bastards who haven't decided yet [/code] [editline]11:15PM[/editline] [QUOTE=| FlapJack |;18150988]Post the entire code and the error or we obviously can't help. We aren't mind readers.[/QUOTE] seriously? I thought FP meant [b]fantastic psychics [/b]
Your making several functions named "Viewthink".
Not sure if this will work but instead of [Quote]function GM:PlayerInitialSpawn( ply ) ply:SetTeam( 4 ) --Add the player to team 4 end --End the "when player first joins server and spawns" function[/Quote] try [Quote]function GM:PlayerInitialSpawn( ply ) self.BaseClass:PlayerInitialSpawn( ply ) ply:SetTeam( 4 ) --Add the player to team 4 end --End the "when player first joins server and spawns" function[/Quote]
and else, try: function GAMEMODE:Init() ^^
We still don't know what the error is.
It just doesn't recognize GM
I neatened your code. [lua]include( 'shared.lua' ) --Tell the client to load shared.lua function set_team() local frame = vgui.Create( "DFrame" ) frame:SetSize( ScrW() / 2, ScrH() / 2) --Set the size frame:SetTitle( "Set Side" ) --Set title frame:SetVisible( true ) frame:SetDraggable( false ) frame:ShowCloseButton( true ) frame:Center() -- Who knew it was that easy ;) frame:MakePopup() team_1 = vgui.Create( "DButton", frame ) team_1:SetPos( frame:GetTall() / 2,frame:GetWide() / 3 + 32 ) --Place it half way on the tall and 5 units in horizontal team_1:SetSize( 25, 50 ) team_1:SetText( "Amplus" ) team_1.DoClick = function() --Make the player join team 1 RunConsoleCommand( "team_1" ) frame:Close() end team_2 = vgui.Create( "DButton", frame ) team_2:SetPos( frame:GetTall() / 2, frame:GetWide() / 2 ) --Place it next to our previous one team_2:SetSize( 50, 100 ) team_2:SetText( "Vektor" ) team_2.DoClick = function() --Make the player join team 2 RunConsoleCommand( "team_2" ) frame:Close() end team_3 = vgui.Create( "DButton", frame ) team_3:SetPos( frame:GetTall() / 2, frame:GetWide() - 32 ) --Place it next to our previous one team_3:SetSize( 50, 100 ) team_3:SetText( "Spectate" ) team_3.DoClick = function() --Make the player join team 2 RunConsoleCommand( "team_3" ) frame:Close() end concommand.Add( "team_menu", set_team) end function PlyrVew( ply, origin, angles, fov ) local view = {} view.origin = PlyrGlobVew view.angles = angles + Angle(65,0,0) return view end hook.Add("CalcView", "PlyrVew", PlyrVew) -- ALL THE SHIT IN HERE IS ABOUT DAT SHIT ABOUT MOVIN YOUR VIEW DAWG -- THIS BE MAKIN YO VIEW GO LEFT MOTHERFUCKA function ViewThink1() if gui.MouseX <= 32 then if (CurTime() >= NextPrintTime) then PlyrGlobVew = PlyrGlobVew - Vector(4,0,0) NextPrintTime = CurTime() + 0.1 end end end -- THIS BE MAKIN YO VIEW GO RIGHT MOTHERFUCKA function ViewThink2() if gui.MouseX >= ScrW - 32 then if (CurTime() >= NextPrintTime) then PlyrGlobVew = PlyrGlobVew + Vector(4,0,0) NextPrintTime = CurTime() + 0.1 end end end -- THIS BE MAKIN YO VIEW GO UP MOTHERFUCKA function ViewThink3() if gui.MouseY <= 32 then if (CurTime() >= NextPrintTime) then PlyrGlobVew = PlyrGlobVew - Vector(0,4,0) NextPrintTime = CurTime() + 0.1 end end end -- THIS BE MAKIN YO VIEW GO DOWN MOTHERFUCKA function ViewThink4() if gui.MouseX >= ScrH - 32 then if (CurTime() >= NextPrintTime) then PlyrGlobVew = PlyrGlobVew + Vector(0,32,0) NextPrintTime = CurTime() + 0.1 end end end -- DIS BE DE END OF DAT SHIT YO -- DIS BE DA START OF DEM HOOKS ND VARIABLES DAWG for i = 1 , 4 do hook.Add("Think" , "ViewThink" , _G["ViewThink"..i]) -- This should work :3 If not, add a hook for each end gui.EnableScreenClicker( true) NextPrintTime = 0[/lua] [lua]AddCSLuaFile( "cl_init.lua" ) --Tell the server that the client needs to download cl_init.lua AddCSLuaFile( "shared.lua" ) --Tell the server that the client needs to download shared.lua include( 'shared.lua' ) --Tell the server to load shared.lua function GM:PlayerInitialSpawn( ply ) ply:SetTeam( 4 ) --Add the player to team 4 end --End the "when player first joins server and spawns" function function team_1( ply ) ply:SetTeam( 1 ) end concommand.Add( "team_1", team_1 ) function team_2( ply ) ply:SetTeam( 2 ) end concommand.Add( "team_2", team_2 ) function team_3( ply ) ply:SetTeam( 3 ) end concommand.Add( "team_3", team_3 ) local Message = {} Message[1] = "Hello Commander. You have chosen the wise deicision to choose the Amplus team. We Wish you luck." Message[2] = "Welcome Comrade! You have selected Vektor as your side! I have to say , even I couldn't make decisions that good!" Message[3] = "You are spectating the Match. Don't be an idiot and give away the position of the Amplus armies to Vektor." for i = 1 , 3 do if ply:Team() == i then ply:ChatPrint(Message[i]) end end PlyrGlobVew = Vector(0,0,0)[/lua] [lua]GM = GM or GAMEMODE -- This shouldn't be necissary(sp?) GM.Name = "gRTS" GM.Author = "Instant Mix" GM.Email = "hoopdedoo@hotmail.co.uk" GM.Website = "N/A" --Set the atuhor's nose team.SetUp( 3, "Spectator", Color( 125, 125, 125, 255 ) ) --Here we make the team Guests team.SetUp( 1, "Amplus", Color( 255, 0, 0, 255 ) ) --Here we make the team Amplus team.SetUp( 2, "Vektor", Color( 0, 0, 255, 255) ) -- Here we make the team Vektor team.SetUp( 4, "Joining", Color( 0, 255, 0, 255) ) -- Here we make the team those bastards who haven't decided yet[/lua]
Ah. Thanks alot dude. I'll see if it works. Unfortunately , I've got to do a planometric drawing for Graphic communication. I'll report back in ~30 mins
[QUOTE=Hemroid_Man;18170369]Ah. Thanks alot dude. I'll see if it works. Unfortunately , I've got to do a planometric drawing for Graphic communication. I'll report back in ~30 mins[/QUOTE] I added a few things which I haven't even tried myself yet - the _G[funcname] stuff. You might need to change that.
If its not recognizing GM then you don't have your code in the proper place. i.e. you didn't construct your gamemode folder properly or you don't have this in a gamemode at all. Post gamemode initialization you can only access the gamemode table with GAMEMODE, not GM.
It's still chucking out errors. It's saying "GM is a nil value" Also it's giving an error reference to "ply" on line so and so , and on that line the only word on it is END. So that makes no sense. Changed the code. Anything you think should be changed? cl_init.lua [code]include( 'shared.lua' ) --Tell the client to load shared.lua function set_team() local frame = vgui.Create( "DFrame" ) frame:SetSize( 150, 86) --Set the size frame:SetTitle( "Set Side" ) --Set title frame:SetVisible( true ) frame:SetDraggable( false ) frame:ShowCloseButton( true ) frame:Center() -- Who knew it was that easy ;) frame:MakePopup() team_1 = vgui.Create( "DButton", frame ) team_1:SetPos( 0, 32 ) --Place it half way on the tall and 5 units in horizontal team_1:SetSize( 48, 30 ) team_1:SetText( "Amplus" ) team_1.DoClick = function() --Make the player join team 1 RunConsoleCommand( "team_1" ) frame:Close() end team_2 = vgui.Create( "DButton", frame ) team_2:SetPos( 50, 32) --Place it next to our previous one team_2:SetSize( 48, 30 ) team_2:SetText( "Vektor" ) team_2.DoClick = function() --Make the player join team 2 RunConsoleCommand( "team_2" ) frame:Close() end team_3 = vgui.Create( "DButton", frame ) team_3:SetPos( 100, 32 ) --Place it next to our previous one team_3:SetSize( 48, 30 ) team_3:SetText( "Spectate" ) team_3.DoClick = function() --Make the player join team 2 RunConsoleCommand( "team_3" ) frame:Close() end end concommand.Add( "team_menu", set_team) function PlyrVew( origin, angles, fov ) local view = {} view.origin = PlyrGlobVew view.angles = angles + Angle(-65,0,0) return view end hook.Add("CalcView", "PlyrVew", PlyrVew) -- ALL THE SHIT IN HERE IS ABOUT DAT SHIT ABOUT MOVIN YOUR VIEW DAWG -- THIS BE MAKIN YO VIEW GO LEFT MOTHERFUCKA function GoLeft() if gui.MouseX() <= 64 then if (CurTime() >= NextPrintTime) then PlyrGlobVew = PlyrGlobVew - Vector(2,0,0) NextPrintTime = CurTime() + 0.001 end end end -- THIS BE MAKIN YO VIEW GO RIGHT MOTHERFUCKA function GoRight() if gui.MouseX() >= (ScrW() - 64) then if (CurTime() >= NextPrintTime) then PlyrGlobVew = PlyrGlobVew + Vector(2,0,0) NextPrintTime = CurTime() + 0.001 end end end -- THIS BE MAKIN YO VIEW GO UP MOTHERFUCKA function GoUp() if gui.MouseY() <= 64 then if (CurTime() >= NextPrintTime) then PlyrGlobVew = PlyrGlobVew + Vector(0,2,0) NextPrintTime = CurTime() + 0.001 end end end -- THIS BE MAKIN YO VIEW GO DOWN MOTHERFUCKA function GoDown() if gui.MouseY() >= (ScrH() - 64) then if (CurTime() >= NextPrintTime) then PlyrGlobVew = PlyrGlobVew - Vector(0,2,0) NextPrintTime = CurTime() + 0.001 end end end -- THIS BE MAKIN YO VIEW GO UP N' LEFT MOTHERFUCKA function GoUpL() if gui.MouseX <= 64 and gui.MouseY <= 64 then if (CurTime() >= NextPrintTime) then PlyrGlobVew = PlyrGlobVew + Vector(2,-2,0) NextPrintTime= CurTime() + 0.001 end end end -- THIS BE MAKIN YO VIEW GO UP N' RIGHT MOTHERFUCKA function GoUpL() if gui.MouseX >= 64 and gui.MouseY >= (ScrW() - 64) then if (CurTime() >= NextPrintTime) then PlyrGlobVew = PlyrGlobVew + Vector(2,2,0) NextPrintTime= CurTime() + 0.001 end end end -- THIS BE MAKIN YO VIEW GO DOWN N' LEFT MOTHERFUCKA function GoUpL() if gui.MouseX <= (ScrH() - 64) and gui.MouseY <= 64 then if (CurTime() >= NextPrintTime) then PlyrGlobVew = PlyrGlobVew + Vector(-2,-2,0) NextPrintTime= CurTime() + 0.001 end end end -- THIS BE MAKIN YO VIEW GO DOWN N' RIGHT MOTHERFUCKA function GoUpL() if gui.MouseX <= (ScrH() - 64) and gui.MouseY <= (ScrW() - 64) then if (CurTime() >= NextPrintTime) then PlyrGlobVew = PlyrGlobVew + Vector(-2,2,0) NextPrintTime= CurTime() + 0.001 end end end -- DIS BE DE END OF DAT SHIT YO -- DIS BE DA START OF DEM HOOKS ND VARIABLES DAWG hook.Add("Think" , "GoUp" , GoUp) hook.Add("Think" , "GoDown" , GoDown) hook.Add("Think" , "GoLeft" , GoLeft) hook.Add("Think" , "GoRight" , GoRight) hook.Add("Think" , "GoUpL" , GoUpL) hook.Add("Think" , "GoUpR" , GoUpR) hook.Add("Think" , "GoDwl" , GoDwL) hook.Add("Think" , "GoDwr" , GoDwr) gui.EnableScreenClicker( true) NextPrintTime = 0 PlyrGlobVew = Vector(0,0,256) if ply:Team() > 1 then local frame = vgui.Create( "Sidebar" ) frame:SetSize( 70, ScrH()) --Set the size frame:SetTitle( "BATTLEFIELD CONTROL" ) --Set title frame:SetVisible( true ) frame:SetDraggable( false ) frame:ShowCloseButton( true ) frame:setPos(0,(ScrH()-70)) frame:MakePopup() end[/code] init.lua [code]AddCSLuaFile( "cl_init.lua" ) --Tell the server that the client needs to download cl_init.lua AddCSLuaFile( "shared.lua" ) --Tell the server that the client needs to download shared.lua include( 'shared.lua' ) --Tell the server to load shared.lua function GM:PlayerInitialSpawn( ply ) ply:SetTeam( 4 ) --Add the player to team 4 end --End the "when player first joins server and spawns" function function team_1( ply ) ply:SetTeam( 1 ) end concommand.Add( "team_1", team_1 ) function team_2( ply ) ply:SetTeam( 2 ) end concommand.Add( "team_2", team_2 ) function team_3( ply ) ply:SetTeam( 3 ) end concommand.Add( "team_3", team_3 ) local Message = {} Message[1] = "Hello Commander. You have chosen the wise deicision to choose the Amplus team. We Wish you luck." Message[2] = "Welcome Comrade! You have selected Vektor as your side! I have to say , even I couldn't make decisions that good!" Message[3] = "You are spectating the Match. Don't be an idiot and give away the position of the Amplus armies to Vektor." for i = 1 , 3 do if ply:Team() == i then ply:ChatPrint(Message[i]) end end PlyrGlobVew = Vector(0,0,64)[/code] shared.lua [code]GM = GAMEMODE -- This shouldn't be necissary(sp?) GM.Name = "gRTS" GM.Author = "Instant Mix" GM.Email = "hoopdedoo@hotmail.co.uk" GM.Website = "N/A" --Set the atuhor's nose team.SetUp( 3, "Spectator", Color( 125, 125, 125, 255 ) ) --Here we make the team Guests team.SetUp( 1, "Amplus", Color( 255, 0, 0, 255 ) ) --Here we make the team Amplus team.SetUp( 2, "Vektor", Color( 0, 0, 255, 255) ) -- Here we make the team Vektor team.SetUp( 4, "Joining", Color( 0, 255, 0, 255) ) -- Here we make the team those bastards who haven't decided yet [/code]
Have you derived the gamemode from Sandbox or the base?
[QUOTE=Hemroid_Man;18285481][code]include( 'shared.lua' ) --Tell the client to load shared.lua function set_team() local frame = vgui.Create( "DFrame" ) frame:SetSize( 150, 86) --Set the size frame:SetTitle( "Set Side" ) --Set title frame:SetVisible( true ) frame:SetDraggable( false ) frame:ShowCloseButton( true ) frame:Center() -- Who knew it was that easy ;) frame:MakePopup() team_1 = vgui.Create( "DButton", frame ) team_1:SetPos( 0, 32 ) --Place it half way on the tall and 5 units in horizontal team_1:SetSize( 48, 30 ) team_1:SetText( "Amplus" ) team_1.DoClick = function() --Make the player join team 1 RunConsoleCommand( "team_1" ) frame:Close() end team_2 = vgui.Create( "DButton", frame ) team_2:SetPos( 50, 32) --Place it next to our previous one team_2:SetSize( 48, 30 ) team_2:SetText( "Vektor" ) team_2.DoClick = function() --Make the player join team 2 RunConsoleCommand( "team_2" ) frame:Close() end team_3 = vgui.Create( "DButton", frame ) team_3:SetPos( 100, 32 ) --Place it next to our previous one team_3:SetSize( 48, 30 ) team_3:SetText( "Spectate" ) team_3.DoClick = function() --Make the player join team 2 RunConsoleCommand( "team_3" ) frame:Close() end end concommand.Add( "team_menu", set_team) function PlyrVew( origin, angles, fov ) local view = {} view.origin = PlyrGlobVew view.angles = angles + Angle(-65,0,0) return view end hook.Add("CalcView", "PlyrVew", PlyrVew) -- ALL THE SHIT IN HERE IS ABOUT DAT SHIT ABOUT MOVIN YOUR VIEW DAWG -- THIS BE MAKIN YO VIEW GO LEFT MOTHERFUCKA function GoLeft() if gui.MouseX() <= 64 then if (CurTime() >= NextPrintTime) then PlyrGlobVew = PlyrGlobVew - Vector(2,0,0) NextPrintTime = CurTime() + 0.001 end end end -- THIS BE MAKIN YO VIEW GO RIGHT MOTHERFUCKA function GoRight() if gui.MouseX() >= (ScrW() - 64) then if (CurTime() >= NextPrintTime) then PlyrGlobVew = PlyrGlobVew + Vector(2,0,0) NextPrintTime = CurTime() + 0.001 end end end -- THIS BE MAKIN YO VIEW GO UP MOTHERFUCKA function GoUp() if gui.MouseY() <= 64 then if (CurTime() >= NextPrintTime) then PlyrGlobVew = PlyrGlobVew + Vector(0,2,0) NextPrintTime = CurTime() + 0.001 end end end -- THIS BE MAKIN YO VIEW GO DOWN MOTHERFUCKA function GoDown() if gui.MouseY() >= (ScrH() - 64) then if (CurTime() >= NextPrintTime) then PlyrGlobVew = PlyrGlobVew - Vector(0,2,0) NextPrintTime = CurTime() + 0.001 end end end -- THIS BE MAKIN YO VIEW GO UP N' LEFT MOTHERFUCKA function GoUpL() if gui.MouseX <= 64 and gui.MouseY <= 64 then if (CurTime() >= NextPrintTime) then PlyrGlobVew = PlyrGlobVew + Vector(2,-2,0) NextPrintTime= CurTime() + 0.001 end end end -- THIS BE MAKIN YO VIEW GO UP N' RIGHT MOTHERFUCKA function GoUpL() if gui.MouseX >= 64 and gui.MouseY >= (ScrW() - 64) then if (CurTime() >= NextPrintTime) then PlyrGlobVew = PlyrGlobVew + Vector(2,2,0) NextPrintTime= CurTime() + 0.001 end end end -- THIS BE MAKIN YO VIEW GO DOWN N' LEFT MOTHERFUCKA function GoUpL() if gui.MouseX <= (ScrH() - 64) and gui.MouseY <= 64 then if (CurTime() >= NextPrintTime) then PlyrGlobVew = PlyrGlobVew + Vector(-2,-2,0) NextPrintTime= CurTime() + 0.001 end end end -- THIS BE MAKIN YO VIEW GO DOWN N' RIGHT MOTHERFUCKA function GoUpL() if gui.MouseX <= (ScrH() - 64) and gui.MouseY <= (ScrW() - 64) then if (CurTime() >= NextPrintTime) then PlyrGlobVew = PlyrGlobVew + Vector(-2,2,0) NextPrintTime= CurTime() + 0.001 end end end -- DIS BE DE END OF DAT SHIT YO -- DIS BE DA START OF DEM HOOKS ND VARIABLES DAWG hook.Add("Think" , "GoUp" , GoUp) hook.Add("Think" , "GoDown" , GoDown) hook.Add("Think" , "GoLeft" , GoLeft) hook.Add("Think" , "GoRight" , GoRight) hook.Add("Think" , "GoUpL" , GoUpL) hook.Add("Think" , "GoUpR" , GoUpR) hook.Add("Think" , "GoDwl" , GoDwL) hook.Add("Think" , "GoDwr" , GoDwr) gui.EnableScreenClicker( true) NextPrintTime = 0 PlyrGlobVew = Vector(0,0,256) if ply:Team() > 1 then local frame = vgui.Create( "Sidebar" ) frame:SetSize( 70, ScrH()) --Set the size frame:SetTitle( "BATTLEFIELD CONTROL" ) --Set title frame:SetVisible( true ) frame:SetDraggable( false ) frame:ShowCloseButton( true ) frame:setPos(0,(ScrH()-70)) frame:MakePopup() end[/code] init.lua [code]AddCSLuaFile( "cl_init.lua" ) --Tell the server that the client needs to download cl_init.lua AddCSLuaFile( "shared.lua" ) --Tell the server that the client needs to download shared.lua include( 'shared.lua' ) --Tell the server to load shared.lua function GM:PlayerInitialSpawn( ply ) ply:SetTeam( 4 ) --Add the player to team 4 end --End the "when player first joins server and spawns" function function team_1( ply ) ply:SetTeam( 1 ) end concommand.Add( "team_1", team_1 ) function team_2( ply ) ply:SetTeam( 2 ) end concommand.Add( "team_2", team_2 ) function team_3( ply ) ply:SetTeam( 3 ) end concommand.Add( "team_3", team_3 ) [/code][/QUOTE] [url]http://www.facepunch.com/showthread.php?t=861899[/url]
Sorry, you need to Log In to post a reply to this thread.