mao0797 发表于 2006-8-26 18:58:08

请求高手汉化此插件

请问谁可以帮我汉化一下这个插件?????
我修改后另存为UTF-8后编译失败:sweat:


#define RKIT_COST1000 //成本
#define RKIT_HEALTH60 //复活成功后有多少血值
#define REVIVE_TEAM0 //是否可以复活敌人默认1(关闭)
#define REVIVE_POINTS2 //复活队友奖励分数
#define REVIVE_DELAY7 //delay before player is spawned
#define REVIVAL_DISTANCE 38 //复活距离
new MSG_START[]= "Reviving"
new MSG_REVIVEBY[] = "Revived by"
new MSG_PATCHING[] = "Patching up"
new MSG_FAILED[]= "Failed to revive"
new MSG_SUCCEED[]= "Succeed to revive"
new MSG_PICKEDUP[] = "Picked up a Revival Kit"
new MSG_CENTERBUYKIT[] = "You bought a Revival Kit"
new MSG_BUYKIT[] = "To revive a dead person, simply stand close and hold your use key (E)"
new SOUND_OBTAINKIT[] = "vox/deeoo.wav"
new SOUND_REVIVING[] = "fvox/boop.wav"
new SOUND_CANCELED[] = "fvox/buyrkituzz.wav"
new SOUND_FINISHED[] = "fvox/wound_sterilized.wav"
new SOUND_STARTING[] = "fvox/administering_medical.wav"
new MODEL_RKIT[] = "models/w_medkit.mdl"
/* DO NOT EDIT BEYOND THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING */
#include <amxmodx>
#include <cstrike>
#include <engine>
#include <fun>
#define TASKID_REVIVE 12
#define TASKID_REVIVE2 49
#define TASKID_BOOP 34
new g_cvarvalue
new g_freezetime
new Float:g_starttime
new g_restarting
new Float:g_Delay
new g_HasKit
new g_buyzone
new g_ReviveSpeed
new Float:g_OldSpeed
new g_DeadOrigins
new g_ReviveOrigin
enum
{
ICON_HIDE = 0,
ICON_SHOW,
ICON_FLASH
}
new PLUGIN_NAME[]= "Revival Kit"
new PLUGIN_AUTHOR[]= "Cheap_Suit"
new PLUGIN_VERSION[]= "1.0.9"
public plugin_init()
{
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)
register_dictionary("revivalkit.txt")
register_concmd("buyrkit",   "cmd_BuyKit", 0, "Ability to revive team mates")
register_clcmd("say /buyrkit",   "cmd_BuyKit", 0, "Ability to revive team mates")
//register_clcmd("say_team /buyrkit","cmd_BuyKit", 0, "Ability to revive team mates")
num_to_str(RKIT_COST, g_cvarvalue, 20)
register_cvar("amx_rkit_cost", g_cvarvalue)

num_to_str(RKIT_HEALTH, g_cvarvalue, 20)
register_cvar("amx_rkit_health", g_cvarvalue)

register_event("DeathMsg", "Event_DeathMsg","a")
register_event("ResetHUD","Event_ResetHud","be")
register_event("Damage","Event_DamageDeath","bd","2>0")
register_event("StatusIcon","Event_BuyZone",   "b", "2=buyzone")
register_event("HLTV",   "Event_NewRound","a", "1=0", "2=0")
register_event("TextMsg","Event_GameRestart","a", "2=#Game_Commencing", "2=#Game_will_restart_in")

register_touch("RevivalKit", "player", "touch_RevivalKit")
register_logevent("LogEvent_RoundStart", 2, "0=World triggered", "1=Round_Start")
}
public plugin_precache()
{
precache_sound(SOUND_OBTAINKIT)
precache_sound(SOUND_REVIVING)
precache_sound(SOUND_CANCELED)
precache_sound(SOUND_FINISHED)
precache_sound(SOUND_STARTING)
precache_model(MODEL_RKIT)
}
public Event_ResetHud(id)
{
if(g_HasKit)
{
ReviveIcon(id, ICON_SHOW)
g_ReviveSpeed = false
set_user_maxspeed(id, g_OldSpeed)
if(task_exists(TASKID_BOOP + id)) remove_task(TASKID_BOOP + id)
if(task_exists(TASKID_REVIVE + id)) remove_task(TASKID_REVIVE + id)
}
return PLUGIN_CONTINUE
}
public Event_GameRestart() {
g_restarting = 1
}
public Event_NewRound()
{
new Players, iNum = 0
get_players(Players, iNum)
for(new i = 0; i < iNum; i++)
{
new id = Players
set_user_maxspeed(id, g_OldSpeed)
if(g_restarting)
{
   g_HasKit = 0
   g_ReviveSpeed = false
   
   ProgressBar(id, 0)
   ReviveIcon(id, ICON_HIDE)
   
   if(task_exists(TASKID_BOOP + id)) remove_task(TASKID_BOOP + id)
   if(task_exists(TASKID_REVIVE + id)) remove_task(TASKID_REVIVE + id)
   
   g_restarting = 0
}
}

remove_kits()
g_freezetime = 1
remove_task(TASKID_REVIVE2)
}
public Event_BuyZone(id) {
g_buyzone = read_data(1)
}
public LogEvent_RoundStart()
{
g_freezetime = 0
g_starttime = get_gametime()
set_task(1.0, "task_botbuy")
}
public task_botbuy()
{
new Players, iNum
get_players(Players, iNum, "ad")
for(new i = 0; i < iNum; ++i) if(!g_HasKit])
{
switch(random_num(0, 1)) {
   case 1: cmd_BuyKit(Players)
}
}
}
public Event_DeathMsg()
{
new victim = read_data(2)
set_task(0.5, "task_deadflag", victim)

if(task_exists(TASKID_BOOP + victim)) remove_task(TASKID_BOOP + victim)
if(task_exists(TASKID_REVIVE + victim)) remove_task(TASKID_REVIVE + victim)

if(g_HasKit)
{
ReviveIcon(victim, ICON_HIDE)
ProgressBar(victim, 0)

set_user_maxspeed(victim, g_OldSpeed)
g_ReviveSpeed = false
g_HasKit = 0
drop_kit(victim)
}
return PLUGIN_CONTINUE
}
public Event_DamageDeath(victim)
{
set_task(0.5, "task_deadflag", victim)

if(task_exists(TASKID_BOOP + victim)) remove_task(TASKID_BOOP + victim)
if(task_exists(TASKID_REVIVE + victim)) remove_task(TASKID_REVIVE + victim)

if(g_HasKit)
{
ReviveIcon(victim, ICON_HIDE)
ProgressBar(victim, 0)

set_user_maxspeed(victim, g_OldSpeed)
g_ReviveSpeed = false
g_HasKit = 0
drop_kit(victim)
}
}
public task_deadflag(id)
{
if(!is_user_connected(id)) {
return
}

if(entity_get_int(id, EV_INT_deadflag) != 2) {
set_task(0.5, "task_deadflag", id)
} else {
get_user_origin(id, g_DeadOrigins, 0)
}
}

public drop_kit(id)
{
new Float:flVelocity
VelocityByAim(id, 64, flVelocity)

new Float:vOrigin
entity_get_vector(id, EV_VEC_origin, vOrigin)
vOrigin += flVelocity
vOrigin += flVelocity
new rKit = create_entity("info_target")
if(!is_valid_ent(rKit)) {
return PLUGIN_CONTINUE
}

entity_set_string(rKit, EV_SZ_classname, "RevivalKit")
entity_set_model(rKit, MODEL_RKIT)
entity_set_size(rKit, Float:{-2.5, -2.5, -1.5}, Float:{2.5, 2.5, 1.5})
entity_set_vector(rKit, EV_VEC_origin, vOrigin)
entity_set_int(rKit, EV_INT_solid, SOLID_TRIGGER)
entity_set_int(rKit, EV_INT_movetype, MOVETYPE_TOSS)

return PLUGIN_CONTINUE
}
public touch_RevivalKit(ptr, ptd)
{
if(is_user_alive(ptd) && is_valid_ent(ptr))
{
if(!g_HasKit)
{
   g_HasKit = 1
   remove_entity(ptr)
   ReviveIcon(ptd, ICON_SHOW)
   
   client_print(ptd, print_chat, "%s", MSG_PICKEDUP)
   emitsound(ptd, CHAN_ITEM, SOUND_OBTAINKIT)
}
}
}
public cmd_BuyKit(id)
{
new iMoney = cs_get_user_money(id)
new iCost = get_cvar_num("amx_rkit_cost")
new Float:flBuyTime = get_cvar_float("mp_buytime") * 60
if(!is_user_alive(id)) {
client_print(id, print_chat, "Sorry, you have to be alive")
} else if(g_HasKit) {
client_print(id, print_chat, "Sorry, you already have a Revival Kit")
} else if(iMoney < iCost) {
client_print(id, print_chat, "Sorry, you need $%d to buy a Revival Kit", iCost)
} else if(!g_buyzone) {
client_print(id, print_chat, "Sorry, you need to be in the buyzone")
} else if(!g_freezetime && (get_gametime() - g_starttime) > flBuyTime) {
client_print(id, print_chat, "Sorry, you cant buy a Revival Kit anymore")
}
else
{
g_HasKit = 1
ReviveIcon(id, ICON_SHOW)

client_print(id, print_center, MSG_CENTERBUYKIT)
client_cmd(id, "spk %s", SOUND_OBTAINKIT)
client_print(id, print_chat, MSG_BUYKIT)
      cs_set_user_money(id, iMoney - iCost)
   }
return PLUGIN_HANDLED
}
public client_PreThink(id)
{
if(!is_user_connected(id) || !is_user_alive(id)) {
return PLUGIN_CONTINUE
}

if(!g_HasKit) {
return PLUGIN_CONTINUE
}

if(is_user_bot(id))
{
new iOrigin
get_user_origin(id, iOrigin, 0)

new Players, iNum = 0

new rTeam
get_user_team(id, rTeam, 20)
get_players(Players, iNum, "be", rTeam)
for(new i = 0; i < iNum; i++) if(Players != id)
{
   new dead_id = Players
   new Distance = get_distance(iOrigin, g_DeadOrigins)
   if(Distance > REVIVAL_DISTANCE) {
    continue
   }
   entity_set_int(id, EV_INT_button, IN_USE)
}
}
if(get_user_button(id) & IN_USE)
{
if((g_Delay + 3.0) > get_gametime()) {
   return PLUGIN_CONTINUE
}

new iOrigin
get_user_origin(id, iOrigin, 0)

new Players, iNum = 0
#if (REVIVE_TEAM)
   new rTeam
   get_user_team(id, rTeam, 20)
   get_players(Players, iNum, "be", rTeam)
#else
   get_players(Players, iNum, "b")
#endif

for(new i = 0; i < iNum; i++) if(Players != id)
{
   new dead_id = Players
   new Distance = get_distance(iOrigin, g_DeadOrigins)
   if(Distance > REVIVAL_DISTANCE) {
    continue
   }
   
   if(task_exists(TASKID_REVIVE + id)) {
    continue
   }
   
   g_Delay = get_gametime()
   g_OldSpeed = get_user_maxspeed(id)
   g_ReviveSpeed = true
   
   ReviveIcon(id, ICON_FLASH)
   ProgressBar(id, REVIVE_DELAY)
   
   new name
   get_user_name(dead_id, name, 32)
   client_print(id, print_center, "%s %s...", MSG_START, name)
   emitsound(id, CHAN_STATIC, SOUND_STARTING)
   
   new param
   param = id
   param = dead_id
   
   set_task(float(REVIVE_DELAY), "task_Revive", TASKID_REVIVE + id, param, 2)
   set_task(3.0, "task_LoopBoop", TASKID_BOOP + id, param, 1)
}
}
else if(get_user_oldbutton(id) & IN_USE)
{
if(task_exists(TASKID_REVIVE + id))
{
   ProgressBar(id, 0)
   ReviveIcon(id, ICON_SHOW)
   
   g_ReviveSpeed = false
   set_user_maxspeed(id, g_OldSpeed)
   
   remove_task(TASKID_BOOP + id)
   remove_task(TASKID_REVIVE + id)
   
   emitsound(id, CHAN_STATIC, SOUND_CANCELED)
}
}
return PLUGIN_CONTINUE
}
public client_PostThink(id) if(g_ReviveSpeed) {
set_user_maxspeed(id, 1.0)
}
public task_Revive(param[])
{
new reviver = param
new luckybastard = param

if(!is_user_connected(luckybastard) || is_user_alive(luckybastard)
|| get_user_team(luckybastard) > 2)
{
g_ReviveSpeed = false
ReviveIcon(reviver, ICON_SHOW)
set_user_maxspeed(reviver, g_OldSpeed)
remove_task(TASKID_BOOP + reviver)

new name
get_user_name(luckybastard, name, 32)
client_print(reviver, print_chat, "%s %s", MSG_FAILED, name)

return PLUGIN_CONTINUE
}
g_HasKit = 0

new name
get_user_name(luckybastard, name, 32)
client_print(reviver, print_chat, "%s %s, please stand back...", MSG_PATCHING, name)
get_user_origin(reviver, g_ReviveOrigin, 0)

ReviveIcon(reviver, ICON_HIDE)
emitsound(reviver, CHAN_STATIC, SOUND_FINISHED)

g_ReviveSpeed = false
set_user_maxspeed(reviver, g_OldSpeed)
remove_task(TASKID_BOOP + reviver)
client_cmd(luckybastard, "spec_mode 3")

message_begin(MSG_ALL, get_user_msgid("DeathMsg"), {0, 0, 0}, 0)
write_byte(reviver)
write_byte(luckybastard)
write_byte(0)
write_string("revived")
message_end()

spawn(luckybastard)

new iOrigin = {9999, 9999, 9999}
set_user_origin(luckybastard, iOrigin)

//new param2
//param2 = reviver
//param2 = luckybastard

set_task(3.0, "task_Respawn", TASKID_REVIVE2, param, 2)

return PLUGIN_CONTINUE
}
public task_Respawn(param[])
{
new reviver = param
new luckybastard = param

if(!is_user_connected(luckybastard) || get_user_team(luckybastard) > 2)
{
g_HasKit = 1
ReviveIcon(reviver, ICON_SHOW)
user_silentkill(luckybastard)

new name
get_user_name(luckybastard, name, 32)
client_print(reviver, print_chat, "%s %s", MSG_FAILED, name)

return PLUGIN_CONTINUE
}

spawn(luckybastard)

client_cmd(luckybastard, "+duck")
client_cmd(luckybastard, "wait")
client_cmd(luckybastard, "wait")
client_cmd(luckybastard, "wait")
client_cmd(luckybastard, "wait")
client_cmd(luckybastard, "wait")
client_cmd(luckybastard, "-duck")
client_cmd(luckybastard, "wait")

g_ReviveOrigin += 40
set_user_origin(luckybastard, g_ReviveOrigin)

strip_user_weapons(luckybastard)
give_item(luckybastard, "weapon_knife")
set_user_health(luckybastard, get_cvar_num("amx_rkit_health"))
set_score(reviver, luckybastard)
new rName, lbName
get_user_name(reviver, rName, 32)
get_user_name(luckybastard, lbName, 32)
client_print(luckybastard, print_chat, "%s %s", MSG_REVIVEBY, rName)
client_print(reviver, print_chat, "%s %s", MSG_SUCCEED, lbName)

return PLUGIN_CONTINUE
}
public task_LoopBoop(param[])
{
new id = param
emitsound(id, CHAN_STATIC, SOUND_REVIVING)
set_task(1.5, "task_LoopBoop", TASKID_BOOP + id, param, 1)
}
public set_score(reviver, luckybastard)
{
set_user_frags(reviver, get_user_frags(reviver) + REVIVE_POINTS)

message_begin(MSG_ALL, get_user_msgid("ScoreInfo"))
write_byte(reviver)
write_short(get_user_frags(reviver))
write_short(get_user_deaths(reviver))
write_short(0)
write_short(get_user_team(reviver))
message_end()
}
public remove_kits()
{
new rKit = find_ent_by_class(-1, "RevivalKit")
while(rKit)
{
remove_entity(rKit)
rKit = find_ent_by_class(rKit, "RevivalKit")
}
}

stock emitsound(index, chan, sound[]) {
emit_sound(index, chan, sound, VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
}

stock ProgressBar(id, seconds)
{
message_begin(MSG_ONE, get_user_msgid("BarTime"), {0, 0, 0}, id)
write_byte(seconds)
write_byte(0)
message_end()
}

stock ReviveIcon(id, status)
{
message_begin(MSG_ONE, get_user_msgid("StatusIcon"), {0, 0, 0}, id)
write_byte(status)
write_string("item_healthkit")
write_byte(0)
write_byte(160)
write_byte(0)
message_end()
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/

mao0797 发表于 2006-8-26 18:59:16

回复: 请求高手汉化此插件

说一下,这个插件是复活队友(敌人)的插件

急救箱?

mao0797 发表于 2006-8-27 11:18:45

回复: 请求高手汉化此插件

自己弄好了.......麻烦管理员删掉此贴~~
页: [1]
查看完整版本: 请求高手汉化此插件