• How do I disallow people from typing kill in console if they are within this group?
    4 replies, posted
Hello, Does anyone know how I could stop players from killing themselves in the console if they are within the group TEAM_GHOST? Thank you, Zombiez
[url]https://wiki.garrysmod.com/page/GM/CanPlayerSuicide[/url]
Ok, and should I edit the ghost mode addon and just edit that in somewhere? and could I instead of state the name the groups that should have permissions to kill themselves but state the name the groups that should not have the permissions to... ?
You'd add something like so [code]hook.Add("CanPlayerSuicide", "CanPlayerSuicide.DisallowGhostSuicide", function(ply) if ply:Team() == TEAM_GHOST then return false end end)[/code] This is serverside so either put it into a .lua inside of autorun/server or some other lua class that's serverside
[QUOTE=ForrestMarkX;51946555]You'd add something like so [code]hook.Add("CanPlayerSuicide", "CanPlayerSuicide.DisallowGhostSuicide", function(ply) if ply:Team() == TEAM_GHOST then return false end end)[/code] This is serverside so either put it into a .lua inside of autorun/server or some other lua class that's serverside[/QUOTE] Will try that, thank you. [editline]12th March 2017[/editline] I apologise if this is a stupid question but can I just throw that in a .lua file? [editline]12th March 2017[/editline] I tested that and IT WORKED! :) Thank you very much, I just make a new file.lua and I put the hook in there and it has been fixed.
Sorry, you need to Log In to post a reply to this thread.