AddCSLuaFile( "cl_init.lua" )
AddCSLuaFile( "shared.lua" )
AddCSLuaFile( "specialchars.lua" )
include( 'shared.lua' )
include( 'specialchars.lua' )
--no fall damage
function GM:GetFallDamage( ply, speed )
return ( 0 )
end
--no suicide
function GM:CanPlayerSuicide( ply )
return false
end
--no player death sound
function OverrideDeathSound()
return true
end
hook.Add("PlayerDeathSound", "OverrideDeathSound", OverrideDeathSound)
--on player death
function player_initdeath( ply, wep, killer )
ply:PrintMessage( HUD_PRINTCHAT, ply:Nick() .. " has fallen off of the stage.\n")
end
hook.Add( "PlayerDeath", "player_initalize_dvars", player_initdeath );
--on player spawn
function GM:PlayerSpawn( ply )
self.BaseClass:PlayerSpawn( ply )
RunConsoleCommand( "play", "MBU/spawn_alternate.wav" )
ply:SetGravity ( 1 )
ply:SetMaxHealth ( 100, true )
ply:SetWalkSpeed ( 325 )
ply:SetRunSpeed ( 325 )
end
--on player join
function GM:PlayerInitialSpawn( ply )
CheckSpecialCharacters( ply )
if ply:IsAdmin() then
mbu_team2( ply )
ply:Spectate( 5 )
RunConsoleCommand( "mbu_start" )
else
joining( ply )
RunConsoleCommand( "mbu_start" )
end
end
--weapons given on player join team
function GM:PlayerLoadout( ply )
if ply:Team() == 1 then
// blank because no weapons are used
elseif ply:Team() == 2 then
//blank because no weapons are used
end
end
--on player join team Players [1]
function mbu_team1( ply )
ply:UnSpectate()
ply:SetTeam( 1 )
ply:Spawn()
ply:PrintMessage( HUD_PRINTTALK, "[Marble Blast Ultra]Welcome to the server, " .. ply:Nick().. "!")
end
--on player join team Admins [2]
function mbu_team2( ply )
ply:SetTeam( 2 )
ply:Spawn()
ply:PrintMessage( HUD_PRINTTALK, "[Marble Blast Ultra]Admin " .. ply:Nick().. " Recognized!")
end
concommand.Add( "mbu_team1", mbu_team1 )
--on player join the server pre-team selection
function joining( ply )
RunConsoleCommand( "play", "MBU/spawnwav" )
ply:Spectate( 5 )
ply:SetTeam( 3 )
end