Raised This Month: $ Target: $400
 0% 

Argument type mismatch


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 12-19-2011 , 09:08   Argument type mismatch
Reply With Quote #1

PHP Code:
#include <amxmodx>
#include <amxmisc>

public plugin_init()
{
    
register_logevent("Cmd_Check_Name"2"1=Round_Start")
}

public 
Cmd_Check_Name(id)
{        
    if(
is_user_admin(id))
    {
        new 
szName[32]
        
get_user_name(idszName31)
        
        if(
contain(szName"[ADMIN]"))
        {
            return 
PLUGIN_HANDLED
        
}
        else
        {
            
client_cmd("name ^"[ADMIN] %s^""szName)
            return 
PLUGIN_HANDLED
        
}
    }
    return 
PLUGIN_HANDLED

Why have the problem here?

PHP Code:
if(contain(szName"[ADMIN]")) 
__________________
kramesa is offline
kiki33hun
Veteran Member
Join Date: Jul 2011
Location: Magyarország
Old 12-19-2011 , 09:13   Re: Argument type mismatch
Reply With Quote #2

PHP Code:
#include <amxmodx> 
#include <amxmisc> 

public plugin_init() 

    
register_logevent("Cmd_Check_Name"2"1=Round_Start"


public 
Cmd_Check_Name(id
{         
    if(
is_user_admin(id)) 
    { 
        new 
szName[32
        
get_user_name(idszName31
         
        if(
contain(szName"[ADMIN]")) 
        { 
            return 
PLUGIN_HANDLED 
        

        else 
        { 
            
client_cmd(id"name ^"[ADMIN] %s^""szName
            return 
PLUGIN_HANDLED 
        

    } 
    return 
PLUGIN_HANDLED 

__________________
kiki33hun is offline
JoKeR LauGh
Veteran Member
Join Date: May 2011
Location: Malaysia
Old 12-19-2011 , 09:18   Re: Argument type mismatch
Reply With Quote #3

ohh sorry , I was late ;)

anyway , you got the error is because you missed the first parameter , it should be index
__________________
Quote:
Originally Posted by addons_zz View Post
Also, just to not read `the article`, read all you find. Read and read, for ever and ever. Never stop reading.
Why? Because there is not one single universal truth which holds the meaning for everything.

Last edited by JoKeR LauGh; 12-19-2011 at 09:19.
JoKeR LauGh is offline
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 12-19-2011 , 09:25   Re: Argument type mismatch
Reply With Quote #4

Wow, i dont see the change
__________________
kramesa is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 12-19-2011 , 10:00   Re: Argument type mismatch
Reply With Quote #5

There's no id passed in the Round_Start log event.
__________________

Last edited by hleV; 12-19-2011 at 10:00.
hleV is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-19-2011 , 10:48   Re: Argument type mismatch
Reply With Quote #6

PHP Code:
/*    Formatright © 2011, ConnorMcLeod 

    Admins & VIPs Tags is free software; 
    you can redistribute it and/or modify it under the terms of the 
    GNU General Public License as published by the Free Software Foundation. 

    This program is distributed in the hope that it will be useful, 
    but WITHOUT ANY WARRANTY; without even the implied warranty of 
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    GNU General Public License for more details. 

    You should have received a copy of the GNU General Public License 
    along with Admins Tag; if not, write to the 
    Free Software Foundation, Inc., 59 Temple Place - Suite 330, 
    Boston, MA 02111-1307, USA. 
*/ 

#define FLAG_ADMIN_ADMIN        ADMIN_BAN // obligatoirement un flag que les VIPs n'ont pas
#define FLAG_ADMIN_VIP        ADMIN_LEVEL_B

#include <amxmodx> 

#define VERSION "0.0.1" 

#define MAX_NAME_LENGTH    32 

new g_pCvarAdminTagg_pCvarVipTagg_pCvarVipPlaceg_pCvarAdminPlace

public plugin_init() 

    
register_plugin("Admins & VIPs Tags"VERSION"ConnorMcLeod"

    
g_pCvarAdminTag register_cvar("amx_admin_tag""[ADMIN]"
    
g_pCvarVipTag register_cvar("amx_vip_tag""[VIP]")
    
g_pCvarVipPlace register_cvar("amx_vip_tag_potision""0"// 0 left, 1 right
    
g_pCvarAdminPlace register_cvar("amx_admin_tag_potision""0")


public 
client_authorizedid 

    new 
iAdminType get_user_admin(id)
    if( !
iAdminType )
    {
        return
    }
    new 
szName[MAX_NAME_LENGTH
    new 
iNameLen get_user_name(idszNamecharsmax(szName)) 
    
CheckUserName(idszNameiNameLeniAdminType)  


public 
client_infochanged(id

    if( 
is_user_connected(id) ) 
    {
        new 
iAdminType get_user_admin(id)
        if( !
iAdminType )
        {
            return
        }
        new 
szOldName[MAX_NAME_LENGTH],szNewName[MAX_NAME_LENGTH
        
get_user_name(idszOldNamecharsmax(szOldName)) 
        new 
iNameLen get_user_info(id"name"szNewNamecharsmax(szNewName)) 
        if( !
equal(szOldNameszNewName) ) 
        { 
            
CheckUserName(idszNewNameiNameLeniAdminType
        }
    } 


CheckUserName(const idszName[MAX_NAME_LENGTH], const iNameLen, const iAdminType

    new 
szTag[32
    new 
iTagLen get_pcvar_string(iAdminType == FLAG_ADMIN_VIP g_pCvarVipTag g_pCvarAdminTagszTagcharsmax(szTag))

    if( 
containi(szNameszTag) != -
    { 
        return 
    } 

    if( 
get_pcvar_num(iAdminType == FLAG_ADMIN_VIP g_pCvarVipPlace g_pCvarAdminPlace) )
    {
        if( 
MAX_NAME_LENGTH iNameLen iTagLen 
        { 
            
add(szNamecharsmax(szName), szTag
        } 
        else 
        { 
            
formatex(szName[MAX_NAME_LENGTH-iTagLen-1], iTagLenszTag
        }
    }
    else
    {
        
format(szNamecharsmax(szName), "%s %s"szTagszName)
    }

    
set_user_info(id"name"szName


get_user_admin(id

    new 
__flags=get_user_flags(id)
    if( 
__flags>&& !(__flags&ADMIN_USER) )
    {
        if( 
__flags FLAG_ADMIN_ADMIN )
        {
            return 
FLAG_ADMIN_ADMIN
        
}
        else if( 
__flags FLAG_ADMIN_VIP )
        {
            return 
FLAG_ADMIN_VIP
        
}
    }
    return 
0

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 12-19-2011 , 10:59   Re: Argument type mismatch
Reply With Quote #7

Thx Connor. Can check if admins have tag in 15 - 15 seconds?
__________________

Last edited by kramesa; 12-19-2011 at 11:01.
kramesa is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-19-2011 , 13:58   Re: Argument type mismatch
Reply With Quote #8

Quote:
Originally Posted by kramesa View Post
15 - 15 seconds
What does that mean?
__________________
fysiks is offline
Reply


Thread Tools
Display Modes

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 11:48.


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