Raised This Month: $51 Target: $400
 12% 

[REQ] Admin Model Plugin for both teams


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Apocalyman
Member
Join Date: Nov 2022
Old 09-30-2023 , 04:56   [REQ] Admin Model Plugin for both teams
Reply With Quote #1

Hello. I would like to know if its possible to have a plugin then gives users with admin_kick a player model for each team (one model for CT and one model for T team, so 2 different models)

I tried looking and checking plugins that do this or anything else similar and I did find some but the model isnt loaded and a round restart happens and it works after it and after another RR it reverts back + after every server restart too. I dont know if its the plugin or the server but I assume the plugin since it might have been written badly? I assume. Please let me know if its possible to have a plugin like this that will be on at all times for the admin_kick users without having to do round restart or anything like that. Thanks!
Apocalyman is offline
Mo3taz
Member
Join Date: Apr 2022
Location: Algeria
Old 09-30-2023 , 06:00   Re: [REQ] Admin Model Plugin for both teams
Reply With Quote #2

this will give the player with acc "admin_kick" a model (for ct and another one for t) when he spawn
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <hamsandwich>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "bugg3r"

#define ADMIN_LEVEL ADMIN_KICK

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
RegisterHam(Ham_Spawn"player""Ham_PlayerSpawn"true)
}

public 
plugin_precache() 

    
precache_model("models/player/your_model_t/your_model_t.mdl")//T Model
    
precache_model("models/player/your_model_ct/your_model_ct.mdl")//CT Model


public 
Ham_PlayerSpawn(id)
{
    if(
get_user_flags(id) & ADMIN_LEVEL)
    {
        switch(
get_user_team(id))
        {
            case 
1cs_set_user_model(id"your_model_t")
            case 
2cs_set_user_model(id"your_model_ct")
        }
    }

and this will give the player (with acc admin_kick) a model (1 for ct and another 1 for t) at all time [i suggest you to avoid using playerprethink in too many plugins ]
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fakemeta>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "bugg3r"

#define ADMIN_LEVEL ADMIN_KICK

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_forward(FM_PlayerPreThink"PlayerPreThink"0)
}

public 
plugin_precache() 

    
precache_model("models/player/your_model_t/your_model_t.mdl")//T Model
    
precache_model("models/player/your_model_ct/your_model_ct.mdl")//CT Model


public 
PlayerPreThink(id)
{
    if(
get_user_flags(id) & ADMIN_LEVEL)
    {
        switch(
get_user_team(id))
        {
            case 
1cs_set_user_model(id"your_model_t")
            case 
2cs_set_user_model(id"your_model_ct")
        }
    }

__________________
Save Money (nvault)
DISCORD: Mo3taz#8978
Mz

Last edited by Mo3taz; 09-30-2023 at 06:07.
Mo3taz is offline
Send a message via Yahoo to Mo3taz
Apocalyman
Member
Join Date: Nov 2022
Old 09-30-2023 , 06:46   Re: [REQ] Admin Model Plugin for both teams
Reply With Quote #3

Quote:
Originally Posted by Mo3taz View Post
this will give the player with acc "admin_kick" a model (for ct and another one for t) when he spawn
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <hamsandwich>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "bugg3r"

#define ADMIN_LEVEL ADMIN_KICK

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
RegisterHam(Ham_Spawn"player""Ham_PlayerSpawn"true)
}

public 
plugin_precache() 

    
precache_model("models/player/your_model_t/your_model_t.mdl")//T Model
    
precache_model("models/player/your_model_ct/your_model_ct.mdl")//CT Model


public 
Ham_PlayerSpawn(id)
{
    if(
get_user_flags(id) & ADMIN_LEVEL)
    {
        switch(
get_user_team(id))
        {
            case 
1cs_set_user_model(id"your_model_t")
            case 
2cs_set_user_model(id"your_model_ct")
        }
    }

and this will give the player (with acc admin_kick) a model (1 for ct and another 1 for t) at all time [i suggest you to avoid using playerprethink in too many plugins ]
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fakemeta>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "bugg3r"

#define ADMIN_LEVEL ADMIN_KICK

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_forward(FM_PlayerPreThink"PlayerPreThink"0)
}

public 
plugin_precache() 

    
precache_model("models/player/your_model_t/your_model_t.mdl")//T Model
    
precache_model("models/player/your_model_ct/your_model_ct.mdl")//CT Model


public 
PlayerPreThink(id)
{
    if(
get_user_flags(id) & ADMIN_LEVEL)
    {
        switch(
get_user_team(id))
        {
            case 
1cs_set_user_model(id"your_model_t")
            case 
2cs_set_user_model(id"your_model_ct")
        }
    }

Hey! thanks for responding! I tried them both and they dont work for some reason... I dont know why
Apocalyman is offline
Mo3taz
Member
Join Date: Apr 2022
Location: Algeria
Old 09-30-2023 , 06:57   Re: [REQ] Admin Model Plugin for both teams
Reply With Quote #4

did u put your models ?
this two plugins are 100% right
if they didnt work, the problem from another plugin or you didnt test them correctly
__________________
Save Money (nvault)
DISCORD: Mo3taz#8978
Mz

Last edited by Mo3taz; 09-30-2023 at 06:59.
Mo3taz is offline
Send a message via Yahoo to Mo3taz
Apocalyman
Member
Join Date: Nov 2022
Old 09-30-2023 , 07:06   Re: [REQ] Admin Model Plugin for both teams
Reply With Quote #5

Quote:
Originally Posted by Mo3taz View Post
did u put your models ?
this two plugins are 100% right
if they didnt work, the problem from another plugin or you didnt test them correctly
I did test them again, however for some reason the model applies but whenever a round is restarted again it reverts back to normal
Apocalyman is offline
Mo3taz
Member
Join Date: Apr 2022
Location: Algeria
Old 09-30-2023 , 07:09   Re: [REQ] Admin Model Plugin for both teams
Reply With Quote #6

Try to use only the second plugin (of playerprethink)
And 100% there is another plugin changing the model of the player, check your plugins.ini
__________________
Save Money (nvault)
DISCORD: Mo3taz#8978
Mz
Mo3taz is offline
Send a message via Yahoo to Mo3taz
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 09-30-2023 , 07:17   Re: [REQ] Admin Model Plugin for both teams
Reply With Quote #7

Prethink is a very bad way. Also cs_set_user_model isn’t the best method.

Use this plugin: https://forums.alliedmods.net/showthread.php?t=106094
You’ll need to set models by steam id for the admins. I don’t think someone is willing to edit it since it’s pretty easy to set by steam id and it’s not worth the effort to edit the plugin.
__________________
Jhob94 is offline
Apocalyman
Member
Join Date: Nov 2022
Old 09-30-2023 , 07:28   Re: [REQ] Admin Model Plugin for both teams
Reply With Quote #8

Quote:
Originally Posted by Mo3taz View Post
Try to use only the second plugin (of playerprethink)
And 100% there is another plugin changing the model of the player, check your plugins.ini
Yes hello! I tested again and while you said the second one is bad to use but it does work! also I did check again by removing all my plugins (except the admin skin) and it did stay on even with the first one. I dont know how to fix it in the first one so I just used the second one but at least it works so im not gonna mess with anything else anymore since its working now. thanks!
Apocalyman is offline
mlibre
Veteran Member
Join Date: Nov 2015
Location: return PLUGIN_CONTINUE
Old 10-01-2023 , 20:52   Re: [REQ] Admin Model Plugin for both teams
Reply With Quote #9

  • Ham_Spawn
  • FM_PlayerPreThink
__________________
mlibre 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 19:27.


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