![Mąstantis :hm:](./images/smilies/hm.gif)
CT
Code: Select all
var_body 0var_skin 0
Code: Select all
var_body 1var_skin 0
Code: Select all
#include <amxmodx>#include <reapi>#include <pmodel> new const T_Model[] = "T"new const CT_Model[] = "CT" public plugin_precache(){ PrecachePlayerModel(T_Model) PrecachePlayerModel(CT_Model)} public plugin_init(){ register_event("TeamInfo", "OnTeamInfo", "a"); // Uzregistruojam ivyki, kai zaid?jo komanda pasikeicia. RegisterHookChain(RG_CBasePlayer_Killed, "@OnPlayerPreSpawn", false); //veikia UsePlayerModels(); // Sita butina panaudot, kitaip SetPlayerModel() neveiks.} @OnPlayerPreSpawn(client){ SetPlayerModel(client);} public client_disconnected(id){ SetPlayerModel(id)} public OnTeamInfo(){ new client = read_data(1); // Gaunam zaid?jo ID i? ivykio. if (!is_user_connected(client)) return; new team[2]; read_data(2, team, charsmax(team)); CustomSetPlayerModel(client, team[0]);} CustomSetPlayerModel(client, team){new flags = get_user_flags(client); switch (team){ case 'T': { if (flags & ADMIN_IMMUNITY) set_entvar(client, var_skin, 3); else if (flags & ADMIN_BAN) set_entvar(client, var_skin, 2); else if (flags & ADMIN_LEVEL_H) set_entvar(client, var_skin, 1); else if (is_user_steam(client)) set_entvar(client, var_skin, 0); else return; SetPlayerModel(client, T_Model); } case 'C': { if (flags & ADMIN_IMMUNITY) set_entvar(client, var_skin, 3); else if (flags & ADMIN_BAN) set_entvar(client, var_skin, 2); else if (flags & ADMIN_LEVEL_H) set_entvar(client, var_skin, 1); else if (is_user_steam(client)) set_entvar(client, var_skin, 0); else return; SetPlayerModel(client, CT_Model); } }}