What he means is, is GM:EndRound called by any thing using hook.Call( “EndRound”, GAMEMODE, winner, nextmap ); ?? You can’t just create the function and expect it to work ( unless it is a pre-existing function which you’re overriding for your game-mode such as PlayerSpawn which already has a purpose and is called by something ).
Also, you can simplify the code / make it more readable; I’m assuming dead players get 10?
// Winning team points to give....
local WINNING_TEAM_POINTS = 100;
local WINNING_TEAM_POINTS_DEAD = 10;
function GM:EndRound( winner, nextmap )
for k, _p in pairs( player.GetAll( ) ) do
if ( !IsValid( _p ) ) then continue; end
// Give winning team members points...
if ( v:Team() == winner ) then
// If the player is alive, give them them extra points. If the player is dead, give them less points.
v:PS_GivePoints( ( v:Alive( ) && WINNING_TEAM_POINTS || WINNING_TEAM_POINTS_DEAD ) );
// If nextmap is defined, change the map...
if ( nextmap ) then
timer.Simple( 5, function( )
RunConsoleCommand( "changelevel", nextmap );
Then, make sure you pass winner as the winning team…