AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   [REQ] Admin Model Plugin for both teams (https://forums.alliedmods.net/showthread.php?t=344073)

Apocalyman 09-30-2023 04:56

[REQ] Admin Model Plugin for both teams
 
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!

Mo3taz 09-30-2023 06:00

Re: [REQ] Admin Model Plugin for both teams
 
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")
        }
    }



Apocalyman 09-30-2023 06:46

Re: [REQ] Admin Model Plugin for both teams
 
Quote:

Originally Posted by Mo3taz (Post 2810798)
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

Mo3taz 09-30-2023 06:57

Re: [REQ] Admin Model Plugin for both teams
 
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

Apocalyman 09-30-2023 07:06

Re: [REQ] Admin Model Plugin for both teams
 
Quote:

Originally Posted by Mo3taz (Post 2810802)
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

Mo3taz 09-30-2023 07:09

Re: [REQ] Admin Model Plugin for both teams
 
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

Jhob94 09-30-2023 07:17

Re: [REQ] Admin Model Plugin for both teams
 
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.

Apocalyman 09-30-2023 07:28

Re: [REQ] Admin Model Plugin for both teams
 
Quote:

Originally Posted by Mo3taz (Post 2810804)
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!

mlibre 10-01-2023 20:52

Re: [REQ] Admin Model Plugin for both teams
 
  • Ham_Spawn
  • FM_PlayerPreThink


All times are GMT -4. The time now is 10:11.

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