不用任何权限T和CT带不同帽子
本帖最后由 点通粉丝 于 2009-2-6 12:35 编辑/* AMX Mod X
* Admin Mark
*
* (c) Copyright 2007 by KaLoSZyFeR
*
* This file is provided as is (no warranties)
*
* DESCRIPTION
* Plugin marks admin by adding on his head special helmet or beret. Size of model
* is less than 60kb, so player don't have to extra download whole admin model (size: 2Mb)
* like in other plugins such as KaOs' "Admin Models".
*
* FEATURES
* - if admin is CT, he wears special helmet
* - if admin is T, he wears special beret
*
*
* CVARS
* amx_admin_mark (0: OFF, 1: ON, default: 1) - disables/enables plugin
*
* VERSIONS
* 1.0 first release
* 1.1 added forcing standard models, optimized some code
* 1.2 changed really smart part of code (1 word...)
*
*/
#include <amxmodx>
#include <cstrike>
#include <engine>
new g_adminmarkEnt
new cvar_enable
new MODEL_MARK[] = {"models/CT1.mdl","models/CT2.mdl"}
static const PLUGIN_NAME[] = "10wMaoZi"
static const PLUGIN_AUTHOR[] = "KaLoSZyFeR"
static const PLUGIN_VERSION[] = "1.2"
public plugin_init()
{
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)
register_cvar(PLUGIN_NAME, PLUGIN_VERSION, FCVAR_SPONLY|FCVAR_SERVER)
cvar_enable = register_cvar("amx_admin_mark", "1")
}
public plugin_precache()
{
precache_model(MODEL_MARK)
precache_model(MODEL_MARK)
force_unmodified(force_model_samebounds,{0,0,0},{0,0,0},"models/player/gign/gign.mdl")
force_unmodified(force_model_samebounds,{0,0,0},{0,0,0},"models/player/gsg9/gsg9.mdl")
force_unmodified(force_model_samebounds,{0,0,0},{0,0,0},"models/player/sas/sas.mdl")
force_unmodified(force_model_samebounds,{0,0,0},{0,0,0},"models/player/urban/urban.mdl")
force_unmodified(force_model_samebounds,{0,0,0},{0,0,0},"models/player/vip/vip.mdl")
force_unmodified(force_model_samebounds,{0,0,0},{0,0,0},"models/player/arctic/arctic.mdl")
force_unmodified(force_model_samebounds,{0,0,0},{0,0,0},"models/player/guerilla/guerilla.mdl")
force_unmodified(force_model_samebounds,{0,0,0},{0,0,0},"models/player/leet/leet.mdl")
force_unmodified(force_model_samebounds,{0,0,0},{0,0,0},"models/player/terror/terror.mdl")
}
public client_connect(id)
{
if(g_adminmarkEnt > 0)
remove_entity(g_adminmarkEnt)
g_adminmarkEnt = 0
}
public client_disconnect(id)
{
if(g_adminmarkEnt > 0)
remove_entity(g_adminmarkEnt)
g_adminmarkEnt = 0
}
public client_PreThink(id)
{
if(!is_user_connected(id))
return PLUGIN_CONTINUE
if(!is_user_alive(id) && g_adminmarkEnt > 0)
{
remove_entity(g_adminmarkEnt)
g_adminmarkEnt = 0
return PLUGIN_CONTINUE
}
/*
if (!(get_user_flags(id) & ADMIN_KICK))
{
remove_entity(g_adminmarkEnt)
g_adminmarkEnt = 0
return PLUGIN_CONTINUE
}
*/
if(!get_pcvar_num(cvar_enable))
return PLUGIN_CONTINUE
if(!is_user_alive(id))
return PLUGIN_CONTINUE
if(g_adminmarkEnt < 1)
{
g_adminmarkEnt = create_entity("info_target")
if(g_adminmarkEnt > 0)
{
entity_set_int(g_adminmarkEnt, EV_INT_movetype, MOVETYPE_FOLLOW)
entity_set_edict(g_adminmarkEnt, EV_ENT_aiment, id)
if (get_user_team(id) == 1) entity_set_model(g_adminmarkEnt, MODEL_MARK)
if (get_user_team(id) == 2) entity_set_model(g_adminmarkEnt, MODEL_MARK)
}
}
if (g_adminmarkEnt > 0)
{
new modelID = get_model_id(id)
entity_set_int(g_adminmarkEnt, EV_INT_body, modelID)
}
if(g_adminmarkEnt < 1)
return PLUGIN_CONTINUE
return PLUGIN_CONTINUE
}
new modelname[] ={
"gign",
"gsg9",
"sas",
"urban",
"vip",
"arctic",
"guerilla",
"leet",
"terror"
}
public get_model_id(id)
{
new modelStr, iNum=32, modelID
get_user_info(id,"model",modelStr,iNum)
for(new i = 0; i < 9; i++)
{
if (equali (modelStr, modelname) )
{
modelID = i
}
}
return modelID
}带帽源码修改
不用任何权限T和CT带不同帽子
声明本源码非我所改 本帖最后由 点通粉丝 于 2009-2-7 01:16 编辑
潜力选手...见到没啊....要发这些网上没的..新鲜的..才会被选为精华的..知不..:lol 适合1.5不,我是菜鸟 这位老兄..你注意一下哦..我在本论坛发的所有东东都是用于CS1.5的.知不.1.6我从不完的 有创意,牛年带牛帽,能跟上时代潮流呀. 还真有才啊,哈哈希望多出作品! 帽子有什么用 不错!很有才华!!! 好东西,要顶 无聊的插件