|
发表于 2010-10-25 13:15:26
|
显示全部楼层
|阅读模式
来自 中国–广西–百色
本帖最后由 心静如水 于 2010-10-25 20:09 编辑
默认25秒不杀人或不放C4就结束本局
#include <amxmodx>
#include <csx>
new g_kelitimer
new bool:Tkelited = false;
new bool:CTkelited = false;
new bool:FC4_timed = false;
new kelimans[33]
public plugin_init(){
register_plugin("keliTimer","0.2","A.MI");
//g_kelitimer = get_cvar_pointer("mp_kelitimer");
register_logevent("newRound", 2, "1=Round_Start");
register_logevent("endRound", 2, "1=Round_End");
register_event("DeathMsg", "MANdeath", "a")
}
public client_connect(id){
kelimans[id]=0
}
public client_disconnect(id){
kelimans[id]=0
}
public MANdeath(){
if(get_playersnum(0)<4) return PLUGIN_HANDLED
if( Tkelited || CTkelited ) return PLUGIN_HANDLED
new Tnum=0,CTnum=0
new playerlist[32],num
get_players(playerlist,num,"a")
for(new i=0;i<num;i++)
{
new team=get_user_team(playerlist)
if(team==1)
++Tnum
else
++CTnum
}
log_amx("T is %d,CT is %d",Tnum,CTnum)
if( Tnum==1 ){
set_task(1.0, "dispTime", 652450, "", 0, "b");
Tkelited = true
return PLUGIN_HANDLED
}
if( CTnum==1 ){
set_task(1.0, "dispTime", 652450, "", 0, "b");
CTkelited = true
return PLUGIN_HANDLED
}
return PLUGIN_HANDLED
}
public dispTime(){
if( FC4_timed && Tkelited ){
remove_task(652450);
return PLUGIN_HANDLED
}
if(g_kelitimer > 25){
if(Tkelited){
keliddd();
}
if(CTkelited){
keliccc();
}
}
g_kelitimer++
return PLUGIN_CONTINUE
}
public keliddd(){
for(new i=0; i<= get_maxplayers(); ++i){
if(is_user_alive(i)&& get_user_team(i)==1){
kelimans=1
user_kill(i, 0)
}
}
client_print(0,print_chat,"*【惩罚怕死鬼】: 大家等太久了,提前结束本局时间!");
return PLUGIN_HANDLED
}
public keliccc(){
for(new i=0; i<= get_maxplayers(); ++i){
if(is_user_alive(i)&& get_user_team(i)==2){
kelimans=1
user_kill(i, 0)
}
}
client_print(0,print_chat,"*【惩罚怕死鬼】: 大家等太久了,提前结束本局时间!");
return PLUGIN_HANDLED
}
public newRound(){
remove_task(652450);
Tkelited = false
CTkelited = false
kelimmm();
}
public kelimmm(){
for(new i=0; i<= get_maxplayers(); ++i){
if(is_user_alive(i)&& get_user_team(i)==1){
kelimans=0
}
if(is_user_alive(i)&& get_user_team(i)==2){
kelimans=0
}
}
return PLUGIN_HANDLED
}
public bomb_planted(planter){
if( Tkelited || CTkelited ){
remove_task(652450);
}
FC4_timed = true
}
public bomb_defused(){
if( Tkelited || CTkelited ){
remove_task(652450);
}
}
public bomb_explode(){
if( Tkelited || CTkelited ){
remove_task(652450);
}
}
public endRound(){
remove_task(652450);
FC4_timed = false
if( g_kelitimer > 0 ){
g_kelitimer = 0
}
} |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注个册吧
×
|