How to stop someone from respawning?

How do you make it so that when someone dies, their ragdoll stays, they go into spectate mode, and they cant spawn, say like…

Someone spawns as a zombie, they die, their body stays there, they become a spectator, but they stay on the zombie team.

I smell a zombie survival type gamemode.

What gamemode base are you using? You could always use the shitty method that GJail uses if it’s using the base gamemode (as a base. lol.).

I would say he is using the skeleton gamemode.

I’m using base, and your nose was right :wink: add me on steam if you want updates on the progress/sneak peeks on the server

it’s a shit gamemode dont add him

[editline]9th January 2011[/editline]

jk

:frog:

:frogc00l:

can someone tell me what the frog is supposed to symbolize? Also any suggestions on how to make that script? lol

Not quite sure what you’re looking for.
Shouldn’t it be enough to set it so that when the player dies he joins another team (the spectator team)?

GJail doesn’t actually prevent people from respawning, per se – rather, it switches them to a different team that acts like a spectator.

From GJail:

[lua]/---------------------------------------------------------
Name: gamemode:DoPlayerDeath( )
Desc: Carries out actions when the player dies
---------------------------------------------------------
/
function GM:DoPlayerDeath( ply, attacker, dmginfo )
– code

if ply:Team() == TEAM_GUARD then
	ply:SetTeam(TEAM_GUARD_DEAD) end
if ply:Team() == TEAM_PRISONER then
	ply:SetTeam(TEAM_PRISONER_DEAD) end

end

/---------------------------------------------------------
Name: gamemode:PlayerSpawn( )
Desc: Called when a player spawns
---------------------------------------------------------
/
function GM:PlayerSpawn( pl )
pl.Disguise = false
pl:StripWeapons()
pl:StripAmmo()
if pl:Team() == TEAM_SPECTATOR or pl:Team() >= TEAM_GUARD_DEAD then
self:PlayerSpawnAsSpectator( pl )
return
end
pl:UnSpectate()
hook.Call( “PlayerLoadout”, GAMEMODE, pl )
hook.Call( “PlayerSetModel”, GAMEMODE, pl )
end[/lua]

Hence “shitty method”

what are you guys doing

[lua]hook.Add( “PlayerDeath”, “SetRespawnTime”, function( ply )
ply.RespawnTime = CurTime() + 10
end )

hook.Add( “PlayerDeathThink”, “NoRespawn”, function( ply )
if ( CurTime() < ply.RespawnTime ) then
return false
end
end )[/lua]

I just learned about ply:SpawnAsSpectator(), so could I do this?
[lua]
function GM:PlayerDeath( ply )
ply:SpawnAsSpectator( ply )
end
[/lua]

How do you change someone’s name? This is related to what I’m doing so I put it here.

Not sure why you’d need anything like that for something that isn’t malicious, but you might want too look here

ugh, not like that, similar to darkrp, like this:

function GM:PlayerSpawn( ply )
if ply:Team() == 1 or ply:Team() == 2 then//“Alive teams” such as TEAM_SURVIVOR or TEAM_ZOMBIE…undead = alive, don’t post about this Dx
//Do whatever
if ply:Team() == 3 or ply:Team() == 4 then // “Dead teams” such as TEAM_SURVIVOR_DEAD or TEAM_ZOMBIE_DEAD… again don’t post about this
Name = "DEAD " … Name // What do I do here? D=
end
end

darkrp uses a variable to store the name. Since they draw names over players rather then use ply:Nick() they use the variable.
If your wanting to make it on a scoreboard you would just “DEAD”…ply:Nick() but you may have to make your own scoreboard.

how would you make it work in chat? custom chat script?

yup

[lua]
function EditNames( ply, msg )
local chatstuff = {}
if not ply:IsAlive() then
table.insert( chatstuff, Color( 255, 0, 0, 255 ) )
table.insert( chatstuff, "([DEAD] " )
end

table.insert( chatstuff, Color( 255, 255, 255, 255 ) )
table.insert( chatstuff, ply )
table.insert( chatstuff, ": " )
table.insert( chatstuff, msg )

chat.AddText( unpack(chatstuff) )
return true

end
hook.Add(“OnPlayerChat”, “EditNames”, EditNames)
[/lua]

Untested.
Goes clientside.