 |
|
Member
|

09-30-2023
, 06:46
Re: [REQ] Admin Model Plugin for both teams
|
#3
|
Quote:
Originally Posted by Mo3taz
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(PLUGIN, VERSION, AUTHOR)
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 1: cs_set_user_model(id, "your_model_t")
case 2: cs_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(PLUGIN, VERSION, AUTHOR)
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 1: cs_set_user_model(id, "your_model_t")
case 2: cs_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
|
|
|
|