danke:) funktioniert leider nicht:/
cl_init.lua
include("shared.lua")
function UpdateTeam()
local frame
frame = vgui.Create( "DFrame" )
frame:SetPos( ScrH() / 2, ScrW() / 2 ) //Create Teamchange Window
frame:SetSize( 200, 140 ) //Set the size
frame:SetTitle( "Select Mode" )
frame:SetVisible( true )
frame:SetDraggable( false )
frame:ShowCloseButton( true )
frame:MakePopup()
but_spec = vgui.Create( "DButton", frame )
but_spec:SetPos( 10, 10 )
but_spec:SetSize( 180, 55 )
but_spec:SetText( "Spectate" )
but_spec.DoClick = function()
RunConsoleCommand( "ghidden_spectator" )
end
but_hidd = vgui.Create( "DButton", frame )
but_hidd:SetPos( 10, 70 )
but_hidd:SetSize( 180, 55 )
but_hidd:SetText( "Playing" )
but_hidd.DoClick = function()
RunConsoleCommand( "ghidden_hunter" )
end
end
concommand.Add( "ghidden_team", UpdateTeam )
init.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:PlayerIntitialSpawn( ply )
ply:SetTeam( 1 ) //Join Team Spectators
ply:ConCommand( "ghidden_team" )
ply:ChatPrint( "[GHidden]Welcome to the Server, " .. ply:Nick() )
ply:CrosshairDisable()
end
function GM:PlayerLoadout( ply )
if ply:Team() == 1 then
ply:Spectate( 6 )
ply:SetMoveType( MOVETYPE_OBSERVER )
elseif ply:Team() == 2 then
//Weapons
ply:Give( "weapon_phycannon" )
ply:Give( "weapon_knife" )
//Ammo
//Model
ply:SetModel( "models/player/kleiner.mdl" )
ply:SetColor( 255, 255, 255, 22.5 )
//Data
ply:SetMaxHealth( 250 )
ply:SetHealth( 250 )
ply:SetArmor( 0 )
//Physics
ply:SetMoveSpeed( 350 )
ply:SetGravity( 0.75 )
ply:SetJumpPower( 320 )
ply:SetMoveType( MOVETYPE_WALK )
elseif ply:Team() == 3 then
//Weapons
ply:Give( "weapon_pistol" )
ply:Give( "weapon_357" )
ply:Give( "weapon_ar2" )
//Ammo
ply:GiveAmmo( 60, "pistol" )
ply:GiveAmmo( 12, "357" )
ply:GiveAmmo( 60, "ar2" )
//Model
ply:SetModel( "models/player/barney.mdl" )
//Data
ply:SetMaxHealth( 100 )
ply:SetArmor( 100 )
//Physics
ply:SetMoveSpeed( 250 )
ply:SetGravity( 1 )
ply:SetJumpPower( 160 )
ply:SetMoveType( MOVETYPE_WALK )
end
ply:Spawn()
end
// Custom Functions(Team)
function team_spec( ply )
ply:SetTeam( 1 )
ply:Kill()
ply:Spectate( 6 )
ply:SetMoveType( MOVETYPE_OBSERVER )
ply:ChatPrint( "Joined Team " .. Team.GetName( 3 ) )
ply:Spawn()
end
function team_playing( ply )
ply:SetTeam( 3 )
ply:Kill()
ply:ChatPrint( "" )
end
//ConCommands
concommand.Add( "ghidden_spectator", team_spec )
concommand.Add( "ghidden_hunter", team_playing )
shared.lua
GM.Name = "Hidden: GMod" //Set the gamemode name
GM.Author = "perfectdeath545" //Set the author name
GM.Email = "
[email protected]" //Set the author email
GM.Website = "http://ssgn.net63.net/" //Set the author website
team.SetUp( 1, "Spectator", color(127, 127, 127, 255) )
team.SetUp( 2, "Hidden", color(255, 0, 0, 255) )
team.SetUp( 3, "S.W.A.T.", color(204, 204, 204, 255) )
function GetAliveCount()
local Count = 0
for k, v in Player:GetAll() do
if v.Alive() == true then
Count = Count + 1
end
end
return Count
end
function GetPlayerCount()
local Count = 0
for k, v in Player:GetAll() do
Count = Count + 1
end
return Count
end
Ich denke man kann erkennen das ich nen gmod gamemode von The Hidden: Source (http://www.hidden-source.com/) machen möchte;)