- 听众
- 收听
- 积分
- 29
- 主题
- 回帖
- 0
- 精华
注册时间2009-3-20
最后登录1970-1-1
该用户从未签到
|
我用翻译翻译的很不准确
请高人帮忙翻译,在线等
/*
* Title: Repair Damage
* Author: v3x & FoX Rider
* Created: March 11th, 2005
*
* Desc: Allows you to "repair" lost damage
* by taking a certain amount of cash
* out depending on your condition
*
*
*
* Cvars:
* repair_active <1|0> (default 1)
* _Activate the plugin
* -------------------------------
* repair_armor <1|0> (default 1)
* _Repair armor also
* -------------------------------
* repair_msg <1|0> (default 1)
* _Show the message @ round start
*
*
* Commands: say /hp
* say_team /hp
*
*
*
* To do:
* Add a limit for repairs
*
*
* Credits: Fox Rider for the idea
*
*
*/
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
public plugin_init() {
register_plugin("Repair Damage","0.1","v3x & FoX Rider")
register_concmd("say /hp","doRepair")
register_concmd("say_team /hp","doRepair")
register_cvar("repair_active","1")
register_cvar("repair_armor","1")
register_cvar("repair_msg","1")
register_logevent("sayMsg",2,"0=World triggered","1=Round_Start")
}
public doRepair(id) {
if(get_cvar_num("repair_active") == 0) {
return PLUGIN_HANDLED
}
new hp = get_user_health(id)
new cost
// If there's a better way to do this, please tell me!
if(hp <= 10) {
cost = 5000
}
else if(hp <= 20) {
cost = 4500
}
else if(hp <= 30) {
cost = 4000
}
else if(hp <= 40) {
cost = 3500
}
else if(hp <= 50) {
cost = 3000
}
else if(hp <= 60) {
cost = 2500
}
else if(hp <= 70) {
cost = 2000
}
else if(hp <= 80) {
cost = 1500
}
else if(hp <= 90) {
cost = 1000
}
else if(hp <= 99) {
cost = 250
}
else if(hp == 100) {
cost = 0
}
new Money = cs_get_user_money(id)
if(Money < cost) {
client_print(id,print_chat,"[AMXX]: You don't have enough money for that repair!")
return PLUGIN_HANDLED
}
if(Money >= cost) {
if(get_cvar_num("repair_armor") == 1) {
set_user_armor(id,100)
}
new newMoney = cs_get_user_money(id) - cost
cs_set_user_money(id,newMoney,1)
set_user_health(id,100)
client_print(id,print_chat,"[AMXX]: Repair bought for $%d",cost)
return PLUGIN_HANDLED
}
return PLUGIN_HANDLED
}
public sayMsg() {
if(get_cvar_num("repair_msg") == 0) {
return PLUGIN_HANDLED
}
client_print(0,print_chat,"[AMXX]: To repair yourself, type /repair in chat")
return PLUGIN_HANDLED
} |
|