Raised This Month: $ Target: $400
 0% 

Need help with model menu!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
vato loco [GE-S]
Veteran Member
Join Date: Oct 2006
Location: Germany
Old 08-31-2009 , 12:52   Re: Need help with model menu!
Reply With Quote #1

sorry don't know enything about hns never played it !!!
but in my kz plugin you can also type /spec
and you go to spectator but the player flag is set dead
PHP Code:
set_pev(idpev_deadflagDEAD_DEAD
player is not alive.
if you want i edit the code that i post and put the spec stuff in
like in your original code...but no garanty that it will work hehehe

when your are sure that you alive as spectator here try it
i have add the spec stuff in this code
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",
    
"models/player/bender_futurama_spec/bender_futurama_spec.mdl",
    
"models/player/halo_spec/halo_spec.mdl",
    
"models/player/skeleton_spec/skeleton_spec.mdl",
    
"models/player/agentsmith_spec/agentsmith_spec.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 
23:
                    {
                        
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 
43:
                    {
                        
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 
53:
                    {
                        
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 
63:
                    {
                        
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 
23:
                    {
                        
cs_set_user_modeliClient"bender_futurama_ct" );
                        
g_PlayerModel[iClient] = 22
                    
}
                    
                    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 
43:
                    {
                        
cs_set_user_modeliClient"skeleton_ct" );
                        
g_PlayerModel[iClient] = 42
                    
}
                    
                    case 
51
                    {
                        
cs_set_user_modeliClient"agentsmith_ct" );
                        
g_PlayerModel[iClient] = 52
                    
}
                    
                    case 
52cs_set_user_modeliClient"agentsmith_ct" );
                        
                    case 
53:
                    {
                        
cs_set_user_modeliClient"agentsmith_ct" );                        cs_set_user_modeliClient"agentsmith_ct" );
                        
g_PlayerModel[iClient] = 52
                    
}
                    
                    case 
61
                    {
                        
cs_set_user_modeliClient"halo_ct" );
                        
g_PlayerModel[iClient] = 62
                    
}
                    
                    case 
62cs_set_user_modeliClient"halo_ct" );
                        
                    case 
63
                    {
                        
cs_set_user_modeliClient"halo_ct" );
                        
g_PlayerModel[iClient] = 62
                    
}
                    
                }
            }
            case 
CS_TEAM_SPECTATOR:
            {
                switch(
g_PlayerModelID)
                {
                    case 
23cs_set_user_modeliClient"bender_futurama_spec" );    
                        
                    case 
43cs_set_user_modeliClient"skeleton_spec" );
                        
                    case 
53cs_set_user_modeliClient"agentsmith_spec" );
                        
                    case 
63cs_set_user_modeliClient"halo_spec" );
                        
                }
            }
        }
    }
}

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 
CS_TEAM_SPECTATOR:
                {
                    if ( 
is_user_aliveid ) )
                    {
                        
cs_set_user_modelid"bender_futurama_spec" );
                        
g_PlayerModel[id] = 23
                        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 
CS_TEAM_SPECTATOR:
                {
                    if ( 
is_user_aliveid ) )
                    {
                        
cs_set_user_modelid"skeleton_spec" );
                        
g_PlayerModel[id] = 43
                        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 
CS_TEAM_SPECTATOR:
                {
                    if ( 
is_user_aliveid ) )
                    {
                        
cs_set_user_modelid"agentsmith_spec" );
                        
g_PlayerModel[id] = 53
                        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
                    
}
                }
                case 
CS_TEAM_SPECTATOR:
                {
                    if ( 
is_user_aliveid ) )
                    {
                        
cs_set_user_modelid"halo_spec" );
                        
g_PlayerModel[id] = 63
                        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 14:24.
vato loco [GE-S] 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:00.


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