timboiscool
Gebruiker
- Lid geworden
- 27 nov 2008
- Berichten
- 205
Hey lezers ik ben gisteren begonnen met een gamemode te maken voor garrys mod maar nu heb ik een error tenminste hij doet het niet
hij hoort je een glock en een pistol 9mm te geven maar dat doet hij niet D: dit is code
shared.lua
init.lua
cl_init.lua
alsjebieft reageer ik wil dit snel hebben anders loopt mijn project in duizenden D:
hij hoort je een glock en een pistol 9mm te geven maar dat doet hij niet D: dit is code
shared.lua
Code:
GM.Name = "PDM"
GM.Author = "Tim"
GM.Email = "N/A"
GM.Website = "N/A"
DeriveGamemode( "sandbox" )
function GM:Initialize()
self.BaseClass.Initialize( self )
team.SetUp( 1, "TEAM_lvl1Killer", Color( 0, 0, 200, 255 ) )
team.SetUp( 2, "TEAM_lvl2Killer", Color( 0, 200, 0, 255 ) )
team.SetUp( 3, "TEAM_lvl3Killer", Color( 163, 63, 0, 255 ) )
end
init.lua
Code:
AddCSLuaFile( "cl_init.lua" )
AddCSLuaFile( "shared.lua" )
include( 'shared.lua' )
-- here is player download stuff begin
resource.AddFile("v_pistols.dx80.vtx")
resource.AddFile("v_pistols.dx90.vtx")
resource.AddFile("v_pistols.mdl")
resource.AddFile("v_pistols.sw.vtx")
resource.AddFile("v_pistols.vvd")
-- here is player download stuff end
// Serverside only stuff goes here
/*---------------------------------------------------------
Name: gamemode:PlayerLoadout( )
Desc: Give the player the default spawning weapons/ammo
---------------------------------------------------------*/
function GM:PlayerSpawn( ply )
self.BaseClass:PlayerSpawn( ply )
ply:SetGravity( 0.9 )
ply:SetMaxHealth( 150, false )
ply:SetWalkSpeed( 411 )
ply:SetRunSpeed( 475 )
end
function GM:PlayerLoadout( ply )
ply:StripWeapons()
ply:Give( "weapon_pistol" )
ply:Give( "weapon_glock" )
ply:Give( "item_ammo_pistol" )
ply:Give( "item_ammo_pistol" )
end
function GM:PlayerInitialSpawn( ply )
self.BaseClass:PlayerInitialSpawn( ply )
if ply:IsAdmin() then
ply:PrintMessage( HUD_PRINTTALK, "PDM: Admin has joined the game!" )
end
end
cl_init.lua
Code:
include( 'shared.lua' )
// Clientside only stuff goes here
function hidehud(name)
for k, v in pairs{"CHudHealth", "CHudBattery"} do -- hide health and armor
if name == v then return false end
end
end
hook.Add("HUDShouldDraw", "hidehud", hidehud)
function GM:HUDPaint()
self.BaseClass:HUDPaint()
local Person = LocalPlayer()
local Health = LocalPlayer():Health()
surface.CreateFont("Segoe script",16,400,false,false,"Font1")
surface.SetTextColor( 32, 233, 3 , 200 )
surface.SetTextPos( 34, (ScrH()/2)+(ScrH()/4))
surface.SetFont("Font1")
surface.DrawText( Health )
end
alsjebieft reageer ik wil dit snel hebben anders loopt mijn project in duizenden D: