Raised This Month: $ Target: $400
 0% 

Help! Argument Type Mismatch Error when compiling


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ic3z
Junior Member
Join Date: Jun 2009
Old 08-30-2009 , 16:18   Help! Argument Type Mismatch Error when compiling
Reply With Quote #1

Hey guys, I'm trying to make an admin model menu plugin but I'm having some problems.

I get an error when I'm compiling my plugin, Argument Type Mismatch Error <argument 2>

Code:
/home/groups/amxmodx/tmp3/phpDKe0hN.sma(85) : error 035: argument type mismatch (argument 2)
/home/groups/amxmodx/tmp3/phpDKe0hN.sma(86) : error 035: argument type mismatch (argument 2)
/home/groups/amxmodx/tmp3/phpDKe0hN.sma(93) : error 035: argument type mismatch (argument 2)
/home/groups/amxmodx/tmp3/phpDKe0hN.sma(94) : error 035: argument type mismatch (argument 2)
/home/groups/amxmodx/tmp3/phpDKe0hN.sma(95) : error 035: argument type mismatch (argument 2)
/home/groups/amxmodx/tmp3/phpDKe0hN.sma(102) : error 035: argument type mismatch (argument 2)
/home/groups/amxmodx/tmp3/phpDKe0hN.sma(103) : error 035: argument type mismatch (argument 2)
/home/groups/amxmodx/tmp3/phpDKe0hN.sma(110) : error 035: argument type mismatch (argument 2)
/home/groups/amxmodx/tmp3/phpDKe0hN.sma(111) : error 035: argument type mismatch (argument 2)
/home/groups/amxmodx/tmp3/phpDKe0hN.sma(112) : error 035: argument type mismatch (argument 2)
/home/groups/amxmodx/tmp3/phpDKe0hN.sma(119) : error 035: argument type mismatch (argument 2)
/home/groups/amxmodx/tmp3/phpDKe0hN.sma(120) : error 035: argument type mismatch (argument 2)
/home/groups/amxmodx/tmp3/phpDKe0hN.sma(121) : error 035: argument type mismatch (argument 2)
/home/groups/amxmodx/tmp3/phpDKe0hN.sma(128) : error 035: argument type mismatch (argument 2)
/home/groups/amxmodx/tmp3/phpDKe0hN.sma(129) : error 035: argument type mismatch (argument 2)
/home/groups/amxmodx/tmp3/phpDKe0hN.sma(130) : error 035: argument type mismatch (argument 2)
/home/groups/amxmodx/tmp3/phpDKe0hN.sma(177) : error 035: argument type mismatch (argument 2)
/home/groups/amxmodx/tmp3/phpDKe0hN.sma(184) : error 035: argument type mismatch (argument 2)
/home/groups/amxmodx/tmp3/phpDKe0hN.sma(199) : error 035: argument type mismatch (argument 2)
/home/groups/amxmodx/tmp3/phpDKe0hN.sma(208) : error 035: argument type mismatch (argument 2)
/home/groups/amxmodx/tmp3/phpDKe0hN.sma(217) : error 035: argument type mismatch (argument 2)
/home/groups/amxmodx/tmp3/phpDKe0hN.sma(232) : error 035: argument type mismatch (argument 2)
/home/groups/amxmodx/tmp3/phpDKe0hN.sma(241) : error 035: argument type mismatch (argument 2)
/home/groups/amxmodx/tmp3/phpDKe0hN.sma(256) : error 035: argument type mismatch (argument 2)
/home/groups/amxmodx/tmp3/phpDKe0hN.sma(265) : error 035: argument type mismatch (argument 2)
/home/groups/amxmodx/tmp3/phpDKe0hN.sma(274) : error 035: argument type mismatch (argument 2)
It seems to be coming up on every line with cs_set_user_model but i'm not sure what's causing the error and how to fix it.


Lines With Error
PHP Code:
case CS_TEAM_Tcs_set_user_modeliClientg_teleT );
case 
CS_TEAM_CTcs_set_user_modeliClientg_teleCt);

case 
CS_TEAM_Tcs_set_user_modeliClientg_benderFT );
case 
CS_TEAM_CTcs_set_user_modeliClientg_benderFCt );
case 
CS_TEAM_SPECTATORcs_set_user_modeliClientg_benderFSpec );

case 
CS_TEAM_Tcs_set_user_modeliClientg_benderBT );
case 
CS_TEAM_CTcs_set_user_modeliClientg_benderBCt );

case 
CS_TEAM_Tcs_set_user_modeliClientg_skelT );
case 
CS_TEAM_CTcs_set_user_modeliClientg_skelCt );
case 
CS_TEAM_SPECTATORcs_set_user_modeliClientg_skelSpec );

case 
CS_TEAM_Tcs_set_user_modeliClientg_agentSmT );
case 
CS_TEAM_CTcs_set_user_modeliClientg_agentSmCt );
case 
CS_TEAM_SPECTATORcs_set_user_modeliClientg_agentSmSpec );

case 
CS_TEAM_Tcs_set_user_modeliClientg_haloT );
case 
CS_TEAM_CTcs_set_user_modeliClientg_haloCt );
case 
CS_TEAM_SPECTATORcs_set_user_modeliClientg_haloSpec );

cs_set_user_modelidg_teleT );

cs_set_user_modelidg_teleCt );

cs_set_user_modelidg_benderFT );

cs_set_user_modelidg_benderFCt );

cs_set_user_modelidg_benderFSpec );

cs_set_user_modelidg_benderBT );

cs_set_user_modelidg_benderBCt );

cs_set_user_modelidg_skelT );

cs_set_user_modelidg_skelCt );

cs_set_user_modelidg_skelSpec );

cs_set_user_modelidg_agentSmT );

cs_set_user_modelidg_agentSmCt );

cs_set_user_modelidg_agentSmSpec );

cs_set_user_modelidg_haloT );

cs_set_user_modelidg_haloCt );

cs_set_user_modelidg_haloSpec ); 
It's probably really easy to fix or a stupid mistake, but i'm really new to this so any help would be appreciated.

Full Code
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fun>
#include <hamsandwich>

#define VERSION    "0.1"

#pragma semicolon 1

new g_teleCt;
new 
g_teleT;
new 
g_benderBT;
new 
g_benderBCt;
new 
g_benderFT;
new 
g_benderFCt;
new 
g_benderFSpec;
new 
g_haloT;
new 
g_haloCt;
new 
g_haloSpec;
new 
g_skelT;
new 
g_skelCt;
new 
g_skelSpec;
new 
g_agentSmT;
new 
g_agentSmCt;
new 
g_agentSmSpec;

public 
plugin_init( )
{
    
register_plugin"Admin Models"VERSION"Xellath" );
    
    
register_clcmd"say /models""chooseModel"ADMIN_BAN );

        
RegisterHam(Ham_Spawn"player""fwHamPlayerSpawn"1);
}

public 
plugin_precache( )
{
    
g_teleCt precache_model("models/player/admin/teletubby_ct.mdl");
    
g_teleT precache_model ("models/player/admin/teletubby_t.mdl");
    
g_benderBT precache_model("models/player/admin/bender_t.mdl");
    
g_benderBCt precache_model("models/player/admin/bender_ct.mdl");
    
g_benderFT precache_model("models/player/admin/bender_futurama_t.mdl");
    
g_benderFCt precache_model("models/player/admin/bender_futurama_ct.mdl");
    
g_benderFSpec precache_model("models/player/admin/bender_futurama_spec.mdl");
    
g_haloT precache_model("models/player/admin/halo_t.mdl");
    
g_haloCt precache_model("models/player/admin/halo_ct.mdl");
    
g_haloSpec precache_model("models/player/admin/halo_spec.mdl");
    
g_skelT precache_model("models/player/admin/skeleton_t.mdl");
    
g_skelCt precache_model("models/player/admin/skeleton_ct.mdl");
    
g_skelSpec precache_model("models/player/admin/skeleton_spec.mdl");
    
g_agentSmT precache_model("models/player/admin/agentsmith_t.mdl");
    
g_agentSmCt precache_model("models/player/admin/agentsmith_ct.mdl");
    
g_agentSmSpec precache_model("models/player/admin/agentsmith_spec.mdl");
    
//precache_model( "models/player/teletubby_t/teletubby_t.mdl" );
    
precache_model"models/player/admin/teletubby_tT.mdl" );
    
//precache_model( "models/player/teletubby_ct/teletubby_ct.mdl" );
    
precache_model"models/player/admin/teletubby_ctT.mdl" );
    
//precache_model( "models/player/bendert/bendert.mdl" );
    //precache_model( "models/player/benderct/benderct.mdl" );
    //precache_model( "models/player/bender_futurama_t/bender_futurama_t.mdl" );
    //precache_model( "models/player/bender_futurama_ct/bender_futurama_ct.mdl" );
    //precache_model( "models/player/bender_futurama_spec/bender_futurama_spec.mdl" );
    //precache_model( "models/player/halo_t/halo_t.mdl" );
    //precache_model( "models/player/halo_ct/halo_ct.mdl" );
    //precache_model( "models/player/halo_spec/halo_spec.mdl" );
    //precache_model( "models/player/skeleton_t/skeleton_t.mdl" );
    //precache_model( "models/player/skeleton_ct/skeleton_ct.mdl" );
    //precache_model( "models/player/skeleton_spec/skeleton_spec.mdl" );
    //precache_model( "models/player/agentsmith_t/agentsmith_t.mdl" );
    //precache_model( "models/player/agentsmith_ct/agentsmith_ct.mdl" );
    //precache_model( "models/player/agentsmith_spec/agentsmith_spec.mdl" );
}

public 
fwHamPlayerSpawniClient )
{
    if (
is_user_aliveiClient ))
    {
        new 
szModel32 ];
        
cs_get_user_modeliClientszModel31 );
        
        if ( 
containszModel"tele" ) )
        {
            switch ( 
cs_get_user_teamiClient ) )
            {
                case 
CS_TEAM_Tcs_set_user_modeliClientg_teleT );
                case 
CS_TEAM_CTcs_set_user_modeliClientg_teleCt );
            }
        }
        else if ( 
containszModel"benderF" ) )
        {
            switch ( 
cs_get_user_teamiClient ) )
            {
                case 
CS_TEAM_Tcs_set_user_modeliClientg_benderFT );
                case 
CS_TEAM_CTcs_set_user_modeliClientg_benderFCt );
                case 
CS_TEAM_SPECTATORcs_set_user_modeliClientg_benderFSpec );
            }
        }
        else if ( 
containszModel"benderB" ) )
        {
            switch ( 
cs_get_user_teamiClient ) )
            {
                case 
CS_TEAM_Tcs_set_user_modeliClientg_benderBT );
                case 
CS_TEAM_CTcs_set_user_modeliClientg_benderBCt );
            }
        }
        else if ( 
containszModel"skel" ) )
        {
            switch ( 
cs_get_user_teamiClient ) )
            {
                case 
CS_TEAM_Tcs_set_user_modeliClientg_skelT );
                case 
CS_TEAM_CTcs_set_user_modeliClientg_skelCt );
                case 
CS_TEAM_SPECTATORcs_set_user_modeliClientg_skelSpec );
            }
        }
        else if ( 
containszModel"agentSm" ) )
        {
            switch ( 
cs_get_user_teamiClient ) )
            {
                case 
CS_TEAM_Tcs_set_user_modeliClientg_agentSmT );
                case 
CS_TEAM_CTcs_set_user_modeliClientg_agentSmCt );
                case 
CS_TEAM_SPECTATORcs_set_user_modeliClientg_agentSmSpec );
            }
        }
        else if ( 
containszModel"halo" ) )
        {
            switch ( 
cs_get_user_teamiClient ) )
            {
                case 
CS_TEAM_Tcs_set_user_modeliClientg_haloT );
                case 
CS_TEAM_CTcs_set_user_modeliClientg_haloCt );
                case 
CS_TEAM_SPECTATORcs_set_user_modeliClientg_haloSpec );
            }
        }
    }
}

public 
chooseModelid )
{
    if ( !( 
get_user_flagsid ) & ADMIN_BAN ) )
        return 
PLUGIN_HANDLED;
    
    new 
menu menu_create"\rModel Menu""menu_handler" );
    
    
menu_additemmenu"Teletubby""1");
    
menu_additemmenu"Bender (Futurama)""2");
    
menu_additemmenu"Bender""3");
    
menu_additemmenu"Skeleton""4");
    
menu_additemmenu"Agent Smith""5");
    
menu_additemmenu"Halo""6");
    
    
menu_displayidmenu);
    
    return 
PLUGIN_HANDLED;
}

public 
menu_handleridmenuitem )
{
    if ( 
item == MENU_EXIT )
    {
        
menu_destroymenu );
        return 
PLUGIN_HANDLED;
    }
    
    new 
data], iName64 ];
    new 
accesscallback;
    
menu_item_getinfomenuitemaccessdata,5iName63callback );
    
    switch ( 
str_to_numdata ) )
    {
        case 
1:
        {
            switch ( 
cs_get_user_teamid ) )
            {
                case 
CS_TEAM_T:
                {
                    if ( 
is_user_aliveid ) )
                    {
                        
cs_set_user_modelidg_teleT );
                    }
                }
                case 
CS_TEAM_CT:
                {
                    if ( 
is_user_aliveid ) )
                    {
                        
cs_set_user_modelidg_teleCt );

                        
//set_user_rendering( id, kRenderFxGlowShell, random(255), random(255), random(255), kRenderNormal, 20 ); // RANDOM GLOW - 0, 0, 255 = BLUE
                    
}
                }
            }
        }
        case 
2:
{
            switch ( 
cs_get_user_teamid ) )
            {
                case 
CS_TEAM_T:
                {
                    if ( 
is_user_aliveid ) )
                    {
                        
cs_set_user_modelidg_benderFT );

                        
//set_user_rendering( id, kRenderFxGlowShell, random(255), random(255), random(255), kRenderNormal, 20 ); // RANDOM GLOW - 255, 0, 0 = RED
                    
}
                }
                case 
CS_TEAM_CT:
                {
                    if ( 
is_user_aliveid ) )
                    {
                        
cs_set_user_modelidg_benderFCt );

                        
//set_user_rendering( id, kRenderFxGlowShell, random(255), random(255), random(255), kRenderNormal, 20 ); // RANDOM GLOW - 0, 0, 255 = BLUE
                    
}
                }
                case 
CS_TEAM_SPECTATOR:
                {
                    if ( 
is_user_aliveid ) )
                    {
                        
cs_set_user_modelidg_benderFSpec );

                        
//set_user_rendering( id, kRenderFxGlowShell, random(255), random(255), random(255), kRenderNormal, 20 ); // RANDOM GLOW - 0, 0, 255 = BLUE
                    
}
                }
            }
        }
        case 
3:
{
            switch ( 
cs_get_user_teamid ) )
            {
                case 
CS_TEAM_T:
                {
                    if ( 
is_user_aliveid ) )
                    {
                        
cs_set_user_modelidg_benderBT );

                        
//set_user_rendering( id, kRenderFxGlowShell, random(255), random(255), random(255), kRenderNormal, 20 ); // RANDOM GLOW - 255, 0, 0 = RED
                    
}
                }
                case 
CS_TEAM_CT:
                {
                    if ( 
is_user_aliveid ) )
                    {
                        
cs_set_user_modelidg_benderBCt );

                        
//set_user_rendering( id, kRenderFxGlowShell, random(255), random(255), random(255), kRenderNormal, 20 ); // RANDOM GLOW - 0, 0, 255 = BLUE
                    
}
                }
            }
        }
        case 
4:
{
            switch ( 
cs_get_user_teamid ) )
            {
                case 
CS_TEAM_T:
                {
                    if ( 
is_user_aliveid ) )
                    {
                        
cs_set_user_modelidg_skelT );

                        
//set_user_rendering( id, kRenderFxGlowShell, random(255), random(255), random(255), kRenderNormal, 20 ); // RANDOM GLOW - 255, 0, 0 = RED
                    
}
                }
                case 
CS_TEAM_CT:
                {
                    if ( 
is_user_aliveid ) )
                    {
                        
cs_set_user_modelidg_skelCt );

                        
//set_user_rendering( id, kRenderFxGlowShell, random(255), random(255), random(255), kRenderNormal, 20 ); // RANDOM GLOW - 0, 0, 255 = BLUE
                    
}
                }
                case 
CS_TEAM_SPECTATOR:
                {
                    if ( 
is_user_aliveid ) )
                    {
                        
cs_set_user_modelidg_skelSpec );

                        
//set_user_rendering( id, kRenderFxGlowShell, random(255), random(255), random(255), kRenderNormal, 20 ); // RANDOM GLOW - 0, 0, 255 = BLUE
                    
}
                }
            }
        }
        case 
5:
{
            switch ( 
cs_get_user_teamid ) )
            {
                case 
CS_TEAM_T:
                {
                    if ( 
is_user_aliveid ) )
                    {
                        
cs_set_user_modelidg_agentSmT );

                        
//set_user_rendering( id, kRenderFxGlowShell, random(255), random(255), random(255), kRenderNormal, 20 ); // RANDOM GLOW - 255, 0, 0 = RED
                    
}
                }
                case 
CS_TEAM_CT:
                {
                    if ( 
is_user_aliveid ) )
                    {
                        
cs_set_user_modelidg_agentSmCt );

                        
//set_user_rendering( id, kRenderFxGlowShell, random(255), random(255), random(255), kRenderNormal, 20 ); // RANDOM GLOW - 0, 0, 255 = BLUE
                    
}
                }
                case 
CS_TEAM_SPECTATOR:
                {
                    if ( 
is_user_aliveid ) )
                    {
                        
cs_set_user_modelidg_agentSmSpec );

                        
//set_user_rendering( id, kRenderFxGlowShell, random(255), random(255), random(255), kRenderNormal, 20 ); // RANDOM GLOW - 0, 0, 255 = BLUE
                    
}
                }
            }
        }
        case 
6:
{
            switch ( 
cs_get_user_teamid ) )
            {
                case 
CS_TEAM_T:
                {
                    if ( 
is_user_aliveid ) )
                    {
                        
cs_set_user_modelidg_haloT );

                        
//set_user_rendering( id, kRenderFxGlowShell, random(255), random(255), random(255), kRenderNormal, 20 ); // RANDOM GLOW - 255, 0, 0 = RED
                    
}
                }
                case 
CS_TEAM_CT:
                {
                    if ( 
is_user_aliveid ) )
                    {
                        
cs_set_user_modelidg_haloCt );

                        
//set_user_rendering( id, kRenderFxGlowShell, random(255), random(255), random(255), kRenderNormal, 20 ); // RANDOM GLOW - 0, 0, 255 = BLUE
                    
}
                }
                case 
CS_TEAM_SPECTATOR:
                {
                    if ( 
is_user_aliveid ) )
                    {
                        
cs_set_user_modelidg_haloSpec );

                        
//set_user_rendering( id, kRenderFxGlowShell, random(255), random(255), random(255), kRenderNormal, 20 ); // RANDOM GLOW - 0, 0, 255 = BLUE
                    
}
                }
            }
        }
    }
    
    return 
PLUGIN_HANDLED;

Thanks,
ic3z

Last edited by ic3z; 08-30-2009 at 16:31.
ic3z is offline
VMAN
Senior Member
Join Date: Oct 2007
Location: California, US
Old 08-30-2009 , 16:25   Re: Help! Argument Type Mismatch Error when compiling
Reply With Quote #2

http://www.amxmodx.org/funcwiki.php?...odel&go=search

cs_set_user_model ( index, const model[] )

model is set as "gign" or "leet", for example, NOT "models/player/gign/gign.mdl".

----------------------------

So for example line 85: cs_set_user_model( iClient, g_teleT );

g_teleT is precache_model ("models/player/admin/teletubby_t.mdl");

Second parameter, in your case, would be teletubby
VMAN is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-30-2009 , 16:27   Re: Help! Argument Type Mismatch Error when compiling
Reply With Quote #3

I believe all player models must be in the folder with the same name as the model's file name.

Code:
/models/player/mymodel/mymodel.mdl
Then when you use set_user_model you must only use "mymodel" as the second parameter as VMAN stated.
__________________
fysiks is offline
ic3z
Junior Member
Join Date: Jun 2009
Old 08-30-2009 , 16:33   Re: Help! Argument Type Mismatch Error when compiling
Reply With Quote #4

Thanks for the very quick replies, I'll take in mind what you guys have said and edit my plugin, let you know if it works +karma to both of you!

Edit: It compiled! And I'm just about to check that it does what I wanted it to do

Edit2: Not doing quite what I wanted, help me more? http://forums.alliedmods.net/showthread.php?t=102180

Last edited by ic3z; 08-30-2009 at 17:25.
ic3z 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:14.


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