|
发表于 2004-5-18 14:39:13
|
显示全部楼层
来自 中国–河南–安阳
Post by kindzhon
没有下载的地方啊。我也要SMA
/*
* 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>2000)){
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)
}
}
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)
}
}
}
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
} |
|