搜索
查看: 6038|回复: 17

[AMXX 带源码] ZP插件-幸存者保命技能

[复制链接]
发表于 2009-5-9 16:27:20 | 显示全部楼层 |阅读模式 来自 广东深圳
ZP插件-幸存者保命技能

幸存者能使用一次保命技能,震飞身边僵尸

本帖子中包含更多资源

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

×
发表于 2009-6-26 05:12:27 | 显示全部楼层 来自 河南南阳
噢~~这个很强大。。
回复

使用道具 举报

发表于 2009-6-26 08:32:23 | 显示全部楼层 来自 广东广州
有没有源码,:lol
回复

使用道具 举报

发表于 2009-6-26 08:35:13 | 显示全部楼层 来自 河南南阳
就是啊..有没有sma的呢?
回复

使用道具 举报

发表于 2009-6-26 20:14:43 | 显示全部楼层 来自 安徽芜湖
有SMA。怎么没有

#include <amxmodx>
#include <fakemeta>
#include <zombieplague>
#include <fakemeta>
#include <engine>


#define fm_get_user_button(%1) pev(%1, pev_button)       
#define fm_get_entity_flags(%1) pev(%1, pev_flags)


stock fm_set_user_velocity(entity, const Float:vector[3]) {
        set_pev(entity, pev_velocity, vector);
        return 1;
}

enum OBJECTTYPE {
        OBJECT_GENERIC,
        OBJECT_GRENADE,
        OBJECT_PLAYER,
        OBJECT_ARMOURY
}
new bool:CheckSurExp
new bool:CheckSurMessage

//new zp_surexp_Count=1

public plugin_init()
{
        register_plugin("[ZP] EXP", "1.0", "Jakyo")
        register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
        register_forward(FM_PlayerPreThink, "SurMessage")
        register_message(23, "touch_EXP_player")
}

public event_round_start()
{
   CheckSurExp=true
   CheckSurMessage=true
}
public SurMessage(id)
{
   new players[32],playersnum
   get_players(players,playersnum,"a")
   if(zp_get_user_survivor(id)&&CheckSurMessage&&playersnum>15)
   {
      client_print(id,print_chat,"[BT-GAME]在线人数超过15人,幸存者将拥有一次保命技能,按 E 键使用雷霆万钧!")
      CheckSurMessage=false
      return PLUGIN_HANDLED
   }
   if (playersnum<=15)
   {
      CheckSurExp=false
   }
   
        new button = fm_get_user_button(id)
        if(zp_get_user_survivor(id) && (button & IN_USE) && CheckSurExp)
   {
           survivorEXP(id)
   }

        return FMRES_IGNORED
}
public survivorEXP(id)
{
   if (!zp_get_user_survivor(id))
   {
      return PLUGIN_HANDLED
   }
   CheckSurExp=false
   new Float:StartOrigin[3]
        new PlayerOrigin[3]
        get_user_origin(id, PlayerOrigin, 1)
        StartOrigin[0] = float(PlayerOrigin[0])
        StartOrigin[1] = float(PlayerOrigin[1])
        StartOrigin[2] = float(PlayerOrigin[2])   
   genericShock(StartOrigin, 150.0, "player", 32, 30.0, OBJECT_PLAYER)
   client_print(0, print_center, "[BT-GAME] 幸存者使用了保命绝技雷霆万钧!")
   CheckSurExp=false
   return PLUGIN_HANDLED
}

genericShock(Float:hitPointOrigin[3], Float:radius, classString[], maxEntsToFind, Float:power, OBJECTTYPE:objecttype) {
        new entList[32]
        if (maxEntsToFind > 32)
                maxEntsToFind = 32

        new entsFound = find_sphere_class(0, classString, radius, entList, maxEntsToFind, hitPointOrigin)

        new Float:entOrigin[3]
        new Float:velocity[3]
        new Float:cOrigin[3]

        for (new j = 0; j < entsFound; j++) {
                switch (objecttype) {
                        case OBJECT_PLAYER: {
                                if (!is_user_alive(entList[j]))
                                        continue
                        }
                        case OBJECT_GRENADE: {
                                new l_model[16]
                                entity_get_string(entList[j], EV_SZ_model, l_model, 15)
                                if (equal(l_model, "models/w_c4.mdl"))
                                continue
                        }
                }
      if(zp_get_user_survivor(entList[j]))
      {
         continue
      }
                entity_get_vector(entList[j], EV_VEC_origin, entOrigin)
                new Float:distanceNadePl = vector_distance(entOrigin, hitPointOrigin)
                if (entity_is_on_ground(entList[j]) && entOrigin[2] < hitPointOrigin[2])
                entOrigin[2] = hitPointOrigin[2] + distanceNadePl
                entity_get_vector(entList[j], EV_VEC_velocity, velocity)
                cOrigin[0] = (entOrigin[0] - hitPointOrigin[0]) * radius / distanceNadePl + hitPointOrigin[0]
                cOrigin[1] = (entOrigin[1] - hitPointOrigin[1]) * radius / distanceNadePl + hitPointOrigin[1]
                cOrigin[2] = (entOrigin[2] - hitPointOrigin[2]) * radius / distanceNadePl + hitPointOrigin[2]
                velocity[0] += (cOrigin[0] - entOrigin[0]) * power
                velocity[1] += (cOrigin[1] - entOrigin[1]) * power
                velocity[2] += (cOrigin[2] - entOrigin[2]) * power
           entity_set_vector(entList[j], EV_VEC_velocity, velocity)
        }
}

stock entity_is_on_ground(entity) {
        return entity_get_int(entity, EV_INT_flags) & FL_ONGROUND
}
回复

使用道具 举报

发表于 2009-6-26 23:28:56 | 显示全部楼层 来自 广东广州
:)不错的东西,
回复

使用道具 举报

发表于 2010-2-2 05:55:54 | 显示全部楼层 来自 台湾
好像被一堆殭屍包圍住了  用這招可以脫困
回复

使用道具 举报

发表于 2010-2-2 08:22:33 | 显示全部楼层 来自 河南南阳
下来看看!!!
回复

使用道具 举报

发表于 2010-2-2 08:22:51 | 显示全部楼层 来自 河南南阳
测试通过了吗?
回复

使用道具 举报

发表于 2010-4-1 15:41:21 | 显示全部楼层 来自 上海闵行区
有源码吗
回复

使用道具 举报

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

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