|
发表于 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
} |
|