Warden

Im currently working on a Jailbreak gamemode. Now I want to make the functionalitly to become the warden. The thing I don’t know is how to do it. I thought about adding another group but I think that would mess up the admins and so my question is : What should I use to make this?

Give up. Just give up and cry to yourself. No, seriously I suggest you make 3 teams, Warden, Prison Guard, and Prisoner and then just do ply:SetTeam( 1 ) where team 1 is warden or w/e . As for your admin system, use UserGroups. ( ply:SetUserGroup(“admin”) etc. etc. ) this also allows for donators etc. ( ply:SetUserGroup(“donator” ). And you can check them by using ply:IsUserGroup(“admin”) when calling a command to see if they meet the requirements. To make their chat colored use the OnPlayerChat hook. ( chat.AddText( Color(0,0,255), ply:GetName(), Color( 255, 255, 255 ), ": ", strText ) Makes their name blue and the rest white )

Based on your chat command I would recommend:



function ChatCommand( ply, text, public )
	if( string.sub( text, 1, 7) == "!warden" ) then
		ply:SetTeam( 1 ) // Where team 1 = warden
	end
end

hook.Add( "PlayerSay", "ChatCommands", ChatCommand )