Big gamemode problems...

Im getting big problems with my gamemode, when im loading a game I get like 500 errors of Base…

Here is ALL the code.

shared.lua:

[lua]GM.Name = “Cityrp”
GM.Author = “Italian Racoon”
GM.Email = “chuck_399@hotmail.com
GM.Website = “thec0re.net

DeriveGamemode( “base” )

team.SetUp( 1, “Citizen”, Color( 0, 255, 0, 255 ) )
team.SetUp( 2, “Police”, Color( 0, 0, 255, 255 ) )
team.SetUp( 3, “Gangster”, Color( 120, 120, 120, 255 ) )
team.SetUp( 4, “Mayor”, Color( 255, 0, 0, 255 ) )[/lua]

init.lua:

[lua]AddCSLuaFile( “cl_init.lua” )
AddCSLuaFile( “shared.lua” )

include( ‘shared.lua’ )
include( ‘cl_init.lua’ )

function GM:PlayerSpawn( ply )

self.BaseClass:PlayerSpawn( ply )   

ply:SetGravity( 0.75 )  
ply:SetMaxHealth( 100, true )  

ply:SetWalkSpeed( 200 )  
ply:SetRunSpeed( 400 ) 

end

function GM:PlayerInitialSpawn( ply )

	RunConsoleCommand( "rp_team1" )

end

function GM:PlayerLoadout( ply ) //

if ply:Team() == 1 then 

	ply:Give( "weapon_physcannon" ) 
	ply:Give( "weapon_physgun" ) 
	ply:Give( "gmod_tool" ) 

elseif ply:Team() == 2 then 
	
	ply:Give( "weapon_physcannon" ) 
	ply:Give( "weapon_physgun" ) 
	ply:Give( "weapon_stunstick" ) 
	ply:Give( "gmod_tool" ) 
	ply:Give( "weapon_smg1" ) 
	ply:Give( "weapon_pistol" ) 
	ply:GiveAmmo(90,"smg1");
	ply:GiveAmmo(36,"pistol");

elseif ply:Team() == 3 then 
	
	ply:Give( "weapon_physcannon" ) 
	ply:Give( "weapon_physgun" ) 
	ply:Give( "gmod_tool" )  
	ply:Give( "weapon_pistol" ) 
	ply:GiveAmmo(36,"pistol");
	plys:Give( "weapon_crowbar" )
	
elseif ply:Team() == 4 then 
	
	ply:Give( "weapon_physcannon" ) 
	ply:Give( "weapon_physgun" ) 
	ply:Give( "gmod_tool" )  
	ply:Give( "weapon_pistol" ) 
	ply:GiveAmmo(36,"pistol");
	
end

end

function rp_team1( ply )

ply:SetTeam( 1 )
ply:Spawn( ply )
ply:SetModel( "models/player/police.mdl" )

end

function GM:ShowHelp()
umsg.Start( “team_menu”, ply )
umsg.End()
end

concommand.Add( “rp_team1”, rp_team1 )[/lua]

cl_init.lua:

[lua]AddCSLuaFile( “cl_init.lua” )
AddCSLuaFile( “shared.lua” )

include( “init.lua” )
include( “shared.lua” )

function set_team()

Ready = vgui.Create( "DFrame" ) 
Ready:SetPos( ScrW() / 2, ScrH() / 2 ) 
Ready:SetSize( 250, 250 ) 
Ready:SetTitle( "Choose your job" ) 
Ready:SetVisible( true ) 
Ready:SetDraggable( false ) 
Ready:ShowCloseButton( false ) 
Ready:MakePopup() 

ready1 = vgui.Create( "DButton", Ready ) 
ready1:SetPos( 20, 25 ) 
ready1:SetSize( 100, 40 ) 
ready1:SetText( "Citizen" ) 
ready1.DoClick = function() 
RunConsoleCommand( "rp_team1" ) 

end 

ready2 = vgui.Create( "DButton", Ready ) 
ready2:SetPos( 20, 40 ) 
ready2:SetSize( 100, 40 ) 
ready2:SetText( "Police" ) 
ready2.DoClick = function() 
RunConsoleCommand( "rp_team2" )

end

ready3 = vgui.Create( "DButton", Ready ) 
ready3:SetPos( 20, 55 ) 
ready3:SetSize( 100, 40 ) 
ready3:SetText( "Gangster" ) 
ready3.DoClick = function() 
RunConsoleCommand( "rp_team3" )
end

ready4 = vgui.Create( "DButton", Ready ) 
ready4:SetPos( 20, 70 ) 
ready4:SetSize( 100, 40 ) 
ready4:SetText( "Drug dealer" ) 
ready4.DoClick = function() 
RunConsoleCommand( "rp_team4" )

end

end

concommand.Add( “team_menu”, set_team )
usermessage.Hook( “team_menu”, set_team )[/lua]

Also, the hook seems to be not working…

[editline]09:26PM[/editline]

Oh and my question is:

Whats wrong with it??

[editline]09:38PM[/editline]

Here are the error:


Registering gamemode 'sandbox' derived from 'base'
sandbox\gamemode\spawnmenu\controlpanel.lua:266: chunk has too many syntax levels
sandbox\gamemode\spawnmenu\CreationMenu\Props/PropSearch.lua:129: chunk has too many syntax levels
Registering gamemode 'sandbox' derived from 'base'
sandbox\gamemode\spawnmenu\controlpanel.lua:134: chunk has too many syntax levels
sandbox\gamemode\spawnmenu\CreationMenu\Props.lua:105: chunk has too many syntax levels
sandbox\gamemode\spawnmenu\CreationMenu\ModelBrowse.lua:143: chunk has too many syntax levels
sandbox\gamemode\spawnmenu\CreationMenu\Weapons.lua:140: chunk has too many syntax levels
sandbox\gamemode\spawnmenu\CreationMenu\Vehicles.lua:141: chunk has too many syntax levels
sandbox\gamemode\spawnmenu\CreationMenu\Entities.lua:164: chunk has too many syntax levels
Registering gamemode 'sandbox' derived from 'base'
sandbox\gamemode\shared.lua:193: chunk has too many syntax levels
sandbox\gamemode\cl_spawnmenu.lua:134: chunk has too many syntax levels
sandbox\gamemode\scoreboard\player_row.lua:82: chunk has too many syntax levels
sandbox\gamemode\scoreboard\player_frame.lua:32: chunk has too many syntax levels
Registering gamemode 'sandbox' derived from 'base'
sandbox\gamemode\shared.lua:119: chunk has too many syntax levels
sandbox\gamemode\cl_spawnmenu.lua:130: chunk has too many syntax levels
sandbox\gamemode\cl_notice.lua:74: chunk has too many syntax levels
sandbox\gamemode\scoreboard/scoreboard.lua:132: chunk has too many syntax levels
Registering gamemode 'sandbox' derived from 'base'
sandbox\gamemode\shared.lua:46: chunk has too many syntax levels
sandbox\gamemode\cl_spawnmenu.lua:127: chunk has too many syntax levels
sandbox\gamemode\cl_notice.lua:43: chunk has too many syntax levels
sandbox\gamemode\cl_hints.lua:15: chunk has too many syntax levels
sandbox\gamemode\cl_worldtips.lua:26: chunk has too many syntax levels
sandbox\gamemode\cl_scoreboard.lua:33: chunk has too many syntax levels
sandbox\gamemode\cl_quicktool.lua:24: chunk has too many syntax levels
Registering gamemode 'sandbox' derived from 'base'
sandbox/gamemode/cl_init.lua:26: chunk has too many syntax levels
******
ERROR: Couldn't Derive Gamemode sandbox..
******
city_rp\gamemode\cl_init.lua:26: chunk has too many syntax levels
sandbox/gamemode/cl_init.lua:26: chunk has too many syntax levels
******
ERROR: Couldn't Derive Gamemode sandbox..
******
sandbox\gamemode\shared.lua:67: chunk has too many syntax levels
sandbox\gamemode\cl_spawnmenu.lua:127: chunk has too many syntax levels
sandbox\gamemode\cl_notice.lua:74: chunk has too many syntax levels
sandbox\gamemode\cl_worldtips.lua:26: chunk has too many syntax levels
sandbox\gamemode\scoreboard/scoreboard.lua:25: chunk has too many syntax levels
Registering gamemode 'sandbox' derived from 'base'
sandbox\gamemode\shared.lua:193: chunk has too many syntax levels
sandbox\gamemode\cl_spawnmenu.lua:133: chunk has too many syntax levels
sandbox\gamemode\scoreboard/scoreboard.lua:200: chunk has too many syntax levels
Registering gamemode 'sandbox' derived from 'base'
sandbox\gamemode\spawnmenu\controlpanel.lua:98: chunk has too many syntax levels
sandbox\gamemode\spawnmenu\ToolMenuButton.lua:22: chunk has too many syntax levels
sandbox\gamemode\spawnmenu\CreationMenu\Props.lua:104: chunk has too many syntax levels
sandbox\gamemode\spawnmenu\CreationMenu\ModelBrowse.lua:24: chunk has too many syntax levels
sandbox\gamemode\spawnmenu\CreationMenu\NPC.lua:106: chunk has too many syntax levels
sandbox\gamemode\spawnmenu\CreationMenu\Weapons.lua:140: chunk has too many syntax levels
sandbox\gamemode\spawnmenu\CreationMenu\Vehicles.lua:137: chunk has too many syntax levels
sandbox\gamemode\spawnmenu\CreationMenu\Entities.lua:138: chunk has too many syntax levels
sandbox\gamemode\scoreboard\player_row.lua:206: chunk has too many syntax levels
sandbox\gamemode\scoreboard\player_frame.lua:32: chunk has too many syntax levels
Registering gamemode 'sandbox' derived from 'base'
sandbox\gamemode\spawnmenu\controlpanel.lua:266: chunk has too many syntax levels
sandbox\gamemode\spawnmenu\CreationMenu\Props.lua:105: chunk has too many syntax levels
sandbox\gamemode\spawnmenu\CreationMenu\ModelBrowse.lua:173: chunk has too many syntax levels
sandbox\gamemode\spawnmenu\CreationMenu\Entities.lua:164: chunk has too many syntax levels
Registering gamemode 'sandbox' derived from 'base'
sandbox\gamemode\spawnmenu\controlpanel.lua:311: chunk has too many syntax levels
sandbox\gamemode\spawnmenu\CreationMenu\Props\SearchGuts.lua:28: chunk has too many syntax levels
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'sandbox' derived from 'base'
Registering gamemode 'city_rp' derived from 'sandbox'

[editline]09:40PM[/editline]

Another error… Ive tested my derma and I get this error:



city_rp\gamemode\cl_init.lua:12: attempt to index global 'vgui' (a nil value)

[editline]09:42PM[/editline]

Here you go, another error when im trying to open init.lua with lua_openscript:



city_rp\gamemode\shared.lua:1: attempt to index global 'GM' (a nil value)
city_rp/gamemode/init.lua:7: attempt to index global 'GM' (a nil value)

Umm… a few things.

  1. You can’t use AddCSLuaFile from the client.
  2. You’re trying to give people tools and physguns, but those are sandbox-only items. You have to derive from sandbox to use them. (this might be why you get errors? I dunno why sandbox would affect this at all)
  3. (@ your InitialPlayerSpawn) RunConsoleCommand is a client-only function. Try using player.ConCommand instead.

Ok… Can you tell me whats the client file??

[editline]11:31PM[/editline]

I just realised that this is not the good code, the error is from my gamemode derived from sandbox…

  1. Is correct
  2. You can use them with or without sandbox. Don’t need them whatsoever.
  3. RunConsoleCommand can be ran on the server (see: http://wiki.garrysmod.com/?title=G.RunConsoleCommand ).

At least check your statements before posting. Bil, PM me your steam name and I’ll help you out.

Whats your steam name??