Raised This Month: $51 Target: $400
 12% 

kick plugin -> ban plugin change ... help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
laenss
Member
Join Date: Feb 2017
Old 04-26-2017 , 02:24   kick plugin -> ban plugin change ... help
Reply With Quote #1

I want to change this plug-in to the ban PlugIn

Can I replace this plug-in with a ban PlugIn plug-in?
You must record who applied for the vote

thx

PHP Code:
#include <sourcemod>
#include <sdktools>
#include <adminmenu>
#pragma semicolon 1

#define PREFIX "[\x05LANESS\x01]"

public Plugin:myinfo =
{
    
name        "Vote Kick System",
    
author        "",
    
description "Made for Server",
    
version     "1.0.0",
    
url         ""
};

new 
g_Client[MAXPLAYERS+1];
new 
g_Target;
new 
String:g_Reason[256];
new 
bool:g_VoteKick;

public 
OnPluginStart()
{
    
RegConsoleCmd("sm_vk"Command_VoteKick);
}

public 
OnMapStart()
{
    
g_VoteKick false;
}

public 
Action:Command_VoteKick(Clientargs)
{
    if(!
g_VoteKick)
    {
        
DisplayMenu_Target(Client);
    }
    else
    {
        
PrintToChat(Client"%s 이미 투표가 진행 중입니다."PREFIX);
    }
    return 
Plugin_Handled;
}

DisplayMenu_Target(Client)
{
    new 
Handle:MenuHandle CreateMenu(MenuHandler_Target);
    new 
bool:DisplayPlayer false;
    
    new 
String:Title[256];
    
Format(Titlesizeof(Title), "어떤 플레이어를 추방하시겠습니까?\n ");
    
SetMenuTitle(MenuHandleTitle);
    
    for(new 
1<= MaxClientsi++)
    {
        if(!
IsClientInGame(i) || IsFakeClient(i) || == Client)
        {
            continue;
        }

        new 
String:TargetID[32], String:TargetName[32];
        
IntToString(GetClientUserId(i), TargetIDsizeof(TargetID));
        
GetClientName(iTargetNamesizeof(TargetName));
        
AddMenuItem(MenuHandleTargetIDTargetName);
        if(!
DisplayPlayerDisplayPlayer true;
    }
    if(!
DisplayPlayer)
    {
        
AddMenuItem(MenuHandle"플레이어가 없습니다.""플레이어가 없습니다."ITEMDRAW_DISABLED);
    }
    
    
DisplayMenu(MenuHandleClientMENU_TIME_FOREVER);
}

public 
MenuHandler_Target(Handle:menuMenuAction:actionClientSelect)
{
    if(
action == MenuAction_Select && !g_VoteKick)
    {
        new 
String:Info[256], Userid;
        
GetMenuItem(menuSelectInfosizeof(Info));
        
Userid StringToInt(Info);
        
        if((
g_Client[Client] = GetClientOfUserId(Userid)) == 0)
        {
            
PrintToChat(Client"%s 해당 플레이어를 찾을 수 없습니다."PREFIX);
        }
        else
        {
            
DisplayMenu_Reason(Client);
        }
    }
    if(
action == MenuAction_EndCloseHandle(menu);
}

DisplayMenu_Reason(Client)
{
    new 
Handle:MenuHandle CreateMenu(MenuHandler_Reason);
    
    new 
String:Title[256];
    
Format(Titlesizeof(Title), "해당 플레이어의 사유를 선택하세요.\n ");
    
SetMenuTitle(MenuHandleTitle);
    
    
AddMenuItem(MenuHandle"사유""사유");
    
AddMenuItem(MenuHandle"사유""사유");
    
    
SetMenuExitBackButton(MenuHandletrue);
    
DisplayMenu(MenuHandleClientMENU_TIME_FOREVER);    
}

public 
MenuHandler_Reason(Handle:menuMenuAction:actionClientSelect)
{
    if(
action == MenuAction_Select && !g_VoteKick)
    {
        new 
String:Info[256];
        
GetMenuItem(menuSelectInfosizeof(Info));
        
        
g_Target g_Client[Client];
        
g_Reason Info;
        
g_VoteKick true;
        
        
PrintToChatAll("%s %N 님이 투표를 신청했습니다."PREFIXClient);
        
DisplayMenu_VoteKick();
    }
    if(
action == MenuAction_Cancel && Select == MenuCancel_ExitBack)
    {
        
DisplayMenu_Target(Client);
    }
    if(
action == MenuAction_EndCloseHandle(menu);
}

DisplayMenu_VoteKick()
{
    new 
Handle:MenuHandle CreateMenu(MenuHandler_VoteKick);
        
    new 
String:Title[256];
    
Format(Titlesizeof(Title), "%N 님을 추방하시겠습니까?\n사유: %s\n "g_Targetg_Reason);
    
SetMenuTitle(MenuHandleTitle);
        
    
AddMenuItem(MenuHandle"Yes""ㅇㅋ");
    
AddMenuItem(MenuHandle"No",  "ㄴㄴ");
        
    
SetMenuExitButton(MenuHandlefalse);
    
VoteMenuToAll(MenuHandle20);
}

public 
MenuHandler_VoteKick(Handle:menuMenuAction:actionClientSelect)
{
    if(
action == MenuAction_VoteEnd)
    {
        new 
String:Info[32];
        
GetMenuItem(menuClientInfosizeof(Info));

        if(
StrEqual(Info"Yes"false))
        {
            if(
IsClientInGame(g_Target))
            {
                
PrintToChatAll("%s 투표 결과 과반수를 넘겨 %N 님이 추방되었습니다. (사유: %s)"PREFIXg_Targetg_Reason);
                
KickClient(g_Target"투표 결과 과반수를 넘겨 추방되었습니다.");
            }
        }
        else
        {
            
PrintToChatAll("%s 투표 결과 과반수를 넘지 못하여 무효 처리합니다."PREFIX);
        }
        
g_VoteKick false;
    }

laenss is offline
B3none
AlliedModders Donor
Join Date: Oct 2016
Location: United Kingdom
Old 04-27-2017 , 15:07   Re: kick plugin -> ban plugin change ... help
Reply With Quote #2

I do not speak squiggles, sorry I couldn't be of use :/
__________________
B3none is offline
zyox123cc
Senior Member
Join Date: Jul 2016
Location: spycrab
Old 04-29-2017 , 22:22   Re: kick plugin -> ban plugin change ... help
Reply With Quote #3

Custom Votes Redux (v1.7 - 4/13/14)
https://forums.alliedmods.net/showthread.php?t=235115
done
__________________
sv_downloadurl Recommended FREE website
000webhost(File is too big (max. 32MB)! Upload will be skipped.)
rejetto
(Local_computer_host)
Getting material/model paths easy way (Windows)
steam profile
Youtube

Last edited by zyox123cc; 04-29-2017 at 22:23.
zyox123cc is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:05.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode