You need "help"?
Looks more like "make this for me"
Are you developing a new game mode?
yes i am
[QUOTE=JasonMan34;45642751]Are you developing a new game mode?[/QUOTE]
Damn, you've made 50 posts in the last 2 days, how much shit are you going to post before stopping?
sry that was mean,
@op do you have anything at all?
well i tried looking it up it didnt work for me
I am making a gamemode that includes a round system myself.
Mine is more lose though.
In my gamemode, when a player dies he/she is moved to a spectator/unassigned team. There he/she can fly around and wait for everyone to die. When everyone is dead (or the round timer has run out) every person on the spectator team (everyone) gets respawned with weapons and all - thus, a new round. Then I display some derma, bla bla bla and bling. A new round.
In your case you might want to only check if everyone from one team is dead. E.g.:
You have blue team and red team.
When players spawn, they are set to a random team.
Every time a player dies, it check how many players are left on the team the player was on, and then set the player to the spectator team.
When the last player dies from say, blue team, everyone on the server is set to the spectator team, and a timer is started. Then when the timer runs out, everyone is once again, randomly set to either blue or red team. And then it just loops.
You can use team.NumPlayers(index) to return the number of players on a team. So you could do something like this:
[lua]
-- You would have to set up teams, and loadouts etc, but this might help:
function playerDies( ply )
if ply:Team() == TEAM_BLUE then
if team.NumPlayers(TEAM_BLUE) <= 0 then
for k,pl in pairs(player.GetAll()) do
pl:SetTeam(TEAM_SPECTATOR)
pl:PrintMessage(HUD_PRINTTALK, "Red team has won, resetting game...")
end
else
ply:PrintMessage(HUD_PRINTTALK, "You have been killed, and therefor become a spectator.")
ply:SetTeam(TEAM_SPECTATOR)
end
elseif ply:Team() == TEAM_RED then
if team.NumPlayers(TEAM_RED) <= 0 then
for k,pl in pairs(player.GetAll()) do
pl:SetTeam(TEAM_SPECTATOR)
pl:PrintMessage(HUD_PRINTTALK, "Blue team has won, resetting game...")
end
else
ply:PrintMessage(HUD_PRINTTALK, "You have been killed, and therefor become a spectator.")
ply:SetTeam(TEAM_SPECTATOR)
end
end
end
hook.Add("DoPlayerDeath", "playerDies", playerDies)
[/lua]
I typed up a big post with examples and filed it in my tutorials... What exactly do you need help with? Have you started, or are you stuck and not sure where / how to begin? What have you tried so far? What game-mode are you using ( your own? ); what have you created so far within the game-mode?
Yeah, if you want "help" you need to post what you have.
Sorry, you need to Log In to post a reply to this thread.