0920357689 发表于 2008-8-10 15:59:25

求op能把op推開的插件

這個只能把普通玩家推開..
因經常玩awp被op檔住老被射死...想請教一下
如果改才能把op也能推開

#include <amxmodx>
#include <engine>
#include <cstrike>
new PLUGIN[] = "Admin Push out of the way!"
new AUTHOR[] = "jsauce"
new VERSION[] = "1.2"
#define AUTOSENSE// UNCOMMENT TO USE AUTOSENSE!
#if defined AUTOSENSE
#include <amxmisc>
new bool:validmap = false
#endif
public plugin_init()
{
register_plugin(PLUGIN,VERSION,AUTHOR)
#if defined AUTOSENSE
register_cvar("amx_adminpush","0")
#else
register_cvar("amx_adminpush","1")
#endif
register_cvar("amx_adminpushlevel","10")
register_touch("player","player","admin_touched")
#if defined AUTOSENSE
new mapcfg,configsdir
get_configsdir(configsdir,127)
format(mapcfg,31,"%s/adminpushconfig.cfg",configsdir)
if(!file_exists(mapcfg))
{
validmap = false
return PLUGIN_CONTINUE
}
else
{
new map,mapname,i=0,txtlen
get_mapname(map,31)
    while(read_file(mapcfg,i++,mapname,31,txtlen))
    {
   if((mapname == ';') || !txtlen) continue
   if (equali(mapname,map))
   {
    validmap = true
    break
   }
}
}
#endif
return PLUGIN_CONTINUE
}
public is_valid_player(id)
{
if(is_valid_ent(id))
{
new szClassname
entity_get_string(id,EV_SZ_classname,szClassname,31)
return (equali(szClassname,"player"))
}
return 0
}
public admin_touched ( ptr, ptd )
{
#if defined AUTOSENSE
if (validmap)
{
set_cvar_num("amx_adminpush",1)
}
#endif
if (get_cvar_num("amx_adminpush")==1)
{

if ( get_user_flags ( ptr ) & ADMIN_RESERVATION && is_valid_player ( ptd ) )
{
   if(!( get_user_flags ( ptd ) & ADMIN_RESERVATION ))
   {
    new CsTeams:ptrTeam = cs_get_user_team(ptr)
    new CsTeams:ptdTeam = cs_get_user_team(ptd)
    if (ptrTeam == ptdTeam)
    {
   new Float:a
   entity_get_vector ( ptr, EV_VEC_origin, a )
   entity_get_vector ( ptd, EV_VEC_origin, a )
   new b, g_cvarpush = get_cvar_num("amx_adminpushlevel")
   for ( b = 0;b <= 2;b++ )
   {
      a -= a
      a *= g_cvarpush
   }
   entity_set_vector ( ptd, EV_VEC_velocity, a )
    }
   }
}
}
}

veryluckko 发表于 2008-8-12 16:27:00

回复: 求op能把op推開的插件

if ( get_user_flags ( ptr ) & ADMIN_RESERVATION && is_valid_player ( ptd ) )
{
   if(!( get_user_flags ( ptd ) & ADMIN_RESERVATION ))
   {

这几句处理一下就好了

Cr@zyTreE 发表于 2008-8-12 21:11:34

回复: 求op能把op推開的插件

去掉if(!( get_user_flags ( ptd ) & ADMIN_RESERVATION ))
   {

和后面跟他配对的}即可。

jorlon 发表于 2008-8-18 19:27:47

回复: 求op能把op推開的插件

这个插件怎么用呀?安装上之后,怎么推?直接靠上去,没有效果呀?
页: [1]
查看完整版本: 求op能把op推開的插件