Raised This Month: $ Target: $400
 0% 

[Cancelled] BanClient error compilation


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
eric0279
AlliedModders Donor
Join Date: May 2007
Old 04-18-2014 , 00:07   [Cancelled] BanClient error compilation
Reply With Quote #1

Hello,

PHP Code:

new Handle:g_hTimeBan INVALID_HANDLE;

new 
String:g_sIssue[MAXPLAYERS 1][32];
new 
String:g_sTarget[MAXPLAYERS 1][32];
new 
String:g_sCaller[MAXPLAYERS 1][32];
new 
String:g_sCallerAuth[MAXPLAYERS 1][32];
new 
String:g_sCallerName[MAXPLAYERS 1][32];

new 
g_iMessageSent[MAXPLAYERS 1] = 0;

public 
OnPluginStart()
{        
    
    
g_hTimeBan =             CreateConVar("vb_timeban","60.0","If ban is enabled, the amount of time in minutes to ban the offender.");
    
AutoExecConfig(true,"VoteBlocker");

    
AddCommandListener(VoteStart,"callvote");

}
public 
Action:VoteStart(client,const String:command[],argc)
{
    if (
GetConVarInt(g_hEnable) == 1)
    {
        
GetCmdArg(1,g_sIssue[client],sizeof(g_sIssue[]));
        
GetCmdArg(2,g_sTarget[client],sizeof(g_sTarget[]));
        
Format(g_sCaller[client],sizeof(g_sCaller[]),"%s",client);
        
GetClientAuthString(client,g_sCallerAuth[client],sizeof(g_sCallerAuth[]));
        
GetClientName(client,g_sCallerName[client],sizeof(g_sCallerName[]));
        new 
target GetClientOfUserId(StringToInt(g_sTarget[client]));
        
VoteStringsToLower(client);
        if(!
CheckCommandAccess(client,g_sIssue[client],ADMFLAG_RESERVATION,true))
        {
            if (
StrEqual(g_sIssue[client],"kick") && (GetConVarInt(g_hKickImmunity) > 0) && IsClientImmune(target))
            {
                
PrintToChat(client,"%s You cannot kick that player (Admin or member Community)!",PREFIX);
                
PrintToChat(target,"%s %s tried to kick you!",PREFIX,g_sCallerName[client]);
                if (
GetConVarInt(g_hKickImmunity) == 2)
                {
                    
KickCaller(client);
                    new 
Float:banTime GetConVarFloat(g_hTimeBan);
                    
BanClient(g_sCallerName[client], Float:banTimeBANFLAG_AUTO,  "Temp Ban: You cannot kick that player""Temp Ban: You cannot kick  that player""sm_ban"g_sCallerName[client]);
                }
                if (
GetConVarInt(g_hLog) == 1)
                {
                    
LogBlockedVote(client);
                }
                return 
Plugin_Handled;
            }
        return 
Plugin_Continue;
        }
        return 
Plugin_Continue;
    }
    return 
Plugin_Continue;

return:
Quote:
error 035: argument type mismatch (argument 1)
for this line BanClient...

How to fix please?

Sincerely,

Original plugin: Vote Blocker

Last edited by eric0279; 08-13-2014 at 14:08.
eric0279 is offline
MasterOfTheXP
Veteran Member
Join Date: Aug 2011
Location: Cloudbank
Old 04-18-2014 , 00:44   Re: BanClient error compilation
Reply With Quote #2

BanClient needs an integer (client index) for its first argument, not a string. g_sCallerName is a string (noted by the Hungarian notation "s" in front of "CallerName")
__________________
Plugins / My Steam / TF2 Sandbox (plugin beta testing!)
MasterOfTheXP 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 15:53.


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