|
楼主 |
发表于 2005-12-31 12:09:49
|
显示全部楼层
来自 中国–云南–西双版纳傣族自治州–景洪市
回复: 求助请问这个字是靠哪个插件实现的
你以为老子是你啊,什么事情都等别人帮你是永远得不到的。老子自己解决了
/*
* AMXMOD script.
* (plugin_bonus.sma)
* by mike_cao <mike@mikecao.com>
* This file is provided as is (no warranties).
*
*/
#include <amxmod>
#define MAX_NAME_LENGTH 32
#define MAX_TEXT_LENGTH 512
#define ACCESS_LEVEL ADMIN_LEVEL_A
// Default on/off
new gBonusMode = 1
new gBonusCount = 0
new gBonusIndex[5] = { 50,40,30,20,10 }
public admin_bonuskill(id)
{
// Check access level
if (!(get_user_flags(id)&ACCESS_LEVEL)) {
console_print(id,"[AMX] You have no access to that command")
return PLUGIN_HANDLED
}
// Check arguments
if (read_argc() < 2) {
console_print(id,"[AMX] Usage: amx_bonuskill < 1 | 0 >")
return PLUGIN_HANDLED
}
new sArg1[MAX_NAME_LENGTH]
read_argv(1,sArg1,MAX_NAME_LENGTH)
if (str_to_num(sArg1)) {
gBonusMode = 1
client_print(id,print_console,"[AMX] Bonus health for kills is now ON.")
}
else {
gBonusMode = 0
client_print(id,print_console,"[AMX] Bonus health for kills is now OFF.")
}
return PLUGIN_HANDLED
}
public event_death()
{
if (gBonusMode) {
new iKiller = read_data(1)
new iVictim = read_data(2)
new sMsg[MAX_TEXT_LENGTH]
new sName[MAX_NAME_LENGTH]
get_user_name(iKiller,sName,MAX_NAME_LENGTH)
if ((iKiller != iVictim) && (gBonusCount < sizeof gBonusIndex) && (get_user_team(iKiller) != get_user_team(iVictim))) {
gBonusCount++
set_user_health(iKiller,get_user_health(iKiller)+gBonusIndex[gBonusCount-1])
if (gBonusCount == 1) {
format(sMsg,MAX_TEXT_LENGTH,"%s got the 1st kill! (+%i health)",sName,gBonusIndex[gBonusCount-1])
}
else if (gBonusCount == 2) {
format(sMsg,MAX_TEXT_LENGTH,"%s got the 2nd kill! (+%i health)",sName,gBonusIndex[gBonusCount-1])
}
else if (gBonusCount == 3) {
format(sMsg,MAX_TEXT_LENGTH,"%s got the 3rd kill! (+%i health)",sName,gBonusIndex[gBonusCount-1])
}
else {
format(sMsg,MAX_TEXT_LENGTH,"%s got the %ith kill! (+%i health)",sName,gBonusCount,gBonusIndex[gBonusCount-1])
}
display_msg(sMsg,200,200,200)
}
}
return PLUGIN_CONTINUE
}
public event_round_end() {
gBonusCount = 0
}
public display_msg(msg[],r,g,b)
{
set_hudmessage(r,g,b,-1.0,0.40,0,6.0,6.0,0.5,0.15,2)
show_hudmessage(0,msg)
}
/************************************************************
* PLUGIN FUNCTIONS
************************************************************/
public plugin_init()
{
register_plugin("Plugin Health Bonus","1.0","mike_cao")
register_event("DeathMsg","event_death","a")
register_event("SendAudio","event_round_end","a","2&%!MRAD_terwin","2&%!MRAD_ctwin","2&%!MRAD_rounddraw")
register_concmd("amx_bonuskill","admin_bonuskill",ACCESS_LEVEL,"amx_powers < authid | part of nick >")
}
这几个地方就是我要修改的效果
format(sMsg,MAX_TEXT_LENGTH,"%s got the 1st kill! (+%i health)",sName,gBonusIndex[gBonusCount-1])
}
else if (gBonusCount == 2) {
format(sMsg,MAX_TEXT_LENGTH,"%s got the 2nd kill! (+%i health)",sName,gBonusIndex[gBonusCount-1])
}
else if (gBonusCount == 3) {
format(sMsg,MAX_TEXT_LENGTH,"%s got the 3rd kill! (+%i health)",sName,gBonusIndex[gBonusCount-1])
}
else {
format(sMsg,MAX_TEXT_LENGTH,"%s got the %ith kill! (+%i health)",sName,gBonusCount,gBonusIndex[gBonusCount-1]) :rolleyes: :boss: |
|