|
发表于 2006-5-3 14:31:14
|
显示全部楼层
来自 中国–江苏–南京
回复: [求助]修改埋包奖励
Post by tianyuxuan
高手来帮忙啊。。
自己先顶下。。。
/*
* BombAwards version 0.1.3 Date:05/21/2003
*
* (c) Copyright 2003, Coolzsb@21cn.com
*/
/* cvar:
* amx_bomb_awards < flags > default is a
* "a" - hp awards
* "b" - frags awards
* "c" - money awards
* "d" - to be added
* "e" - to be added
* "f" - to be added
* "g" - to be added
* "h" - to be added
* amx_bombawards_hp <hp to be award> default is 50
* amx_bombawards_frags <frags to be award> default is 3
* amx_bombawards_money <money to be award> default is 500
*/
#include <amxmod>
new planter
new realplanter=0
new realplanterid
new ifbombed=2
new defuser
new realdefuser
new realdefuserid
new awardshp
new awardsfrags
new awardsmoney
public get_awardmode() {
new awardmode[10]
get_cvar_string("amx_bomb_awards",awardmode,10)
awardshp=get_cvar_num("amx_bombawards_hp")
if ((awardshp<0 )||(awardshp>155)){
awardshp=50
}
awardsfrags=get_cvar_num("amx_bombawards_frags")
if ((awardsfrags<0 )||(awardsfrags>5)){
awardsfrags=3
}
awardsmoney=get_cvar_num("amx_bombawards_money")
if ((awardsmoney<0)||(awardsmoney>5000)){
awardsmoney=500
}
return read_flags(awardmode)
}
public got_bomb(id){
planter = id
defuser = 0
}
public bdef_g(id){
if (!(read_data(1) == 3)){
defuser = id
}
}
public bomb_planted(){
new awardmode = get_awardmode()
realplanter=planter
ifbombed=2
if (awardmode&1){
if (get_user_health(realplanter)<100){
set_user_health(realplanter,get_user_health(realplanter)+awardshp)
}
else{
set_user_health(realplanter,100+awardshp)
}
realplanterid=get_user_userid(realplanter)
}
if (awardmode&4){
if ((get_user_money(realplanter)+awardsmoney)<16000){
set_user_money(realplanter,get_user_money(realplanter)+awardsmoney)
}
else{
set_user_money(realplanter,16000)
}
new name [32]
get_user_name(realplanter,name,31)
set_hudmessage(200, 50, 0, -1.0, 0.30, 0, 6.0, 6.0, 0.5, 0.15, 1)
show_hudmessage(0,"%s Has Been Given $%d due to Planting the Bomb",name,awardsmoney)
}
}
public bomb_defused(){
new awardmode = get_awardmode()
realdefuser=defuser
ifbombed=0
if (awardmode&1){
if (get_user_health(realdefuser)<100){
set_user_health(realdefuser,get_user_health(realdefuser)+awardshp)
}
else{
set_user_health(realdefuser,100+awardshp)
}
realdefuserid=get_user_userid(realdefuser)
}
if (awardmode&2){
set_user_frags(realdefuser,get_user_frags(realdefuser)+awardsfrags)
set_user_frags(realplanter,get_user_frags(realplanter)-awardsfrags)
}
if (awardmode&4){
// set_user_money(realplanter,get_user_money(realplanter)-awardsmoney)
if ((get_user_money(realdefuser)+awardsmoney)<16000){
set_user_money(realdefuser,get_user_money(realdefuser)+awardsmoney)
}
else{
set_user_money(realdefuser,16000)
}
new name [32]
get_user_name(realdefuser,name,31)
set_hudmessage(200, 50, 0, -1.0, 0.30, 0, 6.0, 6.0, 0.5, 0.15, 1)
show_hudmessage(0,"%s Has Been Given $%d due to Defusing the Bomb",name,awardsmoney)
}
}
public Target_Bombed(){
new awardmode = get_awardmode()
ifbombed=1
if (awardmode&2){
set_user_frags(realplanter,get_user_frags(realplanter)+awardsfrags)
}
//if (awardmode&4){
//if ((get_user_money(realplanter)+awardsmoney)<16000){
//set_user_money(realplanter,get_user_money(realplanter)+awardsmoney)
//}
//else{
//set_user_money(realplanter,16000)
//}
//}
}
public restartround(){
realplanter=0
realdefuser=0
}
public round_start(){
new awardmode = get_awardmode()
if (awardmode&1){
new team_name[2]
if (get_user_userid(realplanter)==realplanterid){
get_user_team(realplanter,team_name,1)
if (team_name[0] == 'T') {
switch (ifbombed){
//case 1: set_user_health(realplanter,100+awardshp) //I think this must be unfair to CT
case 0: set_user_health(realplanter,100-awardshp)
}
}
}
if (get_user_userid(realdefuser)==realdefuserid){
get_user_team(realdefuser,team_name,1)
if (team_name[0] == 'C') {
set_user_health(realdefuser,100+awardshp)
}
}
}
}
public plugin_init(){
register_plugin("Bomb Awards","0.1.3","Coolzsb")
register_event("StatusIcon", "got_bomb", "be", "1=1", "1=2", "2=c4")
register_event("SendAudio", "bomb_planted", "a", "2&%!MRAD_BOMBPL")
register_event("SendAudio", "bomb_defused", "a", "2&%!MRAD_BOMBDEF")
register_event("TextMsg", "Target_Bombed", "a", "2&#Target_Bombed")
register_event("TextMsg","restartround","a","2&#Game_will_restart_in")
register_event("BarTime", "bdef_g", "be", "1=10", "1=5","1=3")
register_event("ResetHUD", "round_start", "be")
register_cvar("amx_bomb_awards","abc")
register_cvar("amx_bombawards_hp","50")
register_cvar("amx_bombawards_frags","3")
register_cvar("amx_bombawards_money","500")
return PLUGIN_CONTINUE
}
在amx.cfg里设置
amx_bomb_awards c (只奖励钱,不奖生命值和frag)
amx_bombawards_money 4000 (不要超过5000,否则会被改回500)
要想显示中文就自己改代码吧,我只在amx099+cs1.5下试过,算不上高手,不知道执行效率如何 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注个册吧
×
|