Raised This Month: $32 Target: $400
 8% 

Help With vip model menu


Post New Thread Reply   
 
Thread Tools Display Modes
alicx
BANNED
Join Date: Mar 2013
Location: Tunisia
Old 04-25-2013 , 14:25   Re: Help With vip model menu
Reply With Quote #21

Thanks a lot sychic and Ukolix <3 you are so helpful
alicx is offline
Send a message via MSN to alicx Send a message via Skype™ to alicx
alicx
BANNED
Join Date: Mar 2013
Location: Tunisia
Old 04-25-2013 , 14:27   Re: Help With vip model menu
Reply With Quote #22

but if possible add this :
*a cvar: model_choose # (if 0= plugin deactivated / 1= with Menu / 2= Random model)
alicx is offline
Send a message via MSN to alicx Send a message via Skype™ to alicx
ABiiDOS
New Member
Join Date: Apr 2015
Location: DZ
Old 04-19-2015 , 04:16   Re: Help With vip model menu
Reply With Quote #23

hi all
how to use the cods??
ABiiDOS is offline
Send a message via Yahoo to ABiiDOS
ANTICHRISTUS
kingdom of weird stuff
Join Date: Jun 2010
Location: My kingdom is not in thi
Old 04-19-2015 , 17:38   Re: Help With vip model menu
Reply With Quote #24

  1. Put code into a .txt file.
  2. Change extention from .txt to .sma
  3. Compile the plugin (locally or using the web compiled (there is a tutorial in my sig → useful links).
__________________
ANTICHRISTUS is offline
FitnessMan
Junior Member
Join Date: Oct 2014
Old 04-22-2015 , 11:06   Re: Help With vip model menu
Reply With Quote #25

How to make this plugin for CT only and make for ADMIN_RESERVATION 4 models,for BaseBuilder 6.5 by Tirant.

Last edited by FitnessMan; 04-22-2015 at 11:06.
FitnessMan is offline
ALonsoVIP4141
BANNED
Join Date: May 2021
Location: https://t.me/pump_upp
Old 06-28-2021 , 13:20   Re: Help With vip model menu
Reply With Quote #26

Quote:
Originally Posted by Unkolix View Post
Nevermind... Just use this one then:
PHP Code:
#include < amxmodx > 
#include < cstrike > 

#define PLUGIN "Vip Skins Menu" 
#define VERSION "1.0" 
#define AUTHOR "Alicx" 

new has_CT_1[33], has_CT_2[33], has_TT_1[33], has_TT_2[33];

public 
plugin_precache() 

    
precache_model("models/player/CT_1/CT_1.mdl"); 
    
precache_model("models/player/CT_2/CT_2.mdl"); 
    
precache_model("models/player/TT_1/TT_1.mdl"); 
    
precache_model("models/player/TT_2/TT_2.mdl"); 


public 
plugin_init() { 
    
register_plugin(PLUGINVERSIONAUTHOR
    
    
register_event("HLTV""event_new_round""a""1=0""2=0")
    
    
register_clcmd"say /myskin",  "Skins_Menu" ); 
}

public 
event_new_round(id) {
    if(
has_CT_1[id]) {
        
cs_set_user_model(id"CT_1");
    }
    else if(
has_CT_2[id]) {
        
cs_set_user_model(id"CT_2");
    }
    else if(
has_TT_1[id]) {
        
cs_set_user_model(id"TT_1");
    }
    else if(
has_TT_2[id]) {
        
cs_set_user_model(id"TT_2");
    }
}

public 
Skins_Menu(id) {  
    new 
menu menu_create("Select Your Skin""skin_menu")
    if(
cs_get_user_team(id) & CS_TEAM_CT) {
        
menu_additemmenu"Ct1""1"ADMIN_LEVEL_H );  
        
menu_additemmenu"Ct2""2"ADMIN_LEVEL_H );
    }
    else if(
cs_get_user_team(id) & CS_TEAM_T) {
        
menu_additemmenu"Terro 1""3"ADMIN_LEVEL_H );  
        
menu_additemmenu"Teroo 2""4"ADMIN_LEVEL_H );
    }
    
    
menu_setpropmenuMPROP_EXITMEXIT_ALL );   
    
menu_displayidmenu);  
}  

public 
skin_menu(idmenuitem) { 
    if (
item == MENU_EXIT) { 
        
menu_destroy(menu
        return 
PLUGIN_HANDLED
    } 
    
    new 
data[6], szName[64];
    new 
accesscallback;
    
menu_item_getinfo(menuitemaccessdata,charsmax(data), szName,charsmax(szName), callback);
    new 
key str_to_num(data);
    
    if(!
is_user_alive(id))
        return 
PLUGIN_HANDLED
    
    
switch(key) {
        case 
1: { 
            
cs_set_user_model(id"CT_1");
            
has_CT_1[id] = true;
        } 
        case 
2: { 
            
cs_set_user_model(id"CT_2");
            
has_CT_2[id] = true;
        } 
        case 
3: { 
            
cs_set_user_model(id"TT_1"); 
            
has_TT_1[id] = true;
        } 
        case 
4: { 
            
cs_set_user_model(id"TT_2");
            
has_TT_2[id] = true;
        }
    } 
    return 
PLUGIN_CONTINUE




iwant this for all players not only for vip ?
ALonsoVIP4141 is offline
Send a message via ICQ to ALonsoVIP4141 Send a message via AIM to ALonsoVIP4141 Send a message via Yahoo to ALonsoVIP4141 Send a message via Skype™ to ALonsoVIP4141
MacL
Member
Join Date: May 2021
Old 06-28-2021 , 13:26   Re: Help With vip model menu
Reply With Quote #27

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

#define PLUGIN "Vip Skins Menu" 
#define VERSION "1.0" 
#define AUTHOR "Alicx" 

new has_CT_1[33], has_CT_2[33], has_TT_1[33], has_TT_2[33];

public 
plugin_precache() 

    
precache_model("models/player/CT_1/CT_1.mdl"); 
    
precache_model("models/player/CT_2/CT_2.mdl"); 
    
precache_model("models/player/TT_1/TT_1.mdl"); 
    
precache_model("models/player/TT_2/TT_2.mdl"); 


public 
plugin_init() { 
    
register_plugin(PLUGINVERSIONAUTHOR
    
    
register_event("HLTV""event_new_round""a""1=0""2=0")
    
    
register_clcmd"say /myskin",  "Skins_Menu" ); 
}

public 
event_new_round(id) {
    if(
has_CT_1[id]) {
        
cs_set_user_model(id"CT_1");
    }
    else if(
has_CT_2[id]) {
        
cs_set_user_model(id"CT_2");
    }
    else if(
has_TT_1[id]) {
        
cs_set_user_model(id"TT_1");
    }
    else if(
has_TT_2[id]) {
        
cs_set_user_model(id"TT_2");
    }
}

public 
Skins_Menu(id) {  
    new 
menu menu_create("Select Your Skin""skin_menu")
    if(
cs_get_user_team(id) & CS_TEAM_CT) {
        
menu_additemmenu"Ct1""1"0);  
        
menu_additemmenu"Ct2""2");
    }
    else if(
cs_get_user_team(id) & CS_TEAM_T) {
        
menu_additemmenu"Terro 1""3");  
        
menu_additemmenu"Teroo 2""4");
    }
    
    
menu_setpropmenuMPROP_EXITMEXIT_ALL );   
    
menu_displayidmenu);  
}  

public 
skin_menu(idmenuitem) { 
    if (
item == MENU_EXIT) { 
        
menu_destroy(menu
        return 
PLUGIN_HANDLED
    } 
    
    new 
data[6], szName[64];
    new 
accesscallback;
    
menu_item_getinfo(menuitemaccessdata,charsmax(data), szName,charsmax(szName), callback);
    new 
key str_to_num(data);
    
    if(!
is_user_alive(id))
        return 
PLUGIN_HANDLED
    
    
switch(key) {
        case 
1: { 
            
cs_set_user_model(id"CT_1");
            
has_CT_1[id] = true;
        } 
        case 
2: { 
            
cs_set_user_model(id"CT_2");
            
has_CT_2[id] = true;
        } 
        case 
3: { 
            
cs_set_user_model(id"TT_1"); 
            
has_TT_1[id] = true;
        } 
        case 
4: { 
            
cs_set_user_model(id"TT_2");
            
has_TT_2[id] = true;
        }
    } 
    return 
PLUGIN_CONTINUE

MacL is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 06-29-2021 , 12:22   Re: Help With vip model menu
Reply With Quote #28

Remade it:

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

#define PLUGIN "Player Model Menu" 
#define VERSION "1.0" 
#define AUTHOR "Supremache" 

#if !defined client_disconnected
    #define client_disconnected client_disconnect
#endif

enum _:eModelsInfo {
    
Flag,
    
CTModel[32],
    
TModel[32]
};

new const 
eModels[][ eModelsInfo ] = {
/*    <Access Flags>, <CT Model>, <T Model>    */
    
ADMIN_ALL"CT_1""TT_1"},
    { 
ADMIN_ALL"CT_2""TT_2"}
}

new 
g_iModel[33]

public 
plugin_init()

    
register_plugin(PLUGINVERSIONAUTHOR
    
register_clcmd"say /model""@OnCustomMenu" ); 
}

public 
client_disconnect(id)
{
    
g_iModel[id] = 0;
}

public 
plugin_precache() 
{
    for(new 
isizeofeModels ); i++) 
    {
        
PrecacheModel(eModels[i][TModel])
        
PrecacheModel(eModels[i][CTModel])
    }
}

PrecacheModel(szModel[])
{
    static 
szBuffer[128]
    
formatex(szBuffercharsmax(szBuffer), "models/player/%s/%s.mdl"szModelszModel);
    
precache_model(szBuffer);
}

@
OnCustomMenu(id)
{
    if(!
is_user_alive(id))
    {
        
client_print(idprint_chat"This is only available to alives.")
        return 
PLUGIN_HANDLED
    
}
    
    new 
iMainMenu menu_create("Select Your Skin:""@MenuHandler")
        
    for(new 
isizeofeModels ); i++) 
    {
        new 
szData[128], iFlags get_user_flags(id);
        switch(
get_user_team(id))
        {
            case 
1formatex(szDatacharsmax(szData), "%s%s"iFlags eModels[i][Flag] ? "\w" "\d"eModels[i][TModel])
            case 
2formatex(szDatacharsmax(szData), "%s%s"iFlags eModels[i][Flag] ? "\w" "\d"eModels[i][CTModel])
        }
        
menu_additem(iMainMenuszData"")
    }
    
    
menu_setprop(iMainMenuMPROP_BACKNAME"Previous page")
    
menu_setprop(iMainMenuMPROP_NEXTNAME"Next page")
    
menu_setprop(iMainMenuMPROP_EXITNAME"\rClose")
        
    
menu_setprop(iMainMenuMPROP_EXITMEXIT_ALL)
    
menu_display(idiMainMenu)
    return 
PLUGIN_HANDLED
}

@
MenuHandler(idiMenuiItem)
{
    if(
iItem != MENU_EXIT
    {
        new 
iAccessiCallBackszDate[11], iFlags get_user_flags(id);
        
menu_item_getinfo(iMenuiItemiAccessszDatecharsmax(szDate), __iCallBack);
        
        if( 
iFlags eModels[iItem][Flag] ) 
        {
            switch(
get_user_team(id))
            {
                case 
1:
                {
                    
cs_set_user_modelideModels[iItem][TModel]);
                    
client_print(idprint_chat"You received the model %s."eModels[iItem][TModel])
                }
                case 
2:
                {
                    
cs_set_user_modelideModels[iItem][CTModel]);
                    
client_print(idprint_chat"You received the model %s."eModels[iItem][CTModel])
                }
            }
            
g_iModel[id] = iItem;
        }
        else 
client_print(idprint_chat"You dont have access to select this model.")
        
    }
                
    
menu_destroy(iMenu)
    return 
PLUGIN_HANDLED

__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.
Supremache is offline
Gooday
Junior Member
Join Date: Jan 2024
Old 02-06-2024 , 06:30   Re: Help With vip model menu
Reply With Quote #29

Quote:
Originally Posted by Supremache View Post
Remade it:

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

#define PLUGIN "Player Model Menu" 
#define VERSION "1.0" 
#define AUTHOR "Supremache" 

#if !defined client_disconnected
    #define client_disconnected client_disconnect
#endif

enum _:eModelsInfo {
    
Flag,
    
CTModel[32],
    
TModel[32]
};

new const 
eModels[][ eModelsInfo ] = {
/*    <Access Flags>, <CT Model>, <T Model>    */
    
ADMIN_ALL"CT_1""TT_1"},
    { 
ADMIN_ALL"CT_2""TT_2"}
}

new 
g_iModel[33]

public 
plugin_init()

    
register_plugin(PLUGINVERSIONAUTHOR
    
register_clcmd"say /model""@OnCustomMenu" ); 
}

public 
client_disconnect(id)
{
    
g_iModel[id] = 0;
}

public 
plugin_precache() 
{
    for(new 
isizeofeModels ); i++) 
    {
        
PrecacheModel(eModels[i][TModel])
        
PrecacheModel(eModels[i][CTModel])
    }
}

PrecacheModel(szModel[])
{
    static 
szBuffer[128]
    
formatex(szBuffercharsmax(szBuffer), "models/player/%s/%s.mdl"szModelszModel);
    
precache_model(szBuffer);
}

@
OnCustomMenu(id)
{
    if(!
is_user_alive(id))
    {
        
client_print(idprint_chat"This is only available to alives.")
        return 
PLUGIN_HANDLED
    
}
    
    new 
iMainMenu menu_create("Select Your Skin:""@MenuHandler")
        
    for(new 
isizeofeModels ); i++) 
    {
        new 
szData[128], iFlags get_user_flags(id);
        switch(
get_user_team(id))
        {
            case 
1formatex(szDatacharsmax(szData), "%s%s"iFlags eModels[i][Flag] ? "\w" "\d"eModels[i][TModel])
            case 
2formatex(szDatacharsmax(szData), "%s%s"iFlags eModels[i][Flag] ? "\w" "\d"eModels[i][CTModel])
        }
        
menu_additem(iMainMenuszData"")
    }
    
    
menu_setprop(iMainMenuMPROP_BACKNAME"Previous page")
    
menu_setprop(iMainMenuMPROP_NEXTNAME"Next page")
    
menu_setprop(iMainMenuMPROP_EXITNAME"\rClose")
        
    
menu_setprop(iMainMenuMPROP_EXITMEXIT_ALL)
    
menu_display(idiMainMenu)
    return 
PLUGIN_HANDLED
}

@
MenuHandler(idiMenuiItem)
{
    if(
iItem != MENU_EXIT
    {
        new 
iAccessiCallBackszDate[11], iFlags get_user_flags(id);
        
menu_item_getinfo(iMenuiItemiAccessszDatecharsmax(szDate), __iCallBack);
        
        if( 
iFlags eModels[iItem][Flag] ) 
        {
            switch(
get_user_team(id))
            {
                case 
1:
                {
                    
cs_set_user_modelideModels[iItem][TModel]);
                    
client_print(idprint_chat"You received the model %s."eModels[iItem][TModel])
                }
                case 
2:
                {
                    
cs_set_user_modelideModels[iItem][CTModel]);
                    
client_print(idprint_chat"You received the model %s."eModels[iItem][CTModel])
                }
            }
            
g_iModel[id] = iItem;
        }
        else 
client_print(idprint_chat"You dont have access to select this model.")
        
    }
                
    
menu_destroy(iMenu)
    return 
PLUGIN_HANDLED

It works great. But unfortunately on my DM server, after death the model become default
Gooday is offline
Tote
Senior Member
Join Date: Jul 2023
Old 02-06-2024 , 06:39   Re: Help With vip model menu
Reply With Quote #30

Yes, because you need to put Ham_Spawn function and to make some checks if player had model or not.

e.g:
new had_model[33];

if(had_model[id] == 1) | 1 means the model number 1
{
cs_set_user_model(id, "themodel")
}
else if(had_model[id] == x) | X = Number
{
cs_set-user_model(id, "X") | X = model Name
}

EDIT: You will also have to make A team check to avoid wrong models for wrong teams

Last edited by Tote; 02-06-2024 at 06:45.
Tote 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 21:22.


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