搜索
查看: 6936|回复: 16

求OP进F带帽子插件源码。

[复制链接]
发表于 2008-10-30 19:52:15 | 显示全部楼层 |阅读模式 来自 中国–贵州–贵阳
                                 同题

希望竟快能得到答复!
发表于 2008-10-30 20:37:31 | 显示全部楼层 来自 中国–重庆–重庆

回复: 求OP进F带帽子插件源码。

/* 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[33]
new cvar_enable
new MODEL_MARK[]  = "models/BaoZhaTOuFa.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)

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[id] > 0)
  remove_entity(g_adminmarkEnt[id])
g_adminmarkEnt[id] = 0
}
public client_disconnect(id)
{
if(g_adminmarkEnt[id] > 0)
  remove_entity(g_adminmarkEnt[id])
g_adminmarkEnt[id] = 0
}
public client_PreThink(id)
{
if(!is_user_connected(id))
  return PLUGIN_CONTINUE

if(!is_user_alive(id) && g_adminmarkEnt[id] > 0)
{
  remove_entity(g_adminmarkEnt[id])
  g_adminmarkEnt[id] = 0
  
  return PLUGIN_CONTINUE
}

if (!(get_user_flags(id) & ADMIN_KICK))
{
  remove_entity(g_adminmarkEnt[id])
  g_adminmarkEnt[id] = 0
  
  return PLUGIN_CONTINUE
}

if(!get_pcvar_num(cvar_enable))
  return PLUGIN_CONTINUE
  
if(!is_user_alive(id))
  return PLUGIN_CONTINUE
  
if(g_adminmarkEnt[id] < 1)
{
  g_adminmarkEnt[id] = create_entity("info_target")
  if(g_adminmarkEnt[id] > 0)
  {
   entity_set_int(g_adminmarkEnt[id], EV_INT_movetype, MOVETYPE_FOLLOW)
   entity_set_edict(g_adminmarkEnt[id], EV_ENT_aiment, id)
   entity_set_model(g_adminmarkEnt[id], MODEL_MARK)   
  }
}

if (g_adminmarkEnt[id] > 0)
{
  new modelID = get_model_id(id)
  entity_set_int(g_adminmarkEnt[id], EV_INT_body, modelID)
}
if(g_adminmarkEnt[id] < 1)
  return PLUGIN_CONTINUE
return PLUGIN_CONTINUE
}
new modelname[9][] ={
"gign",
"gsg9",
"sas",
"urban",
"vip",
"arctic",
"guerilla",
"leet",
"terror"
}
public get_model_id(id)
{
new modelStr[32], 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
}
回复

使用道具 举报

 楼主| 发表于 2008-10-30 21:25:49 | 显示全部楼层 来自 中国–贵州–贵阳

回复: 求OP进F带帽子插件源码。

呵呵!还是你好哈!

谢了1Ow
回复

使用道具 举报

发表于 2009-9-6 17:07:07 | 显示全部楼层 来自 中国–广东–深圳
谢谢源码
回复

使用道具 举报

发表于 2009-9-12 09:20:56 | 显示全部楼层 来自 中国–湖南–长沙
不错 !哈哈 我喜欢!!
回复

使用道具 举报

发表于 2009-9-16 18:37:06 | 显示全部楼层 来自 中国–江西–萍乡
好东西收下啦
回复

使用道具 举报

发表于 2009-10-24 04:01:10 | 显示全部楼层 来自 中国–浙江–杭州
我也给你一个一样的。
*        - 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[33]
new cvar_enable
new MODEL_MARK[]         = "models/admin_head.mdl"

static const PLUGIN_NAME[]         = "Admin Mark"
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)       
       
        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[id] > 0)
                remove_entity(g_adminmarkEnt[id])
        g_adminmarkEnt[id] = 0
}

public client_disconnect(id)
{
        if(g_adminmarkEnt[id] > 0)
                remove_entity(g_adminmarkEnt[id])
        g_adminmarkEnt[id] = 0
}

public client_PreThink(id)
{
        if(!is_user_connected(id))
                return PLUGIN_CONTINUE
       
        if(!is_user_alive(id) && g_adminmarkEnt[id] > 0)
        {
                remove_entity(g_adminmarkEnt[id])
                g_adminmarkEnt[id] = 0
               
                return PLUGIN_CONTINUE
        }
       
        if (!(get_user_flags(id) & ADMIN_KICK))
        {
                remove_entity(g_adminmarkEnt[id])
                g_adminmarkEnt[id] = 0
               
                return PLUGIN_CONTINUE
        }
       
        if(!get_pcvar_num(cvar_enable))
                return PLUGIN_CONTINUE
               
        if(!is_user_alive(id))
                return PLUGIN_CONTINUE
               
        if(g_adminmarkEnt[id] < 1)
        {
                g_adminmarkEnt[id] = create_entity("info_target")
                if(g_adminmarkEnt[id] > 0)
                {
                        entity_set_int(g_adminmarkEnt[id], EV_INT_movetype, MOVETYPE_FOLLOW)
                        entity_set_edict(g_adminmarkEnt[id], EV_ENT_aiment, id)
                        entity_set_model(g_adminmarkEnt[id], MODEL_MARK)                       
                }
        }
       
        if (g_adminmarkEnt[id] > 0)
        {
                new modelID = get_model_id(id)
                entity_set_int(g_adminmarkEnt[id], EV_INT_body, modelID)
        }

        if(g_adminmarkEnt[id] < 1)
                return PLUGIN_CONTINUE

        return PLUGIN_CONTINUE
}

new modelname[9][] ={
        "gign",
        "gsg9",
        "sas",
        "urban",
        "vip",
        "arctic",
        "guerilla",
        "leet",
        "terror"
}

public get_model_id(id)
{
        new modelStr[32], 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
}


帽子也给你吧!
有图!

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注个册吧

×
回复

使用道具 举报

发表于 2009-10-24 04:02:38 | 显示全部楼层 来自 中国–浙江–杭州
叼着烟。!
回复

使用道具 举报

发表于 2010-5-20 13:43:17 | 显示全部楼层 来自 中国–广东–汕头
好东西啊:lol
回复

使用道具 举报

发表于 2010-5-20 13:45:05 | 显示全部楼层 来自 中国–广东–汕头
7# cs9527
回复

使用道具 举报

游客
回复
您需要登录后才可以回帖 登录 | 注个册吧

快速回复 返回顶部 返回列表