搜索
查看: 1900|回复: 2

请求高手汉化此插件

[复制链接]
发表于 2006-8-26 18:58:08 | 显示全部楼层 |阅读模式 来自 中国–广西–崇左–凭祥市
请问谁可以帮我汉化一下这个插件?????
我修改后另存为UTF-8后编译失败:sweat:


#define RKIT_COST  1000 //成本
#define RKIT_HEALTH  60 //复活成功后有多少血值
#define REVIVE_TEAM  0 //是否可以复活敌人默认1(关闭)
#define REVIVE_POINTS  2 //复活队友奖励分数
#define REVIVE_DELAY  7 //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[21]
new g_freezetime
new Float:g_starttime
new g_restarting
new Float:g_Delay[33]
new g_HasKit[33]
new g_buyzone[33]
new g_ReviveSpeed[33]
new Float:g_OldSpeed[33]
new g_DeadOrigins[33][3]
new g_ReviveOrigin[33][3]
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[id])
{
  ReviveIcon(id, ICON_SHOW)
  g_ReviveSpeed[id] = false
  set_user_maxspeed(id, g_OldSpeed[id])
  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[32], iNum = 0
get_players(Players, iNum)
for(new i = 0; i < iNum; i++)
{
  new id = Players
  set_user_maxspeed(id, g_OldSpeed[id])
  if(g_restarting)
  {
   g_HasKit[id] = 0
   g_ReviveSpeed[id] = 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[id] = read_data(1)
}
public LogEvent_RoundStart()
{
g_freezetime = 0
g_starttime = get_gametime()
set_task(1.0, "task_botbuy")
}
public task_botbuy()
{
new Players[32], iNum
get_players(Players, iNum, "ad")
for(new i = 0; i < iNum; ++i) if(!g_HasKit[Players])
{
  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[victim])
{
  ReviveIcon(victim, ICON_HIDE)
  ProgressBar(victim, 0)
  
  set_user_maxspeed(victim, g_OldSpeed[victim])
  g_ReviveSpeed[victim] = false
  g_HasKit[victim] = 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[victim])
{
  ReviveIcon(victim, ICON_HIDE)
  ProgressBar(victim, 0)
  
  set_user_maxspeed(victim, g_OldSpeed[victim])
  g_ReviveSpeed[victim] = false
  g_HasKit[victim] = 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[id], 0)
}
}

public drop_kit(id)
{
new Float:flVelocity[3]
VelocityByAim(id, 64, flVelocity)
  
new Float:vOrigin[3]
entity_get_vector(id, EV_VEC_origin, vOrigin)
vOrigin[0] += flVelocity[0]
vOrigin[1] += flVelocity[1]
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[ptd])
  {
   g_HasKit[ptd] = 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[id]) {
  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[id]) {
  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[id] = 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[id]) {
  return PLUGIN_CONTINUE
}

if(is_user_bot(id))
{
  new iOrigin[3]
  get_user_origin(id, iOrigin, 0)
  
  new Players[32], iNum = 0
  
  new rTeam[21]
  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[dead_id])
   if(Distance > REVIVAL_DISTANCE) {
    continue
   }
   entity_set_int(id, EV_INT_button, IN_USE)
  }
}
if(get_user_button(id) & IN_USE)
{
  if((g_Delay[id] + 3.0) > get_gametime()) {
   return PLUGIN_CONTINUE
  }

  new iOrigin[3]
  get_user_origin(id, iOrigin, 0)
  
  new Players[32], iNum = 0
  #if (REVIVE_TEAM)
   new rTeam[21]
   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[dead_id])
   if(Distance > REVIVAL_DISTANCE) {
    continue
   }
   
   if(task_exists(TASKID_REVIVE + id)) {
    continue
   }
   
   g_Delay[id] = get_gametime()
   g_OldSpeed[id] = get_user_maxspeed(id)
   g_ReviveSpeed[id] = true
   
   ReviveIcon(id, ICON_FLASH)
   ProgressBar(id, REVIVE_DELAY)
   
   new name[33]
   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[2]
   param[0] = id
   param[1] = 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[id] = false
   set_user_maxspeed(id, g_OldSpeed[id])
   
   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[id]) {
set_user_maxspeed(id, 1.0)
}
public task_Revive(param[])
{
new reviver = param[0]
new luckybastard = param[1]

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

  new name[33]
  get_user_name(luckybastard, name, 32)
  client_print(reviver, print_chat, "%s %s", MSG_FAILED, name)
  
  return PLUGIN_CONTINUE
}
g_HasKit[reviver] = 0

new name[33]
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[reviver], 0)

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

g_ReviveSpeed[reviver] = false
set_user_maxspeed(reviver, g_OldSpeed[reviver])
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[3] = {9999, 9999, 9999}
set_user_origin(luckybastard, iOrigin)
  
//new param2[2]
//param2[0] = reviver
//param2[1] = luckybastard

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

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

if(!is_user_connected(luckybastard) || get_user_team(luckybastard) > 2)
{
  g_HasKit[reviver] = 1
  ReviveIcon(reviver, ICON_SHOW)
  user_silentkill(luckybastard)
  
  new name[33]
  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[reviver][2] += 40
set_user_origin(luckybastard, g_ReviveOrigin[reviver])

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[33], lbName[33]
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[0]
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 }
*/
 楼主| 发表于 2006-8-26 18:59:16 | 显示全部楼层 来自 中国–广西–崇左–凭祥市

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

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

急救箱?
回复

使用道具 举报

 楼主| 发表于 2006-8-27 11:18:45 | 显示全部楼层 来自 中国–广西–崇左–凭祥市

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

自己弄好了.......麻烦管理员删掉此贴~~
回复

使用道具 举报

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

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