So I got this to block suicide:
[CODE]local function BlockSuicide(ply)
return false
end
hook.Add( "CanPlayerSuicide", "BlockSuicide", BlockSuicide )[/CODE]
But I want people to suicide I just want it so after they die they have to wait 10 seconds before suicide again, not sure how to do this. Any help is appreciated!
[lua]local function BlockSuicide(ply)
if ((ply.NextSuicide or 0) < CurTime()) then --Check if he got an Cooldown yet.
ply.NextSuicide = CurTime() + 10 -- sets the cooldown
return true -- allow suicide
end
return false -- if cooldown then block
end
hook.Add( "CanPlayerSuicide", "BlockSuicide", BlockSuicide )[/lua]
[QUOTE=Tomelyr;47851844][lua]local function BlockSuicide(ply)
if ((ply.NextSuicide or 0) < CurTime()) then --Check if he got an Cooldown yet.
ply.NextSuicide = CurTime() + 10 -- sets the cooldown
return true -- allow suicide
end
return false -- if cooldown then block
end
hook.Add( "CanPlayerSuicide", "BlockSuicide", BlockSuicide )[/lua][/QUOTE]
Works thanks man.
Sorry, you need to Log In to post a reply to this thread.