Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- #include <cstrike>
- #include <fakemeta>
- #include <hamsandwich>
- new const ADMIN_MODEL_T[] = "red"
- new const ADMIN_MODEL_CT[] = "blue"
- public plugin_init() {
- register_plugin("ADMIN MODEL", "1.0", "Akc3n7");
- RegisterHam( Ham_Spawn, "player", "PlayerPostSpawn",1);
- }
- public plugin_precache() {
- new ModelOrSoundPath[128]
- formatex(ModelOrSoundPath, sizeof (ModelOrSoundPath) -1, "models/player/%s/%s.mdl", ADMIN_MODEL_T, ADMIN_MODEL_T)
- engfunc(EngFunc_PrecacheModel, ModelOrSoundPath)
- formatex(ModelOrSoundPath, sizeof (ModelOrSoundPath) -1, "models/player/%s/%s.mdl", ADMIN_MODEL_CT, ADMIN_MODEL_CT)
- engfunc(EngFunc_PrecacheModel, ModelOrSoundPath)
- }
- public PlayerPostSpawn(id) {
- if(!is_user_alive(id) || !is_user_steam(id) || get_user_flags(id) & ADMIN_USER)
- return;
- task_set_player_model(id);
- }
- public player_model_t(id) {
- if(cs_get_user_team(id) == CS_TEAM_T)
- {
- cs_set_user_model(id, ADMIN_MODEL_T);
- }
- }
- public player_model_ct(id) {
- if(cs_get_user_team(id) == CS_TEAM_CT)
- {
- cs_set_user_model(id, ADMIN_MODEL_CT);
- }
- }
- public task_set_player_model(id) {
- set_task(1.0, "player_model_t", id, _, _,"b")
- set_task(1.5, "player_model_ct", id, _, _,"b")
- }
- stock bool:is_user_steam(id)
- {
- new auth[65]
- get_user_authid(id,auth,64)
- if(contain(auth, "STEAM_0:0:") != -1 || contain(auth, "STEAM_0:1:") != -1)
- return true;
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement