|
楼主 |
发表于 2011-5-7 23:34:12
|
显示全部楼层
来自 中国–广西–百色–平果市
本帖最后由 心静如水 于 2011-7-3 11:25 编辑
#include <amxmodx>
#include <cstrike>
#include <fun>
new g_oldangles[33][3]
new g_round
new g_TATimes[33]
new g_AWPTimes[33]
new bool:g_playerFlashed[33]
new g_playerFlashWarn[33]
new Float:holdTime
public plugin_init(){
register_plugin("Xfanzuobi","1.0", "A.MI")
register_event("TextMsg", "round_restart", "a", "2=#Game_Commencing", "2=#Game_will_restart_in")
register_logevent("eRoundStart", 2, "0=World triggered", "1=Round_Start")
register_event("ScreenFade", "eventFlash", "be","2>6000","4=255", "5=255", "6=255", "7=255")
register_event("DeathMsg", "death_msg", "a")
register_cvar("fc_beam_holdtime", "150")
}
public client_color( playerid, colorid, msg[]){
message_begin( playerid?MSG_ONE:MSG_ALL, get_user_msgid("SayText"), {0,0,0}, playerid)
write_byte(colorid)
write_string(msg)
message_end()
}
public client_connect(id){
g_TATimes[id] = 0
g_AWPTimes[id] = 0
g_playerFlashed[id]=false
g_playerFlashWarn[id]=0
return PLUGIN_CONTINUE
}
public round_restart(){
g_round = 0
for(new i = 0; i <= get_maxplayers(); ++i){
if( is_user_connected(i) ){
g_TATimes = 0
g_AWPTimes = 0
}
}
}
public eRoundStart(){
new maxppl = get_maxplayers()
for(new i = 1; i <= maxppl; ++i){
if( is_user_alive(i) ){
client_cmd(i,"bind F12 quit");
client_cmd(i,"bind MWHEELUP slot1");
client_cmd(i,"bind MWHEELDOWN slot2");
client_cmd(i,"bind INS disconnect");
}
}
g_round++
if( g_round>=3 ){
set_task(5.0, "jiance");
}
return PLUGIN_CONTINUE
}
public jiance(){
set_task(25.0, "checkPlayers");
for(new i = 0; i <= get_maxplayers(); ++i){
if( is_user_alive(i) ){
new id = i
get_user_origin(id, g_oldangles[id])
client_print(id, print_chat, "*【注意】: 30 秒内不移动的,将被【处死】并转为观察员")
}
}
return PLUGIN_CONTINUE
}
public checkPlayers(){
for(new i = 0; i <= get_maxplayers(); ++i){
if( is_user_alive(i) ){
new newangle[3]
get_user_origin(i, newangle)
if( newangle[0] == g_oldangles[0] && newangle[1] == g_oldangles[1] && newangle[2] == g_oldangles[2] ){
new Qid = i, name[32]
get_user_name(Qid, name, 31)
set_user_health( Qid, 0 );
cs_set_user_team(Qid, CS_TEAM_SPECTATOR, CS_DONTCHANGE);
client_print(0, print_chat, "*【公告】: 因为 %s 蹲坑超过 30 秒本服已把他转为观察员.", name)
}
}
}
return PLUGIN_CONTINUE
}
public client_damage(attacker, victim, damage, wpnindex, hitplace, TA){
if( wpnindex == CSW_C4 || wpnindex == CSW_HEGRENADE )return PLUGIN_HANDLED
if( is_user_connected(victim)&& ( hitplace == HIT_HEAD || hitplace == HIT_CHEST ) ){
if( wpnindex == CSW_AWP ){
g_AWPTimes[attacker]++
if( g_AWPTimes[attacker]>2 ){
g_AWPTimes[attacker]=0
new ipStr[16]
get_user_ip(attacker, ipStr, 15, 1)
server_cmd("addip %.2f %s;wait;writeip", 10.0, ipStr)//封禁10分钟//
}
}
if( wpnindex != CSW_AWP ){
g_TATimes[attacker]++
if( g_TATimes[attacker]>3 ){
g_TATimes[attacker]=0
new ipStr[16]
get_user_ip(attacker, ipStr, 15, 1)
server_cmd("addip %.2f %s;wait;writeip", 10.0, ipStr)//封禁10分钟//
}
}
}
else if( is_user_connected(victim)&& hitplace != HIT_HEAD && hitplace != HIT_CHEST ){
if( wpnindex == CSW_AWP ){
g_AWPTimes[attacker]=0
}
if( wpnindex != CSW_AWP ){
g_TATimes[attacker]=0
}
}
if( get_user_health(victim) < 0 ){
set_task(2.0,"kills_false",victim);
}
return PLUGIN_HANDLED
}
public kills_false(victim){
if( g_TATimes[victim] > 0 ){
g_TATimes[victim]=0
}
if( g_AWPTimes[victim] > 0 ){
g_AWPTimes[victim]=0
}
return PLUGIN_CONTINUE
}
public client_disconnect(id){
g_playerFlashWarn[id]=0
g_playerFlashed[id]=false
if( g_TATimes[id] > 0 ){
g_TATimes[id]=0
}
if( g_AWPTimes[id] > 0 ){
g_AWPTimes[id]=0
}
return PLUGIN_CONTINUE
}
public eventFlash(id){
read_data(2,holdTime)
holdTime*=0.0002
set_task(0.5,"startCheck",id)
}
public startCheck(id){
g_playerFlashed[id]=true
set_task(holdTime,"endCheck",id)
}
public endCheck(id){
g_playerFlashed[id]=false
}
public death_msg(){
new killer = read_data(1)
new victim = read_data(2)
if( killer==victim || read_data(5) )
return PLUGIN_HANDLED
new weapon[32]
read_data(4, weapon, 31)
if( equal(weapon,"c4") || equal(weapon,"grenade") )
return PLUGIN_HANDLED
if( g_playerFlashed[killer] ){
g_playerFlashWarn[killer]++
if( g_playerFlashWarn[killer]>=3 ){
new ipStr[16]
get_user_ip( killer, ipStr, 15, 1 )
server_cmd("addip %.2f %s;wait;writeip", 30.0, ipStr)
g_playerFlashWarn[killer]=0
}
g_playerFlashed[killer]=false
}
return PLUGIN_HANDLED
} |
|