仿Left4Dead救活已死的隊友

社区服务
高级搜索
猴岛论坛CSGO反恐精英CS个性化修改专区仿Left4Dead救活已死的隊友
发帖 回复
倒序阅读 最近浏览的帖子最近浏览的版块
13个回复

仿Left4Dead救活已死的隊友

楼层直达
a5204653

ZxID:7495339

等级: 上尉
举报 只看楼主 使用道具 楼主   发表于: 2009-08-12 0
可以讓死亡的隊友對著屍體按e救活[彷彿L4D的救活隊友]
預設花500錢救活隊友一條命
救人時有像拆炸彈時候中間一條時間軸在跑
用在殭屍模式也頗不錯的效果
ps:要先bind 您要設定的按鍵 + "reviva"

#include <amxmodx>
#include <cstrike>
#include <engine>
#include <fun>

#define revive_delay 10

#define MSG_FAILED "Failed to Revive"
#define MSG_SUCCEED "Succeed to Revive"
#define MSG_START "Reviving"

#define REVIVE_TASK 1234
#define LOOP_BOOP 5678
#define ICON_HIDE 0
#define ICON_SHOW 1
#define ICON_FLASH 2

#define VER "1.0.1"

new g_msgBarTime, g_msgStatusIcon, pl_origins[33][3], reviverorigin[3], Float:oldspeed[33], bool:g_buyzone[33], bool:has_revkit[33] = false, dead_id

public plugin_init()
{
register_plugin("Reviver's Kit", VER, "Cheap_Suit")
register_cvar("amx_revivalkitcost", "500")
register_cvar("amx_revivehealth", "100")

register_clcmd("say /buyrevkit", "BuyRevivalKit")
register_clcmd("buyrevkit", "BuyRevivalKit")

register_clcmd("+revive", "revive_plus")
register_clcmd("-revive", "revive_minus")

register_event("DeathMsg","player_die","a")
register_event("StatusIcon", "Buy_Icon", "be", "2=buyzone")
register_event("ResetHUD", "newRound", "be")

g_msgBarTime = get_user_msgid("BarTime")
g_msgStatusIcon = get_user_msgid("StatusIcon")
}
//-- Plugin Precache, Plugin Modules
public plugin_precache()
{
precache_sound("fvox/boop.wav")
precache_sound("fvox/fuzz.wav")
precache_sound("fvox/administering_medical.wav")
precache_sound("fvox/wound_sterilized.wav")
precache_sound("vox/deeoo.wav")
precache_model("models/w_medkit.mdl")
}

public plugin_modules()
{
require_module("Engine")
require_module("cstrike")
require_module("fun")
}
//-- newRound, BuyRevivalKit, DropKit, pfn_touch, player_die
public newRound(id)
{
if(has_revkit[id] == false)
{
client_print(id, print_chat, "[AMXX] Type /buyrevkit or buyrevkit in your console to buy Reviver's Kit")
}
if(has_revkit[id] == true)
{
ReviveIcon(id, ICON_SHOW)
}

new revivalkit = find_ent_by_class(-1, "revivalkit")
while (revivalkit)
{
remove_entity(revivalkit)
revivalkit = find_ent_by_class(revivalkit, "revivalkit")
}
return PLUGIN_CONTINUE
}

public BuyRevivalKit(id)
{
new money = cs_get_user_money(id)
if(money >= get_cvar_num("amx_revivalkitcost") && g_buyzone[id] && has_revkit[id] == false)
{
client_print(id, print_center, "You bought a Revival Kit!")
client_print(id, print_chat, "[AMXX] bind a button to +revive")
client_cmd(id, "spk vox/deeoo.wav")
cs_set_user_money(id, money - get_cvar_num("amx_revivalkitcost"))

ReviveIcon(id, ICON_SHOW)
has_revkit[id] = true
}
return PLUGIN_HANDLED
}

public DropKit(id)
{
new Float:Aim[3], Float:origin[3]

VelocityByAim(id, 64, Aim)
entity_get_vector(id, EV_VEC_origin, origin)

origin[0] += Aim[0]
origin[1] += Aim[1]

new revivalkit = create_entity("info_target")
if(revivalkit > 0)
{
entity_set_string(revivalkit, EV_SZ_classname, "revivalkit")
entity_set_model(revivalkit, "models/w_medkit.mdl")
entity_set_size(revivalkit, Float:{-2.5, -2.5, -1.5}, Float:{2.5, 2.5, 1.5})
entity_set_int(revivalkit, EV_INT_solid, 1)
entity_set_int(revivalkit, EV_INT_movetype, 6)
entity_set_vector(revivalkit, EV_VEC_origin, origin)
}
ReviveIcon(id, 0)
has_revkit[id] = false
}

public pfn_touch(ptr, ptd)
{
if(is_valid_ent(ptd) && is_valid_ent(ptr) && is_user_connected(ptd) && is_user_alive(ptd))
{
new classname[32]
entity_get_string(ptr, EV_SZ_classname, classname, 31)
if(equal(classname, "revivalkit"))
{
if(has_revkit[ptd] == false)
{
client_cmd(ptd, "spk vox/deeoo.wav")

ReviveIcon(ptd, ICON_SHOW)
has_revkit[ptd] = true

remove_entity(ptr)
}
}
}
}

public player_die()
{
new victim = read_data(2)
get_user_origin(victim, pl_origins[victim], 0)

if(has_revkit[victim])
{
DropKit(victim)
}
return PLUGIN_CONTINUE
}
//-- revive_plus, revive_minus
public revive_plus(id)
{
if(!is_user_alive(id)) return PLUGIN_CONTINUE

new cur_origin[3], players[32], pl_num = 0, dist, last_dist = 99999
get_user_origin(id, cur_origin, 0)
get_players(players, pl_num, "b")

if(pl_num > 0)
{
for(new i = 0; i < pl_num; i++)
{
if(players!= id)
{
dist = get_distance(cur_origin, pl_origins[players])
if(dist < last_dist)
{
last_dist = dist
dead_id = players
}
}
}

if(last_dist < 80)
{
if(has_revkit[id])
{
if(!task_exists(REVIVE_TASK + id))
{
new name[33]
get_user_name(dead_id, name, 32)
client_print(id, print_center, "%s %s...", MSG_START, name)

oldspeed[id] = get_user_maxspeed(id)
set_user_maxspeed(id, 1.0)

emit_sound(id, CHAN_ITEM, "fvox/administering_medical.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
ProgressBar(id, revive_delay)
ReviveIcon(id, ICON_FLASH)

new param[2]
param[0] = id
set_task(float(revive_delay), "Revive_Player", REVIVE_TASK + id, param, 1)
set_task(3.0, "boop", LOOP_BOOP + id, param, 1)
}
}
}
else if(last_dist > 80)
{
if(has_revkit[id])
{
emit_sound(id, CHAN_ITEM, "common/wpn_denyselect.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
}
}
}
return PLUGIN_HANDLED
}

public revive_minus(id)
{
if(task_exists(REVIVE_TASK + id))
{
new name[33]
get_user_name(dead_id, name, 32)
client_print(id, print_center, "%s %s", MSG_FAILED, name)

ProgressBar(id, 0)
ReviveIcon(id, ICON_SHOW)
set_user_maxspeed(id, oldspeed[id])

remove_task(REVIVE_TASK + id)
}

if(task_exists(LOOP_BOOP + id))
{
emit_sound(id, CHAN_STATIC, "fvox/fuzz.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
remove_task(LOOP_BOOP + id)
}
return PLUGIN_HANDLED
}
//-- Revive_Player, respawn, boop
public Revive_Player(param[])
{
new id = param[0]
if(!is_user_alive(dead_id) && (cs_get_user_team(dead_id) == CS_TEAM_T|| cs_get_user_team(dead_id) == CS_TEAM_CT))
{
spawn(dead_id)
new origin[3] = {999, 999, 999}
set_user_origin(dead_id, origin)

set_task(3.0, "respawn", dead_id, param, 1)
}

new name[33]
get_user_name(dead_id, name, 32)
client_print(id, print_chat, "%s %s... please stand back", MSG_SUCCEED, name)
//emit_sound(id, CHAN_STATIC, "common/null.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
emit_sound(id, CHAN_STATIC, "fvox/wound_sterilized.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)

get_user_origin(id, reviverorigin, 0)
set_user_maxspeed(id, oldspeed[id])

ReviveIcon(id, ICON_HIDE)
has_revkit[id] = false

remove_task(REVIVE_TASK + id)
remove_task(LOOP_BOOP + id)
}

public respawn(param[])
{
if(cs_get_user_team(dead_id) == CS_TEAM_SPECTATOR) return PLUGIN_CONTINUE
if(cs_get_user_team(dead_id) == CS_TEAM_T || cs_get_user_team(dead_id) == CS_TEAM_CT)
{
new id = param[0]

new name[33]
get_user_name(id, name, 32)
client_print(dead_id, print_chat, "Revived by %s", name)

spawn(dead_id)
reviverorigin[2] += 40
set_user_origin(dead_id, reviverorigin)
give_item(dead_id, "weapon_knife")
set_user_health(dead_id, get_cvar_num("amx_revivehealth"))
}
return PLUGIN_CONTINUE
}

public boop(param[])
{
new id = param[0]
emit_sound(id, CHAN_STATIC, "fvox/boop.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)

set_task(1.5, "boop", LOOP_BOOP + id, param, 1)
}
//-- ProgressBar ReviveIcon, Buy_Icon
ProgressBar(id, seconds)
{
message_begin(MSG_ONE, g_msgBarTime, {0, 0, 0}, id)
write_byte(seconds)
write_byte(0)
message_end()
}

ReviveIcon(id, ICON)
{
message_begin(MSG_ONE, g_msgStatusIcon, {0, 0, 0}, id )
write_byte(ICON)
write_string("item_healthkit")
write_byte(0)
write_byte(160)
write_byte(0)
message_end()
}

public Buy_Icon(id)
{
if(read_data(1))
{
g_buyzone[id] = true
}
else
{
g_buyzone[id] = false
}
}
//-- End
附件: 复活已死队友.rar (3 K) 下载数:39
146116168

ZxID:8332927

等级: 新兵
举报 只看该作者 沙发   发表于: 2009-08-12 0
试试
三八仔

ZxID:6543668

等级: 新兵
举报 只看该作者 板凳   发表于: 2009-08-12 0
试试看也好啊
xiaoyi1972

ZxID:5837138

等级: 新兵
举报 只看该作者 地板   发表于: 2009-08-13 0
wadddddddddddd
本帖de评分: 1 条评分 DB -3
DB-3

恶意灌水

xiaoyi1972

ZxID:5837138

等级: 新兵
举报 只看该作者 4楼  发表于: 2009-08-13 0
asdffffffffffffffffffffffffffffffffs
本帖de评分: 1 条评分 DB -3
DB-3

恶意灌水

woaizhuqi

ZxID:8353830

等级: 新兵
举报 只看该作者 5楼  发表于: 2009-08-13 0
不错哦~~很新鲜
loveshinddddd

ZxID:8352160

等级: *
举报 只看该作者 6楼  发表于: 2009-08-14 0
谢谢楼主!我一直想要
i99ii99

ZxID:8459120

等级: 列兵
举报 只看该作者 7楼  发表于: 2009-08-14 0
  
本帖de评分: 1 条评分 DB -3
DB-3

恶意灌水

i99ii99

ZxID:8459120

等级: 列兵
举报 只看该作者 8楼  发表于: 2009-08-14 0
   不错···
i99ii99

ZxID:8459120

等级: 列兵
举报 只看该作者 9楼  发表于: 2009-08-14 0
  
本帖de评分: 1 条评分 DB -3
DB-3

恶意灌水

yangxiaotian

ZxID:1363713

等级: 上等兵
举报 只看该作者 10楼  发表于: 2009-10-24 0
Left4Dead救活已死的隊友
qq8992679

ZxID:4655042

等级: 中士
举报 只看该作者 11楼  发表于: 2010-01-23 0
没图吗?
458471068

ZxID:2126524

等级: 上士
举报 只看该作者 12楼  发表于: 2010-01-24 0
超级完美
不说了
唯。爱。奏 【挚爱kanade】
天残风暴

ZxID:10484890

等级: 下士
举报 只看该作者 13楼  发表于: 2010-01-26 0
收藏。拿走
« 返回列表
发帖 回复