Making a gamemode thirdperson only

I’m trying to make a gamemode thirdperson only.
I kinda got it working by putting the RunConsoleCommand(“thirdperson”); in OnRoundStart. It Puts the player in 3rd person, he can change his weapons but he can’t move or attack.

Here’s my init.lua
[lua]
AddCSLuaFile( “cl_init.lua” ) //dl that
AddCSLuaFile( “shared.lua” ) //dl that too

include( ‘shared.lua’ ) //load that

// This is called every second to see if we can end the round
function GM:OnRoundStart()

RunConsoleCommand(“thirdperson”);
end
function GM:CheckRoundEnd()

if ( !GAMEMODE:InRound() ) then return end 

for k,v in pairs( team.GetPlayers( TEAM_HUMAN ) ) do

	if v:Frags() >= 10 then

	      GAMEMODE:RoundEndWithResult( v )

            end

    end

end

// This is called after a player wins in a free for all
function GM:OnRoundWinner( ply, resulttext )

ply:AddScore( 1 ) // Let's pretend we have AddScore for brevity's sake

end

// Called when the round ends
function GM:OnRoundEnd( num )

   for k,v in pairs( team.GetPlayers( TEAM_HUMAN ) ) do
         v:SetFrags( 0 ) // Reset their frags for next round
   end

end
[/lua]

And I’m using fretta if that helps at all.

Make sure sv_cheats = 1

You need to use **[Gamemode.CalcView

http://wiki.garrysmod.com/favicon.ico](wiki.garrysmod.com/?title=Gamemode.CalcView)**

[editline]26th December 2010[/editline]

Don’t listen to zaack he is trolling, using the thirdperson and firstperson commands is retarded just use the CalcView hook and make your own thirdperson so that you don’t need sv_cheats to be 1

Ah, thanks man