General > Developers Corner
Hook giving winning team points
Cobalt:
Completed code with the chat print added. Use team.GetName to get the name of the team from the index.
--- Code: ---if SERVER then
hook.Add( "OnRoundSet", "DR Money", function( round, winner )
if round == ROUND_ENDING then
for k, v in next, player.GetAll() do
if not v:Team() == winner then
continue
end
v:PS_GivePoints( 25 )
end
local name = team.GetName( winner )
PrintMessage( HUD_PRINTTALK, "Players on the " .. name .. " team were given 25 points for winning."
end
end )
end
--- End code ---
Zmaster:
You were missing a ) on line 11, Cobalt, but thanks to both of you :P
Navigation
[0] Message Index
[*] Previous page
Go to full version