I know it is maybe a dumb question but i realy can figure out how to make / set one
I have this at my PlayerDeath
[CODE]function GM:PlayerDeath( ply )
ply:SetTeam(TEAM_SPECTATOR)--Sets the player to actualy spectate
ply:Spectate(OBS_MODE_ROAMING)--Sets the type of spectating
end[/CODE]
The player has to turn team 1 when round.begin and when he dies he should turn spectator
Thx in advance
[U][I][B]Edit :[/B][/I][/U] Did a few things wrong with the hook , but i know where my problem was thx
ply:Spectator() won't call your function.
function SpectateOnDeath( ply, inflictor, attacker )
[B]Spectator(ply)[/B]
end
hook.Add( [B]"PlayerDeath "[/B], "spectatorhook", [B]SpectateOnDeath[/B])
You over rided the gamemode hook, no idea why you're calling it again, you could do it the way I showed, or remove the hook entirely and have the original GM:PlayerDeath
Just my thoughts. But hey I'm still learning too.
[code]
function GM:PlayerDeath( ply )
ply:StripWeapons();
if ( ply:Team() == TEAM_UNASSIGNED ) then
ply:Spectate( OBS_MODE_FIXED )
return
end
ply:SetTeam( TEAM_SPECTATOR )
ply:Spectate( OBS_MODE_ROAMING )
end[/code]
or
[code]
hook.Add( "PlayerDeath", "spectatorhook", function( ply )
ply:StripWeapons();
if ( ply:Team() == TEAM_UNASSIGNED ) then
ply:Spectate( OBS_MODE_FIXED )
return
end
ply:SetTeam( TEAM_SPECTATOR )
ply:Spectate( OBS_MODE_ROAMING )
end )[/code]
You can choose one. One. Only one.
[QUOTE]You can choose one. One. Only one.[/QUOTE] i know Xd i'm not retarded but i just made a pretty huge mistake
Sorry, you need to Log In to post a reply to this thread.