about summary refs log tree commit diff
path: root/src/game/server/gamecontext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/server/gamecontext.cpp')
-rw-r--r--src/game/server/gamecontext.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/game/server/gamecontext.cpp b/src/game/server/gamecontext.cpp
index 795bb65f..c04dd945 100644
--- a/src/game/server/gamecontext.cpp
+++ b/src/game/server/gamecontext.cpp
@@ -647,6 +647,19 @@ void CGameContext::OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId)
 				SendChatTarget(ClientId, "Invalid client id to kick");
 				return;
 			}
+			if(KickId == ClientId)
+			{
+				SendChatTarget(ClientId, "You cant kick yourself");
+				return;
+			}
+			if(Server()->IsAuthed(KickId))
+			{
+				SendChatTarget(ClientId, "You cant kick admins");
+				char aBufKick[128];
+				str_format(aBufKick, sizeof(aBufKick), "%s called for vote to kick you", Server()->ClientName(ClientId));
+				SendChatTarget(KickId, aBufKick);
+				return;
+			}
 			
 			str_format(aChatmsg, sizeof(aChatmsg), "%s called for vote to kick '%s'", Server()->ClientName(ClientId), Server()->ClientName(KickId));
 			str_format(aDesc, sizeof(aDesc), "Kick '%s'", Server()->ClientName(KickId));