Raised This Month: $ Target: $400
 0% 

Admin skin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
yRestrict
BANNED
Join Date: Apr 2019
Old 12-23-2019 , 12:33   Admin skin
Reply With Quote #1

A friend made this plugin, but we are having some problems, there are some bugs still
like a check for when the player changes teams doesn't have the same skin as before
because this will be put into a flag capture mode and sometimes it happens that the team changes

this is code someone knows how to do
If someone has some suggestions will also be welcome

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

#define PLUGIN "admin model"
#define VERSION "1.0"
#define AUTHOR "LKING01"

#define ADMIN_LEVEL_Q ADMIN_LEVEL_C

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say /model""admin")
}

public 
plugin_precache() 
{
    
precache_model("models/player/new/TR_01/TR_01.mdl")
    
precache_model("models/player/new/CT_01/CT_01.mdl")
    
// precache_model("")
    // precache_model("")
    // precache_model("")
    // precache_model("")
    // precache_model("")
    // precache_model("")
}

public 
admin(id)
{
    if (
get_user_flags(id) & ADMIN_LEVEL_H)
        {
            
model_menu(id)
        }
        else
        {
               
ChatColor(id"!t[!gFlag HunTer's!t] Somente para admin!")
        }
}

public 
model_menu(id)
{
    if ( !
is_user_connectedid ) )
    {
        return;
    }

    new 
menu menu_create("\r[\wMENU DE PLAYER MODELS\r]\r""player_models")

    switch ( 
get_user_teamid ) )
    {
        case 
1:
        {
            
menu_additem(menu"\wPLAYER MODEL [ADMIN]-[TR]""1"0)
            
menu_additem(menu"\wPLAYER MODEL [ADMIN]-[TR]""2"0)
            
menu_additem(menu"\wPLAYER MODEL [ADMIN]-[TR]""3"0)
            
menu_additem(menu"\wPLAYER MODEL [ADMIN]-[TR]""4"0)
        }
        case 
2:
        {
            
menu_additem(menu"\wPLAYER MODEL [ADMIN]-[CT]""5"0)
            
menu_additem(menu"\wPLAYER MODEL [ADMIN]-[CT]""6"0)
            
menu_additem(menu"\wPLAYER MODEL [ADMIN]-[CT]""7"0)
            
menu_additem(menu"\wPLAYER MODEL [ADMIN]-[CT]""8"0)
        }
        default:
        {
            
menu_destroymenu );
            return;
        }
    }
    
    
menu_setprop(menuMPROP_EXITNAME"Sair")
    
menu_display(idmenu0);
}

public 
player_models(idmenuitem)
{
    if (
item == MENU_EXIT)
    {
        
menu_destroy(menu)
        return 
PLUGIN_HANDLED
    
}
    
    new 
data[6], iName[64]
    new 
accescallback
    menu_item_getinfo
(menuitemaccesdata,5iName63callback)
    
    new 
key str_to_num(data)
    
    switch(
key)
    { 
       case 
cs_set_user_model(id"TR_01")
       case 
cs_set_user_model(id"")
       case 
cs_set_user_model(id"")
       case 
cs_set_user_model(id"")
       case 
cs_set_user_model(id"CT_01")
       case 
cs_set_user_model(id"")
       case 
cs_set_user_model(id"")
       case 
cs_set_user_model(id"")
    }
    
menu_destroy(menu)
    return 
PLUGIN_HANDLED
}

stock ChatColor(const id, const input[], any:...) {
    new 
count 1players[32];
    static 
msg[191];
    
vformat(msg190input3);
    
    
replace_all(msg190"!g""^4");
    
replace_all(msg190"!n""^1");
    
replace_all(msg190"!t""^3");
    
replace_all(msg190"!t2""^0");
    
    if (
idplayers[0] = id; else get_players(playerscount"ch");
    {
        for (new 
0counti++)
            {
            if (
is_user_connected(players[i]))
                {
                
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _players[i]);
                
write_byte(players[i]);
                
write_string(msg);
                
message_end();
            }
        }
    }

yRestrict is offline
alferd
Veteran Member
Join Date: Dec 2019
Location: Iran is Always Eternal
Old 12-24-2019 , 03:53   Re: Admin skin
Reply With Quote #2

Hi this is my plugin it works well too

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

new const CT_1[] = "CT_1";
new const 
CT_MODEL_1[] = "models/player/Admin_Skin/Ct/wesker/wesker.mdl";
new const 
CT_2[] = "CT_2";
new const 
CT_MODEL_2[] = "models/player/Admin_Skin/Ct/smith/smith.mdl";
new const 
CT_3[] = "CT_3";
new const 
CT_MODEL_3[] = "models/player/Admin_Skin/Ct/agent/agent.mdl";
new const 
CT_4[] = "CT_4";
new const 
CT_MODEL_4[] = "models/player/Admin_Skin/Ct/crysis_white/crysis_white.mdl";
new const 
TT_1[] = "TT_1";
new const 
TT_MODEL_1[] = "models/player/Admin_Skin/Trr/Crysis_Black/Crysis_Black.mdl";
new const 
TT_2[] = "TT_2";
new const 
TT_MODEL_2[] = "models/player/Admin_Skin/Trr/DEvil_Macy/DEvil_Macy.mdl";
new const 
TT_3[] = "TT_3";
new const 
TT_MODEL_3[] = "models/player/Admin_Skin/Trr/Ukranian/Ukranian.mdl";
new const 
TT_4[] = "TT_4";
new const 
TT_MODEL_4[] = "models/player/Admin_Skin/Trr/Nero/Nero.mdl";

new 
player_model[33][32];
new 
bool:g_model[33];

#define PLUGIN "Admin Skin Menu" 
#define VERSION "3.0" 
#define AUTHOR "AlferD" 

public plugin_precache() {
    
precache_model(TT_MODEL_1)
    
precache_model(TT_MODEL_2)
    
precache_model(TT_MODEL_3)
    
precache_model(TT_MODEL_4)
    
precache_model(CT_MODEL_1)
    
precache_model(CT_MODEL_2)
    
precache_model(CT_MODEL_3)
    
precache_model(CT_MODEL_4)
}

public 
plugin_init() { 
    
register_plugin(PLUGINVERSIONAUTHOR
    
    
register_forward(FM_SetClientKeyValue"fw_SetClientKeyValue")
    
register_forward(FM_ClientUserInfoChanged"fw_ClientUserInfoChanged")
    
    
register_clcmd"say /askin",  "Skins_Menu"ADMIN_CHAT ); 


public 
Skins_Menu(id) {  
    new 
menu menu_create("Select Your Skin""skin_menu")
    if(
cs_get_user_team(id) & CS_TEAM_CT) {
        
menu_additemmenu"Wesker""1"ADMIN_CHAT );  
        
menu_additemmenu"Smith""2"ADMIN_CHAT );
        
menu_additemmenu"Agent""3"ADMIN_CHAT );
        
menu_additemmenu"Crysis White""4"ADMIN_CHAT );
    }
    else if(
cs_get_user_team(id) & CS_TEAM_T) {
        
menu_additemmenu"Crysis Black""5"ADMIN_CHAT );  
        
menu_additemmenu"DEvil_Macy""6"ADMIN_CHAT );
        
menu_additemmenu"Ukranian""7"ADMIN_CHAT );
        
menu_additemmenu"Nero""8"ADMIN_CHAT );
    }
    
    
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: { 
            
Model_CT_1(id)
        } 
        case 
2: { 
            
Model_CT_2(id)
        } 
        case 
3: { 
            
Model_CT_3(id)
        } 
        case 
4: { 
            
Model_CT_4(id)
        } 
        case 
5: { 
            
Model_TT_1(id
        } 
        case 
6: { 
            
Model_TT_2(id)
        } 
        case 
7: { 
            
Model_TT_3(id
        } 
        case 
8: { 
            
Model_TT_4(id)
        }
    } 
    return 
PLUGIN_CONTINUE
}

public 
Model_CT_1(id) {
    
copy(player_model[id], 31CT_1)
            
    new 
currentmodel[32];
    
fm_get_user_model(idcurrentmodelsizeof currentmodel 1);
                
    if(!
equal(currentmodelplayer_model[id])) {
        
fm_set_user_model(idplayer_model[id])
    }
}

public 
Model_CT_2(id) {
    
copy(player_model[id], 31CT_2)
            
    new 
currentmodel[32];
    
fm_get_user_model(idcurrentmodelsizeof currentmodel 1);
                
    if(!
equal(currentmodelplayer_model[id])) {
        
fm_set_user_model(idplayer_model[id])
    }
}

public 
Model_CT_3(id) {
    
copy(player_model[id], 31CT_3)
            
    new 
currentmodel[32];
    
fm_get_user_model(idcurrentmodelsizeof currentmodel 1);
                
    if(!
equal(currentmodelplayer_model[id])) {
        
fm_set_user_model(idplayer_model[id])
    }
}

public 
Model_CT_4(id) {
    
copy(player_model[id], 31CT_4)
            
    new 
currentmodel[32];
    
fm_get_user_model(idcurrentmodelsizeof currentmodel 1);
                
    if(!
equal(currentmodelplayer_model[id])) {
        
fm_set_user_model(idplayer_model[id])
    }
}

public 
Model_TT_1(id) {
    
copy(player_model[id], 31TT_1)
            
    new 
currentmodel[32];
    
fm_get_user_model(idcurrentmodelsizeof currentmodel 1);
                
    if(!
equal(currentmodelplayer_model[id])) {
        
fm_set_user_model(idplayer_model[id])
    }
}

public 
Model_TT_2(id) {
    
copy(player_model[id], 31TT_2)
            
    new 
currentmodel[32];
    
fm_get_user_model(idcurrentmodelsizeof currentmodel 1);
                
    if(!
equal(currentmodelplayer_model[id])) {
        
fm_set_user_model(idplayer_model[id])
    }
}

public 
Model_TT_3(id) {
    
copy(player_model[id], 31TT_3)
            
    new 
currentmodel[32];
    
fm_get_user_model(idcurrentmodelsizeof currentmodel 1);
                
    if(!
equal(currentmodelplayer_model[id])) {
        
fm_set_user_model(idplayer_model[id])
    }
}

public 
Model_TT_4(id) {
    
copy(player_model[id], 31TT_4)
            
    new 
currentmodel[32];
    
fm_get_user_model(idcurrentmodelsizeof currentmodel 1);
                
    if(!
equal(currentmodelplayer_model[id])) {
        
fm_set_user_model(idplayer_model[id])
    }
}

public 
fw_SetClientKeyValue(idinfobufferkey[], value[]) {   
    if (
g_model[id] && equal(key"model"))
        return 
FMRES_SUPERCEDE
    
    
return FMRES_IGNORED
}

public 
fw_ClientUserInfoChanged(idinfobuffer) {   
    if (!
g_model[id])
        return 
FMRES_IGNORED
    
    
new currentmodel[32]; 
    
fm_get_user_model(idcurrentmodelsizeof currentmodel 1);
    
    if(!
equal(currentmodelplayer_model[id]))
        
fm_set_user_model(idplayer_model[id]) 
    
    return 
FMRES_IGNORED
}

stock fm_set_user_model(playermodelname[]) {   
    
engfunc(EngFunc_SetClientKeyValueplayerengfunc(EngFunc_GetInfoKeyBufferplayer), "model"modelname)
    
    
g_model[player] = true
}

stock fm_get_user_model(playermodel[], len) {   
    
engfunc(EngFunc_InfoKeyValueengfunc(EngFunc_GetInfoKeyBufferplayer), "model"modellen)
}

stock fm_reset_user_model(player) {         
    
g_model[player] = false
    
    dllfunc
(DLLFunc_ClientUserInfoChangedplayerengfunc(EngFunc_GetInfoKeyBufferplayer))

alferd is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-24-2019 , 09:19   Re: Admin skin
Reply With Quote #3

Those codes made me feel miserable.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
yRestrict
BANNED
Join Date: Apr 2019
Old 12-26-2019 , 16:29   Re: Admin skin
Reply With Quote #4

Quote:
Originally Posted by OciXCrom View Post
Those codes made me feel miserable.
If you want compatibility something better accepted with greater pleasure
yRestrict is offline
yRestrict
BANNED
Join Date: Apr 2019
Old 12-26-2019 , 17:28   Re: Admin skin
Reply With Quote #5

Quote:
Originally Posted by OciXCrom View Post
Those codes made me feel miserable.
If you want compatibility something better accepted with greater pleasure
yRestrict is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 12-27-2019 , 04:53   Re: Admin skin
Reply With Quote #6

Use this or see how I did it there.
__________________
edon1337 is offline
Send a message via Skype™ to edon1337
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 10:31.


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