mirror of
https://github.com/Jackzmc/sourcemod-plugins.git
synced 2025-05-06 03:13:20 +00:00
Change kick logic
This commit is contained in:
parent
e30056b950
commit
2b1990d332
2 changed files with 4 additions and 2 deletions
Binary file not shown.
|
@ -70,7 +70,7 @@ public Action VoteStart(int client, const char[] command, int argc) {
|
||||||
PrintToServer("Preventing vote from user not in game: %N", client);
|
PrintToServer("Preventing vote from user not in game: %N", client);
|
||||||
return Plugin_Handled;
|
return Plugin_Handled;
|
||||||
}
|
}
|
||||||
if(GetClientCount(true) == 0 || client == 0) return Plugin_Handled; //prevent votes while server is empty or if server tries calling vote
|
if(GetClientCount(true) == 0 || client == 0 || client >= MaxClients) return Plugin_Handled; //prevent votes while server is empty or if server tries calling vote
|
||||||
if(argc >= 1) {
|
if(argc >= 1) {
|
||||||
static char issue[32];
|
static char issue[32];
|
||||||
|
|
||||||
|
@ -86,7 +86,6 @@ public Action VoteStart(int client, const char[] command, int argc) {
|
||||||
AdminId callerAdmin = GetUserAdmin(client);
|
AdminId callerAdmin = GetUserAdmin(client);
|
||||||
AdminId targetAdmin = GetUserAdmin(target);
|
AdminId targetAdmin = GetUserAdmin(target);
|
||||||
if(targetAdmin != INVALID_ADMIN_ID) { //Only run if vote is against an admin
|
if(targetAdmin != INVALID_ADMIN_ID) { //Only run if vote is against an admin
|
||||||
PrintToChat(target, "%N has attempted to vote kick you.", client);
|
|
||||||
for(int i = 1; i <= MaxClients; i++) {
|
for(int i = 1; i <= MaxClients; i++) {
|
||||||
if(target != i && IsClientConnected(i) && IsClientInGame(i) && GetUserAdmin(i) != INVALID_ADMIN_ID) {
|
if(target != i && IsClientConnected(i) && IsClientInGame(i) && GetUserAdmin(i) != INVALID_ADMIN_ID) {
|
||||||
PrintToChat(i, "%N attempted to vote-kick %N", client, target);
|
PrintToChat(i, "%N attempted to vote-kick %N", client, target);
|
||||||
|
@ -94,6 +93,9 @@ public Action VoteStart(int client, const char[] command, int argc) {
|
||||||
}
|
}
|
||||||
if(callerAdmin == INVALID_ADMIN_ID && GetTime() - iJoinTime[client] <= 120) {
|
if(callerAdmin == INVALID_ADMIN_ID && GetTime() - iJoinTime[client] <= 120) {
|
||||||
KickClient(client, "No.");
|
KickClient(client, "No.");
|
||||||
|
PrintToChat(target, "%N has attempted to vote kick you and was kicked.", client);
|
||||||
|
} else {
|
||||||
|
PrintToChat(target, "%N has attempted to vote kick you.", client);
|
||||||
}
|
}
|
||||||
return Plugin_Handled;
|
return Plugin_Handled;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue