Raised This Month: $149 Target: $400
 37% 

vip/admin models


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
baly222
Junior Member
Join Date: Jun 2020
Old 06-03-2020 , 06:26   vip/admin models
Reply With Quote #1

hi, can someone help me with this plugin ? its admin or vip models but I don't want it allowed to be used in both teams .

for example:
Te: Asasin , Iron , Joker, dobby
CT: Death , sonic, Skeleton



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


#define PLUGIN "Admin Model Menu"
#define VERSION "1.0"
#define AUTHOR "Dimision"
#define ADMIN_LEVEL_Q    ADMIN_LEVEL_C

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

public 
plugin_precache() 
{
        
precache_model("models/player/Asasin/Asasin.mdl")
        
precache_model("models/player/Death/Death.mdl")
        
precache_model("models/player/Dobby/Dobby.mdl")
        
precache_model("models/player/Sonic/Sonic.mdl")
        
precache_model("models/player/Skeleton/Skeleton.mdl")
        
precache_model("models/player/Joker/Joker.mdl")
        
precache_model("models/player/Iron/Iron.mdl")
}
        
public 
admin(id)
{
    if (
get_user_flags(id) & ADMIN_LEVEL_H)
        {
            
model_menu(id)
        }
        else
        {
               
ChatColor(id"!g>> !nAceste modele sunt doar pentru !gAdmini !n!")
        }
    
}
public 
model_menu(id)
{
    new 
menu menu_create("\r[\wAdmin Models\r]\r""menu_wybierz")
    
    
menu_additem(menu"\wAsasin""1"0)
    
menu_additem(menu"\wDeath""2"0)
    
menu_additem(menu"\wDobby""3"0)
    
menu_additem(menu"\wSonic""4"0)
    
menu_additem(menu"\wSkeleton""5"0)
    
menu_additem(menu"\wJoker""6"0)
    
menu_additem(menu"\wIron""7"0)

    
    
menu_setprop(menuMPROP_EXITMEXIT_ALL)
    
    
menu_display(idmenu0)
}

public 
menu_wybierz(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"Asasin")
       case 
cs_set_user_model(id"Death")
       case 
cs_set_user_model(id"Dobby")
       case 
cs_set_user_model(id"Sonic")
       case 
cs_set_user_model(id"Skeleton")
       case 
cs_set_user_model(id"Joker")
       case 
cs_set_user_model(id"Iron")
    }
    
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"); // verde
    
replace_all(msg190"!n""^1"); // galben/alb/negru
    
replace_all(msg190"!t""^3"); // rosu/albastru/gri
    
replace_all(msg190"!t2""^0"); // rosu2/albastru2/gri2
    
    
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();
            }
        }
    }


Last edited by baly222; 06-03-2020 at 06:36.
baly222 is offline
supertrio17
Senior Member
Join Date: May 2020
Location: Serbia
Old 06-03-2020 , 14:52   Re: vip/admin models
Reply With Quote #2

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


#define PLUGIN "Admin Model Menu"
#define VERSION "1.1"
#define AUTHOR "Mr. Boopsy"
#define ADMIN_LEVEL_Q    ADMIN_LEVEL_C

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

public 
plugin_precache() 
{
        
precache_model("models/player/Asasin/Asasin.mdl")
        
precache_model("models/player/Death/Death.mdl")
        
precache_model("models/player/Dobby/Dobby.mdl")
        
precache_model("models/player/Sonic/Sonic.mdl")
        
precache_model("models/player/Skeleton/Skeleton.mdl")
        
precache_model("models/player/Joker/Joker.mdl")
        
precache_model("models/player/Iron/Iron.mdl")
}
        
public 
admin(id)
{
    new 
CsTeams:Team cs_get_user_team(id);

    if (
Team == CS_TEAM_CT)
        {
            if (
get_user_flags(id) & ADMIN_LEVEL_H)
            {
                
model_menu_ct(id);
            }
            else
            {
                
ChatColor(id"!n>> !gYou don't have required flag!");
            }
        }
        else if (
Team == CS_TEAM_T)
        {
            if (
get_user_flags(id) & ADMIN_LEVEL_H)
            {
                
model_menu_tt(id);
            }
            else
            {
                
ChatColor(id"!n>> !gYou don't have required flag!");
            }
        }
        else if (
get_user_flags(id) & ADMIN_LEVEL_H)
        {
            if (!(
Team == CS_TEAM_CT) || !(Team == CS_TEAM_CT))
            {
                
ChatColor(id"!n>> !gYou have to be in valid team to use this command!");
            }
        }
}

public 
model_menu_ct(id)
{
    new 
menu_ct menu_create("\r[\wAdmin Models\r]\r""menu_ct_f")
    
    
menu_additem(menu_ct"\wDeath""1"0)
    
menu_additem(menu_ct"\wSonic""2"0)
    
menu_additem(menu_ct"\wSkeleton""3"0)

    
    
menu_setprop(menu_ctMPROP_EXITMEXIT_ALL)
    
    
menu_display(idmenu_ct0)
}

public 
model_menu_tt(id)
{
    new 
menu_tt menu_create("\r[\wAdmin Models\r]\r""menu_tt_f")
    
    
menu_additem(menu_tt"\wAsasin""1"0)
    
menu_additem(menu_tt"\wDobby""2"0)
    
menu_additem(menu_tt"\wJoker""3"0)
    
menu_additem(menu_tt"\wIron""4"0)

    
    
menu_setprop(menu_ttMPROP_EXITMEXIT_ALL)
    
    
menu_display(idmenu_tt0)
}

public 
menu_ct_f(idmenu_ctitem)
{
    if (
item == MENU_EXIT)
    {
        
menu_destroy(menu_ct)
        return 
PLUGIN_HANDLED
    
}
    new 
data[6], iName[64]
    new 
accescallback
    menu_item_getinfo
(menu_ctitemaccesdata,5iName63callback)
    
    new 
key str_to_num(data)
    
    switch(
key)
    { 
       case 
cs_set_user_model(id"Death")
       case 
cs_set_user_model(id"Sonic")
       case 
cs_set_user_model(id"Skeleton")
    }
    
menu_destroy(menu_ct)
    return 
PLUGIN_HANDLED
}  

public 
menu_tt_f(idmenu_ttitem_tt)
{
    if (
item_tt == MENU_EXIT)
    {
        
menu_destroy(menu_tt)
        return 
PLUGIN_HANDLED
    
}
    new 
data_tt[6], iName_tt[64]
    new 
acces_ttcallback_tt
    menu_item_getinfo
(menu_ttitem_ttacces_ttdata_tt,5iName_tt63callback_tt)
    
    new 
key_tt str_to_num(data_tt)
    
    switch(
key_tt)
    { 
       case 
cs_set_user_model(id"Asasin")
       case 
cs_set_user_model(id"Dobby")
       case 
cs_set_user_model(id"Joker")
       case 
cs_set_user_model(id"Iron")
    }
    
menu_destroy(menu_tt)
    return 
PLUGIN_HANDLED


stock ChatColor(const id, const input[], any:...) {
    new 
count 1players[32];
    static 
msg[191];
    
vformat(msg190input3);
    
    
replace_all(msg190"!g""^4"); // verde
    
replace_all(msg190"!n""^1"); // galben/alb/negru
    
replace_all(msg190"!t""^3"); // rosu/albastru/gri
    
replace_all(msg190"!t2""^0"); // rosu2/albastru2/gri2
    
    
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();
            }
        }
    }

I changed a few things in code. I added error message when people in SPEC try to use it, and translated error messages for people without "t" admin flag.

I found one error, that I have no time to fix, maybe tommorow when if I find some free time.

The error occurs when you change teams, so if admin already has for example Sonic model, and changes team to TT, he will have that model when spawned. You can compile that code or download .sma from here.

Edit:

Tested and working!
Attached Files
File Type: sma Get Plugin or Get Source (adminmodel.sma - 30 views - 4.3 KB)

Last edited by supertrio17; 06-03-2020 at 15:17. Reason: Tested!
supertrio17 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 06-03-2020 , 15:11   Re: vip/admin models
Reply With Quote #3

Check this - https://forums.alliedmods.net/showpo...77&postcount=6

It doesn't require you to make 10 changes just to edit a single model.
__________________

Last edited by OciXCrom; 06-03-2020 at 15:11.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
supertrio17
Senior Member
Join Date: May 2020
Location: Serbia
Old 06-03-2020 , 15:16   Re: vip/admin models
Reply With Quote #4

I started Pawning like 7 days ago, so sorry if my code is unusual or something
supertrio17 is offline
baly222
Junior Member
Join Date: Jun 2020
Old 06-04-2020 , 07:49   Re: vip/admin models
Reply With Quote #5

Quote:
Originally Posted by supertrio17 View Post
I started Pawning like 7 days ago, so sorry if my code is unusual or something
It Working bud need help with team changing, because I useing hns mod on server..when ct wins teams will change, and they still have skin from last round , and why can see only steam players ?
baly222 is offline
baly222
Junior Member
Join Date: Jun 2020
Old 06-04-2020 , 08:41   Re: vip/admin models
Reply With Quote #6

Quote:
Originally Posted by OciXCrom View Post
Check this - https://forums.alliedmods.net/showpo...77&postcount=6

It doesn't require you to make 10 changes just to edit a single model.
sorry I dont understand the code. where I can edit weys for models ?
baly222 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 06-04-2020 , 09:08   Re: vip/admin models
Reply With Quote #7

The paths to the models are always the same. Just change the model names in the beginning of the code and set their team.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
supertrio17
Senior Member
Join Date: May 2020
Location: Serbia
Old 06-04-2020 , 12:21   Re: vip/admin models
Reply With Quote #8

Yeah, I could add check for teams, but I can't do it right now, sorry but you will need to wait a bit
supertrio17 is offline
supertrio17
Senior Member
Join Date: May 2020
Location: Serbia
Old 06-05-2020 , 04:54   Re: vip/admin models
Reply With Quote #9

Quote:
why can see only steam players ?
Can you explain this one to me, I don't quite understand
supertrio17 is offline
mahbodsr
Member
Join Date: Jun 2016
Old 06-05-2020 , 10:12   Re: vip/admin models
Reply With Quote #10

Quote:
Originally Posted by baly222 View Post
It Working bud need help with team changing, because I useing hns mod on server..when ct wins teams will change, and they still have skin from last round , and why can see only steam players ?
Explain more ,
What Skins Do You want to set when Ct/T wins?

Last edited by mahbodsr; 06-05-2020 at 10:13.
mahbodsr is offline
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 23:19.


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