Raised This Month: $ Target: $400
 0% 

Need help with model menu!


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
vato loco [GE-S]
Veteran Member
Join Date: Oct 2006
Location: Germany
Old 08-31-2009 , 07:28   Re: Need help with model menu!
Reply With Quote #4

try this
not tested i have not the models !!!
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fun>
#include <hamsandwich>

#define VERSION    "0.1"

#define RANDOM_NUM  random_num(0,255)

new const g_ModelPath[][] = {
    
"models/player/teletubby_t/teletubby_t.mdl",
    
"models/player/teletubby_ct/teletubby_ct.mdl",
    
"models/player/bendert_t/bendert_t.mdl",
    
"models/player/bender_ct/bender_ct.mdl",
    
"models/player/bender_futurama_t/bender_futurama_t.mdl",
    
"models/player/bender_futurama_ct/bender_futurama_ct.mdl",
    
"models/player/halo_t/halo_t.mdl",
    
"models/player/halo_ct/halo_ct.mdl",
    
"models/player/skeleton_t/skeleton_t.mdl",
    
"models/player/skeleton_ct/skeleton_ct.mdl",
    
"models/player/agentsmith_t/agentsmith_t.mdl",
    
"models/player/agentsmith_ct/agentsmith_ct.mdl"
};

new 
g_PlayerModel[33]
new 
g_iPlayerAdmin[33]

public 
plugin_init( )
{
    
register_plugin"Admin Models"VERSION"icez" );
    
    
register_clcmd"say /models""chooseModel"ADMIN_BAN );
    
    
RegisterHam(Ham_Spawn"player""fwHamPlayerSpawn"1);
}

public 
plugin_precache( )
{
    for( new 
sizeofg_ModelPath ) ; i++ )
    {
        
precache_modelg_ModelPath[i] );
    }
}

public 
client_putinserver(iClient)
{
    if ( 
get_user_flagsiClient ) & ADMIN_BAN )
    {
        
g_iPlayerAdmin[iClient] = true
        g_PlayerModel
[iClient] = 0
    
}
}

public 
client_disconnect(iClient)
{
    if( 
g_iPlayerAdmin[iClient])
    {
        
g_iPlayerAdmin[iClient] = false
        g_PlayerModel
[iClient] = 0
    
}
}

public 
fwHamPlayerSpawniClient )
{
    if (
is_user_aliveiClient ) && g_iPlayerAdminiClient ])
    {
        new 
g_PlayerModelID g_PlayerModel[iClient]
        switch ( 
cs_get_user_teamiClient ) )
        {
            case 
CS_TEAM_T
            {
                switch(
g_PlayerModelID)
                {
                    case 
11cs_set_user_modeliClient"teletubby_t" );
                        
                    case 
12
                    {
                        
cs_set_user_modeliClient"teletubby_t" );
                        
g_PlayerModel[iClient] = 11
                    
}
                    
                    case 
21cs_set_user_modeliClient"bender_futurama_t" );
                        
                    case 
22
                    { 
                        
cs_set_user_modeliClient"bender_futurama_t" );
                        
g_PlayerModel[iClient] = 21
                    
}
                    
                    case 
31cs_set_user_modeliClient"bender_t" );
                        
                    case 
32
                    {
                        
cs_set_user_modeliClient"bender_t" );
                        
g_PlayerModel[iClient] = 31
                    
}
                    
                    case 
41cs_set_user_modeliClient"skeleton_t" );
                        
                    case 
42
                    {
                        
cs_set_user_modeliClient"skeleton_t" );
                        
g_PlayerModel[iClient] = 41
                    
}
                    
                    case 
51cs_set_user_modeliClient"agentsmith_t" );
                        
                    case 
52
                    {
                        
cs_set_user_modeliClient"agentsmith_t" );
                        
g_PlayerModel[iClient] = 51
                    
}
                    
                    case 
61cs_set_user_modeliClient"halo_t" );
                        
                    case 
62
                    {
                        
cs_set_user_modeliClient"halo_t" );
                        
g_PlayerModel[iClient] = 61
                    
}
                    
                }
            }
            case 
CS_TEAM_CT:
            { 
                switch(
g_PlayerModelID)
                {
                    case 
11
                    {
                        
cs_set_user_modeliClient"teletubby_ct" );
                        
g_PlayerModel[iClient] = 12
                    
}
                    
                    case 
12cs_set_user_modeliClient"teletubby_ct" );
                        
                    case 
21
                    {
                        
cs_set_user_modeliClient"bender_futurama_ct" );
                        
g_PlayerModel[iClient] = 22
                    
}
                    
                    case 
22cs_set_user_modeliClient"bender_futurama_ct" );
                        
                    case 
31
                    {
                        
cs_set_user_modeliClient"bender_ct" );
                        
g_PlayerModel[iClient] = 32
                    
}
                    
                    case 
32cs_set_user_modeliClient"bender_ct" );
                        
                    case 
41
                    {
                        
cs_set_user_modeliClient"skeleton_ct" );
                        
g_PlayerModel[iClient] = 42
                    
}
                    
                    case 
42cs_set_user_modeliClient"skeleton_ct" );
                        
                    case 
51
                    {
                        
cs_set_user_modeliClient"agentsmith_ct" );
                        
g_PlayerModel[iClient] = 52
                    
}
                    
                    case 
52cs_set_user_modeliClient"agentsmith_ct" );
                        
                    case 
61
                    {
                        
cs_set_user_modeliClient"halo_ct" );
                        
g_PlayerModel[iClient] = 62
                    
}
                    
                    case 
62cs_set_user_modeliClient"halo_ct" );
                        
                }
            }
        }
    }
}

public 
chooseModelid )
{
    if ( !
g_iPlayerAdmin[id] )
        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_modelid"teletubby_t" );
                        
g_PlayerModel[id] = 11
                        set_user_rendering
idkRenderFxGlowShellRANDOM_NUMRANDOM_NUM RANDOM_NUMkRenderNormal20 ); // RANDOM GLOW - 0, 0, 255 = BLUE                 
                    
}
                }
                case 
CS_TEAM_CT:
                {
                    if ( 
is_user_aliveid ) )
                    {
                        
cs_set_user_modelid"teletubby_ct" );
                        
g_PlayerModel[id] = 12
                        set_user_rendering
idkRenderFxGlowShellRANDOM_NUMRANDOM_NUM RANDOM_NUMkRenderNormal20 ); // RANDOM GLOW - 0, 0, 255 = BLUE
                    
}
                }
            }
        }
        case 
2:
        {
            switch ( 
cs_get_user_teamid ) )
            {
                case 
CS_TEAM_T:
                {
                    if ( 
is_user_aliveid ) )
                    {
                        
cs_set_user_modelid"bender_futurama_t" );
                        
g_PlayerModel[id] = 21
                        set_user_rendering
idkRenderFxGlowShellRANDOM_NUMRANDOM_NUMRANDOM_NUMkRenderNormal20 ); // RANDOM GLOW - 255, 0, 0 = RED
                    
}
                }
                case 
CS_TEAM_CT:
                {
                    if ( 
is_user_aliveid ) )
                    {
                        
cs_set_user_modelid"bender_futurama_ct" );
                        
g_PlayerModel[id] = 22
                        set_user_rendering
idkRenderFxGlowShellRANDOM_NUMRANDOM_NUMRANDOM_NUMkRenderNormal20 ); // RANDOM GLOW - 0, 0, 255 = BLUE
                    
}
                }
            }
        }
        case 
3:
        {
            switch ( 
cs_get_user_teamid ) )
            {
                case 
CS_TEAM_T:
                {
                    if ( 
is_user_aliveid ) )
                    {
                        
cs_set_user_modelid"bender_t" );
                        
g_PlayerModel[id] = 31
                        set_user_rendering
idkRenderFxGlowShellRANDOM_NUMRANDOM_NUMRANDOM_NUMkRenderNormal20 ); // RANDOM GLOW - 255, 0, 0 = RED
                    
}
                }
                case 
CS_TEAM_CT:
                {
                    if ( 
is_user_aliveid ) )
                    {
                        
cs_set_user_modelid"bender_ct" );
                        
g_PlayerModel[id] = 32
                        set_user_rendering
idkRenderFxGlowShellRANDOM_NUMRANDOM_NUMRANDOM_NUMkRenderNormal20 ); // RANDOM GLOW - 0, 0, 255 = BLUE
                    
}
                }
            }
        }
        case 
4:
        {
            switch ( 
cs_get_user_teamid ) )
            {
                case 
CS_TEAM_T:
                {
                    if ( 
is_user_aliveid ) )
                    {
                        
cs_set_user_modelid"skeleton_t" );
                        
g_PlayerModel[id] = 41
                        set_user_rendering
idkRenderFxGlowShellRANDOM_NUMRANDOM_NUMRANDOM_NUMkRenderNormal20 ); // RANDOM GLOW - 255, 0, 0 = RED
                    
}
                }
                case 
CS_TEAM_CT:
                {
                    if ( 
is_user_aliveid ) )
                    {
                        
cs_set_user_modelid"skeleton_ct" );
                        
g_PlayerModel[id] = 42
                        set_user_rendering
idkRenderFxGlowShellRANDOM_NUMRANDOM_NUMRANDOM_NUMkRenderNormal20 ); // RANDOM GLOW - 0, 0, 255 = BLUE
                    
}
                }
            }
        }
        case 
5:
        {
            switch ( 
cs_get_user_teamid ) )
            {
                case 
CS_TEAM_T:
                {
                    if ( 
is_user_aliveid ) )
                    {
                        
cs_set_user_modelid"agentsmith_t" );
                        
g_PlayerModel[id] = 51
                        set_user_rendering
idkRenderFxGlowShellRANDOM_NUMRANDOM_NUMRANDOM_NUMkRenderNormal20 ); // RANDOM GLOW - 255, 0, 0 = RED
                    
}
                }
                case 
CS_TEAM_CT:
                {
                    if ( 
is_user_aliveid ) )
                    {
                        
cs_set_user_modelid"agentsmith_ct" );
                        
g_PlayerModel[id] = 52
                        set_user_rendering
idkRenderFxGlowShellRANDOM_NUMRANDOM_NUMRANDOM_NUMkRenderNormal20 ); // RANDOM GLOW - 0, 0, 255 = BLUE
                    
}
                }
            }
        }
        case 
6:
        {
            switch ( 
cs_get_user_teamid ) )
            {
                case 
CS_TEAM_T:
                {
                    if ( 
is_user_aliveid ) )
                    {
                        
cs_set_user_modelid"halo_t" );
                        
g_PlayerModel[id] = 61
                        set_user_rendering
idkRenderFxGlowShellRANDOM_NUMRANDOM_NUMRANDOM_NUMkRenderNormal20 ); // RANDOM GLOW - 255, 0, 0 = RED
                    
}
                }
                case 
CS_TEAM_CT:
                {
                    if ( 
is_user_aliveid ) )
                    {
                        
cs_set_user_modelid"halo_ct" );
                        
g_PlayerModel[id] = 62
                        set_user_rendering
idkRenderFxGlowShellRANDOM_NUMRANDOM_NUMRANDOM_NUMkRenderNormal20 ); // RANDOM GLOW - 0, 0, 255 = BLUE
                    
}
                }
            }
        }
    }
    return 
PLUGIN_HANDLED;

__________________

Last edited by vato loco [GE-S]; 08-31-2009 at 08:29.
vato loco [GE-S] is offline
 



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:00.


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