Raised This Month: $ Target: $400
 0% 

Compile error and i don't know why.


Post New Thread Reply   
 
Thread Tools Display Modes
goldenbuick707
Member
Join Date: Jun 2015
Old 06-27-2015 , 13:52   Re: Compile error and i don't know why.
Reply With Quote #11

Quote:
Originally Posted by ESK0 View Post
PHP Code:
#include <sourcemod>

public Plugin:myinfo = {
    
name "kick ping",
    
author "cgi",
    
description "Kick player by high ping",
    
version "0.1",
};

public 
OnPluginStart()
{
    
RegAdminCmd("sm_kickping"Command_KickADMFLAG_KICK)
}

public 
PerformKick(int client,int target)
{
    if (
target != -1)
    {
      
char name[MAX_NAME_LENGTH];
      
GetClientName(targetnamesizeof(name));
      
LogAction(clienttarget"\"%N\" kicked \"%N\" due high ping."clienttarget);
      
KickClient(target"You were kicked from server due high ping");
    }
}

public 
Action Command_Kick(int clientargs)
{
    if (
args 1)
    {
        
ReplyToCommand(client"[CGI] Usage: sm_kickping <playerid|name>");
        return 
Plugin_Handled;
    }

    
char Arguments[256];
    
GetCmdArgString(Argumentssizeof(Arguments));

    
char arg[65];
    
int len BreakString(Argumentsargsizeof(arg));

    if (
len == -1)
    {
        
len 0;
        
Arguments[0] = '\0';
    }

    
char target_name[MAX_TARGET_LENGTH];
    
int target_list[MAXPLAYERS];
    
int target_count;
    
bool tn_is_ml;

    if ((
target_count ProcessTargetString(
            
arg,
            
client,
            
target_list,
            
MAXPLAYERS,
            
COMMAND_FILTER_CONNECTED,
            
target_name,
            
sizeof(target_name),
            
tn_is_ml)) > 0)
    {
      
int kick_self 0;
      for (
int i 0target_counti++)
      {
          if (
target_list[i] == client)
          {
              
kick_self client;
          }
          else
          {
              
PerformKick(clienttarget_list[i]);
          }
      }
      if (
kick_self)
      {
          
PerformKick(clientclient);
      }
    }
    else
    {
        
ReplyToTargetError(clienttarget_count);
    }
    return 
Plugin_Handled;

Thank you very much!
goldenbuick707 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 00:09.


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