|
楼主 |
发表于 2011-6-27 22:02:16
|
显示全部楼层
来自 中国–四川–凉山彝族自治州
- //----------------------------Bonus----------------------------------------------
- public fn_parse_cvar(p_cvar, &arg1, &arg2){
- new str_cvar[32], str_arg1[16], str_arg2[16]
-
- get_pcvar_string(p_cvar,str_cvar,32)
-
- parse(str_cvar,str_arg1,16,str_arg2,16)
- arg1 = str_to_num(str_arg1)
- if(strlen(str_arg2))
- arg2 = str_to_num(str_arg2)
- else
- arg2 = 1
-
- }
- public bomb_planted(planter){ //CSX native function...
-
- new bonus, chatmsg
-
- fn_parse_cvar(amx_bonus_planter,bonus,chatmsg)
-
- if(!bonus)
- return PLUGIN_HANDLED
-
- fn_add_player_money(planter,bonus)
-
-
-
- new name[32+2], s_bonus[8], msg[256]
- get_user_name(planter,name,31)
- format(name,33,"^x03%s^x01",name)
- format(s_bonus,7,"^x04%d^x01",bonus)
-
- new i,players[32],player_num
- get_players(players,player_num)
-
-
- if(chatmsg){
- for(i=0;i<player_num;i++){
- format(msg,255,"^x01%s :: %L",g_tag,players[i],"BOMB_PLANTED",name,s_bonus)
- fn_colorprint(players[i],planter,msg)
- }
- }
- return PLUGIN_CONTINUE
- }
- public bomb_defused(defuser){ //CSX native function...
-
- new bonus, chatmsg
-
- fn_parse_cvar(amx_bonus_defuser,bonus,chatmsg)
-
- if(!bonus)
- return PLUGIN_HANDLED
-
- fn_add_player_money(defuser,bonus)
-
- new name[32+2], s_bonus[8], msg[256]
- get_user_name(defuser,name,31)
- format(name,33,"^x03%s^x01",name)
- format(s_bonus,7,"^x04%d^x01",bonus)
-
- new i,players[32],player_num
- get_players(players,player_num)
-
- if(chatmsg){
- for(i=0;i<player_num;i++){
- format(msg,255,"^x01%s :: %L",g_tag,players[i],"BOMB_DEFUSED",name,s_bonus)
- fn_colorprint(players[i],defuser,msg)
- }
- }
- return PLUGIN_CONTINUE
- }
- public bomb_explode(planter){ //CSX native function...
-
- new bonus, chatmsg
-
- fn_parse_cvar(amx_bonus_explode,bonus,chatmsg)
-
- if(!bonus)
- return PLUGIN_HANDLED
-
- fn_add_player_money(planter,bonus)
-
- new name[32+2], s_bonus[8], msg[256]
- get_user_name(planter,name,31)
- format(name,33,"^x03%s^x01",name)
- format(s_bonus,7,"^x04%d^x01",bonus)
-
- new i,players[32],player_num
- get_players(players,player_num)
-
- if(chatmsg){
- for(i=0;i<player_num;i++){
- format(msg,255,"^x01%s :: %L",g_tag,players[i],"BOMB_EXPLODE",name,s_bonus)
- fn_colorprint(players[i],planter,msg)
- }
- }
- return PLUGIN_CONTINUE
- }
- public client_death(killer,victim,wpnindex,hitplace,TK){ //CSX native function...
-
- if(TK || killer == victim)
- return PLUGIN_HANDLED
-
- new i,players[32],player_num
- get_players(players,player_num)
-
- new name[32+2], s_bonus[8], msg[256]
-
- new bonus=0
-
- get_user_name(killer,name,31)
-
- format(name,33,"^x03%s^x01",name)
-
-
- new hs_bonus, hs_msg
- new o4_bonus, o4_msg
- new kf_bonus, kf_msg
- new r1_bonus, r1_msg
- new r2_bonus, r2_msg
- new r3_bonus, r3_msg
-
- fn_parse_cvar(amx_bonus_headshot,hs_bonus,hs_msg)
- fn_parse_cvar(amx_bonus_o4killer,o4_bonus,o4_msg)
- fn_parse_cvar(amx_bonus_9fkiller,kf_bonus,kf_msg)
- fn_parse_cvar(amx_bonus_1stkiller,r1_bonus,r1_msg)
- fn_parse_cvar(amx_bonus_2ndkiller,r2_bonus,r2_msg)
- fn_parse_cvar(amx_bonus_3rdkiller,r3_bonus,r3_msg)
-
-
- if(hs_bonus && hitplace==HIT_HEAD){
- bonus += hs_bonus
- format(s_bonus,7,"^x04%d^x01", hs_bonus)
-
- if(hs_msg){
- for(i=0;i<player_num;i++){
- format(msg,255,"^x01%s :: %L",g_tag,players[i],"HEAD_SHOT",name,s_bonus)
- fn_colorprint(players[i],killer,msg)
- }
- }
- }
-
- if(o4_bonus && wpnindex==CSW_HEGRENADE){
- bonus += o4_bonus
- format(s_bonus,7,"^x04%d^x01",o4_bonus)
-
- if(o4_msg){
- for(i=0;i<player_num;i++){
- format(msg,255,"^x01%s :: %L",g_tag,players[i],"GRENADE_KILL",name,s_bonus)
- fn_colorprint(players[i],killer,msg)
- }
- }
- }
-
-
- if(kf_bonus && wpnindex==CSW_KNIFE){
- bonus += kf_bonus
- format(s_bonus,7,"^x04%d^x01",get_pcvar_num(amx_bonus_9fkiller))
-
- if(kf_msg){
- for(i=0;i<player_num;i++){
- format(msg,255,"^x01%s :: %L",g_tag,players[i],"KNIFE_KILL",name,s_bonus)
- fn_colorprint(players[i],killer,msg)
- }
- }
- }
-
- new rk_bonus
-
- if(r1_bonus && g_rankcounter<3){
-
- switch(g_rankcounter){
- case 0:rk_bonus = r1_bonus
- case 1:rk_bonus = r2_bonus
- case 2:rk_bonus = r3_bonus
- }
-
- bonus += rk_bonus
- format(s_bonus,7,"^x04%d^x01",rk_bonus)
-
- if(r1_msg){
-
- for(i=0;i<player_num;i++){
- format(msg,255,"^x01%s :: %L",g_tag,players[i],"RUSH_KILL",name,g_rankcounter+1,s_bonus)
- fn_colorprint(players[i],killer,msg)
- }
- }
- }
- fn_add_player_money(killer,bonus)
-
- g_rankcounter++
-
- return PLUGIN_CONTINUE
- }
- public fn_colorprint(playerid, colorid, msg[]){ //the code from google...Thanks the origin author.
-
- message_begin(playerid?MSG_ONE_UNRELIABLE:MSG_ALL,g_saytext_msgid,_,playerid)
- write_byte(colorid)
- write_string(msg)
- message_end()
- }
- public client_disconnect(id){
- g_client_money[id] = 0
- }
复制代码 |
|