So when i press Change Class on the F1 menu of fretta nothing happens, i don't have any clue why. I made 2 classes but i can't switch between them.
Help any one?
this is my code:
[code] if ( IsValid( LocalPlayer() ) ) then
local TeamID = LocalPlayer():Team()
local Classes = team.GetClass( TeamID )
if ( Classes && #Classes > 1 ) then
local btn = Help:AddSelectButton( "Change Class", function() GAMEMODE:ShowClassChooser( LocalPlayer():Team() ) end )
btn.m_colBackground = Color( 120, 255, 100 )
end
end[/code]
[code]if ( !GAMEMODE.TeamBased ) then return end
team.SetUp( TEAM_1, "Team 1", Color( 50, 255, 50 ), true )
team.SetSpawnPoint( TEAM_1, { "info_player_counterterrorist" } )
team.SetClass( TEAM_1, { "Class A", "Class B" } ) // "Human" is the class we want players to use[/code]
class_a.lua
[code]
local CLASS = {}
CLASS.DisplayName = "Class A"
CLASS.WalkSpeed = 400
CLASS.CrouchedWalkSpeed = 0.2
CLASS.RunSpeed = 600
CLASS.DuckSpeed = 0.2
CLASS.JumpPower = 200
CLASS.PlayerModel = "models/player/ct_gsg9"
CLASS.DrawTeamRing = true
CLASS.DrawViewModel = true
CLASS.CanUseFlashlight = true
CLASS.MaxHealth = 100
CLASS.StartHealth = 100
CLASS.StartArmor = 0
CLASS.RespawnTime = 0 // 0 means use the default spawn time chosen by gamemode
CLASS.DropWeaponOnDie = false
CLASS.TeammateNoCollide = false
CLASS.AvoidPlayers = false // Automatically avoid players that we're no colliding
CLASS.Selectable = true // When false, this disables all the team checking
CLASS.FullRotation = false // Allow the player's model to rotate upwards, etc etc
function CLASS:Loadout( pl )
end
function CLASS:OnSpawn( pl )
end
function CLASS:OnDeath( pl, attacker, dmginfo )
end
function CLASS:Think( pl )
end
function CLASS:Move( pl, mv )
end
function CLASS:OnKeyPress( pl, key )
end
function CLASS:OnKeyRelease( pl, key )
end
function CLASS:ShouldDrawLocalPlayer( pl )
return false
end
function CLASS:CalcView( ply, origin, angles, fov )
end
player_class.Register( "Class A", CLASS )[/code]
class_b.lua
[code]
local CLASS = {}
CLASS.DisplayName = "Class B"
CLASS.WalkSpeed = 400
CLASS.CrouchedWalkSpeed = 0.2
CLASS.RunSpeed = 600
CLASS.DuckSpeed = 0.2
CLASS.JumpPower = 200
CLASS.PlayerModel = "models/player/ct_gsg9"
CLASS.DrawTeamRing = true
CLASS.DrawViewModel = true
CLASS.CanUseFlashlight = true
CLASS.MaxHealth = 100
CLASS.StartHealth = 100
CLASS.StartArmor = 0
CLASS.RespawnTime = 0 // 0 means use the default spawn time chosen by gamemode
CLASS.DropWeaponOnDie = false
CLASS.TeammateNoCollide = false
CLASS.AvoidPlayers = false // Automatically avoid players that we're no colliding
CLASS.Selectable = true // When false, this disables all the team checking
CLASS.FullRotation = false // Allow the player's model to rotate upwards, etc etc
function CLASS:Loadout( pl )
end
function CLASS:OnSpawn( pl )
end
function CLASS:OnDeath( pl, attacker, dmginfo )
end
function CLASS:Think( pl )
end
function CLASS:Move( pl, mv )
end
function CLASS:OnKeyPress( pl, key )
end
function CLASS:OnKeyRelease( pl, key )
end
function CLASS:ShouldDrawLocalPlayer( pl )
return false
end
function CLASS:CalcView( ply, origin, angles, fov )
end
player_class.Register( "Class B", CLASS )[/code]
Sorry, you need to Log In to post a reply to this thread.