1. Post #1
    therake6's Avatar
    April 2007
    82 Posts
    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
    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
    

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

  2. Post #2
    zzaacckk's Avatar
    June 2009
    2,152 Posts
    Make sure sv_cheats = 1
    Reply With Quote Edit / Delete Reply United States Show Events Disagree Disagree x 7Dumb Dumb x 1 (list)

  3. Post #3
    Godlike2's Avatar
    October 2010
    151 Posts
    You need to use Gamemode.CalcView

    Edited:

    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
    Reply With Quote Edit / Delete Reply United States Show Events Friendly Friendly x 1Agree Agree x 1 (list)

  4. Post #4
    therake6's Avatar
    April 2007
    82 Posts
    Ah, thanks man
    Reply With Quote Edit / Delete Reply United States Show Events Friendly Friendly x 2 (list)