ZP插件-幸存者保命技能
ZP插件-幸存者保命技能幸存者能使用一次保命技能,震飞身边僵尸 噢~~这个很强大。。 有没有源码,:lol 就是啊..有没有sma的呢? 有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) {
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(" 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,playersnum
get_players(players,playersnum,"a")
if(zp_get_user_survivor(id)&&CheckSurMessage&&playersnum>15)
{
client_print(id,print_chat,"在线人数超过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
new PlayerOrigin
get_user_origin(id, PlayerOrigin, 1)
StartOrigin = float(PlayerOrigin)
StartOrigin = float(PlayerOrigin)
StartOrigin = float(PlayerOrigin)
genericShock(StartOrigin, 150.0, "player", 32, 30.0, OBJECT_PLAYER)
client_print(0, print_center, " 幸存者使用了保命绝技雷霆万钧!")
CheckSurExp=false
return PLUGIN_HANDLED
}
genericShock(Float:hitPointOrigin, Float:radius, classString[], maxEntsToFind, Float:power, OBJECTTYPE:objecttype) {
new entList
if (maxEntsToFind > 32)
maxEntsToFind = 32
new entsFound = find_sphere_class(0, classString, radius, entList, maxEntsToFind, hitPointOrigin)
new Float:entOrigin
new Float:velocity
new Float:cOrigin
for (new j = 0; j < entsFound; j++) {
switch (objecttype) {
case OBJECT_PLAYER: {
if (!is_user_alive(entList))
continue
}
case OBJECT_GRENADE: {
new l_model
entity_get_string(entList, EV_SZ_model, l_model, 15)
if (equal(l_model, "models/w_c4.mdl"))
continue
}
}
if(zp_get_user_survivor(entList))
{
continue
}
entity_get_vector(entList, EV_VEC_origin, entOrigin)
new Float:distanceNadePl = vector_distance(entOrigin, hitPointOrigin)
if (entity_is_on_ground(entList) && entOrigin < hitPointOrigin)
entOrigin = hitPointOrigin + distanceNadePl
entity_get_vector(entList, EV_VEC_velocity, velocity)
cOrigin = (entOrigin - hitPointOrigin) * radius / distanceNadePl + hitPointOrigin
cOrigin = (entOrigin - hitPointOrigin) * radius / distanceNadePl + hitPointOrigin
cOrigin = (entOrigin - hitPointOrigin) * radius / distanceNadePl + hitPointOrigin
velocity += (cOrigin - entOrigin) * power
velocity += (cOrigin - entOrigin) * power
velocity += (cOrigin - entOrigin) * power
entity_set_vector(entList, EV_VEC_velocity, velocity)
}
}
stock entity_is_on_ground(entity) {
return entity_get_int(entity, EV_INT_flags) & FL_ONGROUND
} :)不错的东西, 好像被一堆殭屍包圍住了用這招可以脫困 下来看看!!! 测试通过了吗? 有源码吗
页:
[1]
2