|
发表于 2007-6-3 21:22:58
|
显示全部楼层
来自 中国–浙江–嘉兴–海宁市
回复: 大家看看这是哪个插件
Post by landyhsu
say: menu那是玩家菜单命令,服务器只是把amx_pcheater_list命令用:
"惩罚作弊者" "amx_pcheater_list"
方式写入了:.\cstrike\addons\amxmodx\configs\plmenu.ini 文件而已,这样你用say: menu就能出现图中所显示的功能了。
[PHP]/***********************************
惩罚作弊者娱乐插件.
管理员命令:
amx_pcheater <authid, nick, or #userid> <times>
例如:amx_pcheater #23 6 惩罚userid为23的玩家6局
amx_pcheater_stop <在下一局停止所有的惩罚>
amx_tele <authid, nick, or #userid> <teleport cheater to the round of random enemy>
amx_fly <authid, nick, or #userid> <? round>
功能开关 <1 开 | 0 关>
amx_pcheater_enable 1 <打开或关闭惩罚插件>
<1 开 | 0 关>
amx_pcheater_bind 0 <修改作弊者的键盘设置开关,请慎重打开)>
<1 开 | 0 关>
amx_pcheater_kick 0 <1 开 | 0 关>
<打开则玩家被惩罚次数超过MAXPUNISHTIMES设定值将被踢出>
amx_pcheater_vote_rate 0.6 <投票成功比例>
amx_pcheater_vote 1 <打开投票>
amx_pcheater_fly 1 <解除作弊玩家的武装,并送他上天>
amx_pcheater_givemoney 5000 <作弊玩家传送时,谁杀死他将获得的奖金金额>
amx_pcheater_takemoney 5000 <不参与投票将被扣除的金额>
amx_pcheater_vote_money 5000 <每次发起投票所需要的金额,以防止乱投票>
================
客户端命令:
say /vote_cheater <客户端发起投票>
************************************/
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>
//---------------------------vote--------------------------
#define KEY1 (1<<0)
#define KEY2 (1<<1)
#define KEY3 (1<<2)
#define KEY4 (1<<3)
#define KEY5 (1<<4)
#define KEY6 (1<<5)
#define KEY7 (1<<6)
#define KEY8 (1<<7)
#define KEY9 (1<<8)
#define KEY0 (1<<9)
#define MENUTIME 15 //menu display time
#define MAXVOTETIMES 1 //max time of vote every round
#define MAXPUNISHTIMES 2 //max time of punish
#define MAXREVOTETIMES 1 //max time of revote
new page[33] = { 1, ...}
new choices[33][9][33]
new target[33][33]
new bool:voting
new count_y
new count_n
new count_p
new revote
new votetimes
new bool:counted[33]
new roundsay[5][]={"第一滴血","佛光谱照","血雨腥风","五雷轰顶","天外飞仙"}
//-----------------------------------------------------------
new bool:player_flag[33]
new punish_count[33]
new cheater_count=0
new ip_str[15]
new ip[32][15]
new oldname[32]
new uid
new count
new newname[32]
new ip_name[33][32]
new roundcount=0
new punishtimes[33]
new bool:teleportplayer[33]
new bool:playerfly[33]
new cheatername[33][32]
new index
new players[32], num
new fly_count[33]
public plugin_init()
{
register_plugin("cheating punish","1.1", "Enigmaya")
register_concmd("amx_pcheater", "admin_pcheater",ADMIN_LEVEL_A,"<authid, nick, or #userid> <? round>")
register_concmd("amx_pcheater_stop","admin_stop",ADMIN_LEVEL_A,"stop all of the punish at next round")
register_cvar("amx_pcheater_enable", "1")
register_logevent("roundstart", 2, "0=World triggered", "1=Round_Start")
register_cvar("amx_pcheater_bind", "1")
register_cvar("amx_pcheater_kick","0")
//----------------teleport--------------
register_concmd("amx_tele","admin_tele",ADMIN_LEVEL_A,"<authid, nick, or #userid>")
//---------------fly-------------------
register_concmd("amx_fly","admin_fly",ADMIN_LEVEL_A,"<authid, nick, or #userid> <? round>")
register_cvar("amx_pcheater_fly","1")
//----------------deathmsg--------------
register_event("DeathMsg", "hook_death", "a","1>0")
register_cvar("amx_pcheater_givemoney","5000")
//----------------vote------------------
register_menucmd(register_menuid("Punish cheater?"), KEY7|KEY8|KEY9, "votecount")
register_menucmd(register_menuid("who is cheater?"), KEY1|KEY2|KEY3|KEY4|KEY5|KEY6|KEY7|KEY8|KEY9|KEY0, "choosewho")
register_clcmd("say /vote_cheater", "before_vote")
register_cvar("amx_pcheater_vote", "1")
register_cvar("amx_pcheater_takemoney","3000")
register_cvar("amx_pcheater_vote_rate", "0.6")
register_cvar("amx_pcheater_vote_money", "5000")
}
//-----------------------------connect or disconnect----------------------------------------
public client_connect(id)
{
if(!is_user_bot(id) && get_cvar_num("amx_pcheater_enable"))
{
get_user_ip ( id, ip_str, 15, 1 )
uid=get_user_userid(id)
for (new i=0; i<32; i++)
{
if( equali(ip,ip_str) )
{
set_hudmessage ( 200, 100, 0, 0.5, 0.8, 0, 0.02, 5.0, 0.01, 0.2, 2 )
get_user_info(id,"name",newname,31)
// show_hudmessage ( 0, "%s ( %s ) is coming again. newname is %s^" ",ip_name,ip_str,newname)
show_hudmessage ( 0, "玩家 %s ( %s ) 再次进入. 新名字是 %s^" ",ip_name,ip_str,newname)
player_flag[id]=true
teleportplayer[id]=false
punish_count[id]=0
return PLUGIN_HANDLED
}
}
punishtimes[id]=0
teleportplayer[id]=false
playerfly[id]=false
player_flag[id]=false
fly_count[id]=0
}
return PLUGIN_HANDLED
}
public client_disconnect(id)
{
if(player_flag[id] || playerfly[id])
{
get_user_ip ( id, ip_str, 15, 1 )
copy(ip[id],15,ip_str)
get_user_info(id,"name",oldname,31)
copy(ip_name[id],32,oldname)
--cheater_count
}
}
//----------------------admin enable or disable plugin------------------------------------
public admin_stop(id, level, cid)
{
if ( !cmd_access(id, level, cid, 1) )
return PLUGIN_HANDLED
if( get_cvar_num("amx_pcheater_enable") )
{
get_players(players, num)
for(new i=0;i<num;i++)
{
if( player_flag[ players ] )
{
player_flag[ players ]=false
client_cmd(players,"name ^"%s^" ",cheatername[ players ] )
}
if( teleportplayer[ players ] )
{
new origin[3]
get_user_origin(players,origin)
origin[2]+=50
set_user_origin(players,origin)
teleportplayer[ players ]=false
set_user_rendering(players, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 255)
remove_task(56789,0)
}
if( playerfly[ players] )
{
fly_count[ players ]=0
set_user_rendering(players, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 255)
playerfly[players]=false
}
}
//client_print(0,print_chat,"[CSCP] All of the punish will stop at next round!")
client_print(0,print_chat,"[CSCP] 所有的惩罚将在下局停止!")
}
return PLUGIN_HANDLED
}
//----------------------------admin start punish----------------------------------------
public admin_pcheater(id, level, cid)
{
if ( !cmd_access(id, level, cid, 3) )
return PLUGIN_HANDLED
new Arg1[32]
new Arg2[4]
read_argv(1, Arg1, 31)
read_argv(2, Arg2, 3)
count = str_to_num(Arg2)
if(count<5)count=5
new player = cmd_target(id, Arg1, 4)//4 - must be alive
if (!player)
{
console_print(id, "[CSCP] Sorry, player %s could not be found or targetted!", Arg1)
return PLUGIN_HANDLED
}
if( player_flag[player] || teleportplayer[player] || playerfly[player])
{
console_print(id, "[CSCP] Oh, player %s is being punished!", Arg1)
return PLUGIN_HANDLED
}
punish(player)
return PLUGIN_HANDLED
}
//----------------------------admin start teleport---------------------
public admin_tele(id, level, cid)
{
if ( !cmd_access(id, level, cid, 2) )
return PLUGIN_HANDLED
new Arg1[32]
read_argv(1, Arg1, 31)
new player = cmd_target(id, Arg1, 4)//4 - must be alive
if( !check_team(player) )
{
console_print(id,"[CSCP] there is no enemy alive")
return PLUGIN_HANDLED
}
if( teleportplayer[player] || player_flag[player] || playerfly[player])
{
console_print(id,"[CSCP] he is being punished")
return PLUGIN_HANDLED
}
before_tele(player)
return PLUGIN_HANDLED
}
//---------------------------admin start fly--------------------------------------------
public admin_fly(id, level, cid)
{
if ( !cmd_access(id, level, cid, 3) )
return PLUGIN_HANDLED
new Arg1[32]
new Arg2[4]
read_argv(1, Arg1, 31)
read_argv(2, Arg2, 3)
new player = cmd_target(id, Arg1, 4)//4 - must be alive
if( playerfly[player] || player_flag[player] || teleportplayer[player])
{
console_print(id,"[CSCP] he is being punished")
return PLUGIN_HANDLED
}
fly_count[player] = str_to_num(Arg2)
before_fly(player)
return PLUGIN_HANDLED
}
//--------------------------round event-------------------------
public roundstart()
{
votetimes=0
set_task(2.0 , "roundDelay")
}
public roundDelay(taskId)
{
if ( !get_cvar_num("amx_pcheater_enable") )
return PLUGIN_HANDLED
roundcount++
if( !( roundcount%5 ) || roundcount==1)
{
//client_print(0,print_chat, "[CSCP] you can ^" say /vote_cheater ^" to start a vote to punish the cheater !" )
client_print(0,print_chat, "[CSCP] 你可以输入 ^" say /vote_cheater ^" 发起一次投票来惩罚作弊者 !")
//client_print(0,print_chat, "[CSCP] 发起投票需要 %i $ ",get_cvar_num("amx_pcheater_vote_money") )
}
get_players(players, num)
for (new i=0; i<num+1; i++)
{
if( teleportplayer[ i ] )
{
set_user_rendering(i, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 255)
new origin[3]
get_user_origin(i,origin)
origin[2]+=50
set_user_origin(i,origin)
client_cmd(i, "bind ^"space^" ^"+jump^"")
teleportplayer=false
if( task_exists(56789,0) )
remove_task(56789,0)
}
if( playerfly && !--fly_count )
{
set_user_gravity(i, 1.00)
playerfly=false
set_user_rendering(i, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 255)
}
if(player_flag)
{
if(!punish_count)
{
get_user_name(i,cheatername,32)
client_cmd(i, "name ^"Cheater #00%i^" ",++cheater_count)
//client_cmd(i, "say ^"I am a cheater ! Oh...sorry!^"")
client_cmd(i, "say ^"我在作弊 ! 啊...对不起!^"")
if( get_cvar_num("amx_pcheater_bind") ){
client_cmd(i, "bind ^"w^" ^"say 对不起^"")
client_cmd(i, "bind ^"s^" ^"say 对不起^"")
client_cmd(i, "bind ^"y^" ^"say 对不起^"")
client_cmd(i, "bind ^"mouse1^" ^"say 对不起^"")
client_cmd(i, "bind ^"q^" ^"say 对不起^"")
client_cmd(i, "bind ^"r^" ^"say 对不起^"")
}
}
if(punish_count<count)
{
if(punish_count+1==count)
{
set_hudmessage ( 200, 100, 0, 0.1, 0.65, 0, 0.02, 3.0, 0.01, 0.2, 2 )
show_hudmessage ( 0, "还想再来吗 ?")
}
else
{
if(punish_count>4)
{
set_hudmessage ( 200, 100, 0, 0.1, 0.65, 0, 0.02, 3.0, 0.01, 0.2, 2 )
show_hudmessage ( 0, "NO. %i %s",punish_count+1,roundsay[2])
}
else
{
set_hudmessage ( 200, 100, 0, 0.1, 0.65, 0, 0.02, 3.0, 0.01, 0.2, 2 )
show_hudmessage ( 0, "NO. %i %s",punish_count+1,roundsay[ punish_count ])
}
}
}
uid=get_user_userid(i)
switch(punish_count)
{
case 0:
{
if( get_cvar_num("amx_pcheater_fly")==1)
{
set_hudmessage ( 200, 100, 0, 0.2, 0.2, 0, 0.4, 10.0, 0.2, 0.2, 2 )
show_hudmessage ( 0, "Oh... UFO !")
fly_count=1
before_fly(i)
}
else set_user_health(i,1)
}
case 1:server_cmd("amx_slay2 #%i 3",uid)
case 2:server_cmd("amx_slay2 #%i 2",uid)
case 3:server_cmd("amx_slay2 #%i 1",uid)
case 4:
{
server_cmd("amx_rocket #%i",uid)
if(punish_count+1==count)
{
player_flag=false
}
}
default:
{
if(punish_count==count)
{
player_flag=false
}
else server_cmd("amx_slay2 #%i 2",uid)
}
}
if(player_flag)
punish_count++
else
{
set_user_rendering(i, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 255)
cheater_count--
punish_count=0
client_cmd(i,"name ^"%s^" ",cheatername)
}
}
if( playerfly && !player_flag)
{
if( is_user_alive(i) )
{
set_hudmessage ( 200, 100, 0, 0.2, 0.2, 0, 0.4, 10.0, 0.2, 0.2, 2 )
show_hudmessage ( 0, "Oh... UFO !")
before_fly(i)
}
}
}
return PLUGIN_HANDLED
}
//--------------------------------------vote---------------------------------------------
public before_vote(id)
{
if( !get_cvar_num("amx_pcheater_enable") || !get_cvar_num("amx_pcheater_vote") )
return PLUGIN_HANDLED
if(voting)
{
client_print(id, print_chat, "[CSCP] 已经有一个投票正在进行!")
return PLUGIN_HANDLED
}
if(votetimes==MAXVOTETIMES)
{
client_print(id, print_chat,"[CSCP] 一局只能投 %i 次票",MAXVOTETIMES)
return PLUGIN_HANDLED
}
//need money to vote
new pmoney=cs_get_user_money(id)
if( pmoney < get_cvar_num("amx_pcheater_vote_money") )
{
client_print(id, print_chat,"[CSCP] 你没有足够的钱发起投票!",MAXVOTETIMES)
return PLUGIN_HANDLED
}
cs_set_user_money(id,pmoney-get_cvar_num("amx_pcheater_vote_money"),1)
client_print(id,print_chat,"[CSCP] 花费 %i $ 发起投票.",get_cvar_num("amx_pcheater_vote_money"))
set_task(1.0,"showplayers",id)
return PLUGIN_CONTINUE
}
public showplayers(id)
{
revote=0
for(new i=0;i<9;i++)
{
choices[id] = ""
}
new menu[256]
//format(menu,255," who is a cheater ? ( Page %d ):^n^n",page[id])
format(menu,255," 谁在作弊 ? ( 第 %d 页 ):^n^n",page[id])
get_players(players,num)
new onepageplayer = num-((page[id]-1)*8)
if(num-((page[id]-1)*8) > 8)
onepageplayer = 8
new offset = (page[id] * 8) - 8
for(new i=offset;i<onepageplayer+offset;i++)
{
new username[33]
get_user_name(players,username,32)
new string[256]
if( player_flag[ players ] || teleportplayer[players] || playerfly[players] || (get_user_flags(players) & ADMIN_IMMUNITY ))
{
format(string,255,"\d%d. %s (punishing) ^n",i+1-offset,username)
//choices[id][i-offset] = ""
}
else
{
format(string,255,"\w%d. %s ^n",i+1-offset,username)
new id_str[33]
num_to_str(players,id_str,32)
choices[id][i-offset] = id_str
}
add(menu,255,string)
}
if(num-((page[id]-1)*8) > 8)
{
choices[id][8] = "Next"
add(menu,255,"\w^n9. 下一页")
}
add(menu,255,"\w^n0. 返回")
show_menu(id,KEY1|KEY2|KEY3|KEY4|KEY5|KEY6|KEY7|KEY8|KEY9|KEY0,menu,MENUTIME,"who is cheater?")
return PLUGIN_CONTINUE
}
public choosewho(id,key)
{
if(key == 9 && page[id] == 1)
{
page[id]=1
return 1
}
else if(key == 9 && page[id] > 1)
{
page[id] -=1
showplayers(id)
return 1
}
if(equal(choices[id][key],""))
{
showplayers(id)
return 1
}
if(key < 8)
{
page[id]=1
target[id] = choices[id][key]
showmenu(id,target[id])
return 1
}
if(key == 8 && equal(choices[id][key],"Next"))
{
page[id] += 1
showplayers(id)
return 1
}
return 1
}
//---------------------------------punish menu--------------------------------------------
public showmenu(id,target[33])
{
new menu2[256]
count_y=0
count_n=0
count_p=0
voting=true
get_players(players,num)
for(new i=0;i<num;i++)
{
counted[ players ]=false
}
new startname[32],targetname[32]
get_user_name(id,startname,32)
new tid=str_to_num(target)
get_user_name(tid,targetname,32)
//format(menu2, 256, "\w^" %s ^" is a cheater ? ^n\d(^"%s^" start this vote) ^n^n\w7. Yes^n8. No^n9. ^" %s ^"is a libeler ",targetname,startname,startname)
format(menu2, 256, "\w^" %s ^" 是作弊的 ? ^n\d(^"%s^" 发起本次投票) ^n^n\w7. 是^n8. 不是^n9. ^" %s ^"在诽谤^n^n不参与投票者将被扣%i$",targetname,startname,startname,get_cvar_num("amx_pcheater_takemoney"))
show_menu(0, KEY7|KEY8|KEY9, menu2,MENUTIME,"Punish cheater?")
new par[2]
par[0]=id
par[1]=tid
set_task(float(MENUTIME+1), "voteresult",78999,par,2)
return PLUGIN_CONTINUE
}
public votecount(id,key)
{
if (key == 6)
{
count_y++
}
if (key == 7)
{
count_n++
}
if (key == 8)
{
count_p++
}
counted[id]=true
}
//-------------------------vote result---------------------------------
public voteresult(par[2])//tid)
{
new uname[32]
new tid=par[1]
votetimes++
//get_players(players, num,"c") //without bot
get_players(players, num)
new pmoney=0
//take money of a player who didn't vote.
for(new i=0;i<num;i++)
{
if( !counted[ players ] )
{
pmoney=cs_get_user_money(players)-get_cvar_num("amx_pcheater_takemoney")
if( pmoney<0)
pmoney=0
cs_set_user_money(players,pmoney,1)
//client_print(players,print_chat,"[CSCP] server take away you %i money becase of you didn't vote",get_cvar_num("amx_pcheater_takemoney") )
client_print(players,print_chat,"[CSCP] 由于没有投票你将被扣除%i块钱",get_cvar_num("amx_pcheater_takemoney"))
}
}
new Float:rate = get_cvar_float("amx_pcheater_vote_rate")
new Float:result = num ? (float(count_y) / float(num)) : 0.0
if( result>=rate )
{
if( player_flag[tid] )
{
get_user_name(tid,uname,32)
//client_print(0,print_chat, "[CSCP] Oh, player ^" %s ^" is being punished!",uname)
client_print(0,print_chat, "[CSCP] 玩家 ^" %s ^" 正在被惩罚!",uname)
voting=false
count_y=0
count_n=0
return PLUGIN_HANDLED
}
set_hudmessage ( 200, 100, 0, 0.2, 0.2, 0, 0.4, 10.0, 0.2, 0.2, 2 )
//show_hudmessage ( 0, "the result is %f% ! vote successful ! ^n^n yes ( %i ) . no ( %i ) .",result,count_y,count_n)
show_hudmessage ( 0, "投票结果为 %f% ! 投票成功 ! ^n^n 是 ( %i ) . 不是 ( %i ) .",result,count_y,count_n)
++punishtimes[tid]
player_flag[tid]=true
if(result>=0.9)
count=7
else count=5
punish(tid)
}
else
{
new Float:p_result=num ? (float(count_p) / float(count_y+count_n+count_p)) : 0.0
if(p_result>=rate)
{
get_user_name(par[0],oldname,31)
uid=get_user_userid(par[0])
set_hudmessage ( 200, 100, 0, 0.2, 0.2, 0, 0.4, 10.0, 0.2, 0.2, 2 )
// show_hudmessage ( 0, "the result is %f% ! vote failed ( need %f% ).^n^n But yes ( %i ) . no ( %i ) . libel ( %i )^n^n ^" %s ^" will be punish in 5 round !!!!",result,rate,count_y,count_n,count_p,oldname)
show_hudmessage ( 0, "投票结果为 %f% ! 投票失败 ( 需要达到 %f% ).^n^n 但: 是 ( %i ) . 不是 ( %i ) . 诽谤 ( %i )^n^n ^" %s ^" 将被惩罚5局 !!!!",result,rate,count_y,count_n,count_p,oldname)
count=5
player_flag[par[0]]=true
punish_count[par[0]]=0
server_cmd("amx_bury #%i",uid)
}
else
{
new Float:true_result=num ? (float(count_y) / float(count_y+count_n)) : 0.0
if(true_result>=rate && revote<MAXREVOTETIMES)
{
set_hudmessage ( 200, 100, 0, 0.2, 0.2, 0, 0.4, 10.0, 0.2, 0.2, 2 )
//show_hudmessage ( 0, "the result is %f% ! vote failed ( need %f% ).^n^n But yes ( %i ) . no ( %i ).^n^n Please vote again !!!!",result,rate,count_y,count_n)
show_hudmessage ( 0, "投票结果为 %f% ! 投票失败 ( 需要达到 %f% ).^n^n 但: 是 ( %i ) . 不是 ( %i ).^n^n 请再投一次 !",result,rate,count_y,count_n)
num_to_str(tid,target[tid],5)
votetimes--
revote++
showmenu(par[0],target[tid])
}
else
{
set_hudmessage ( 200, 100, 0, 0.2, 0.2, 0, 0.4, 10.0, 0.2, 0.2, 2 )
//show_hudmessage ( 0, "the result is %f% ! vote failed ( need %f% ).^n^n yes ( %i ) . no ( %i ) . libel ( %i )",result,rate,count_y,count_n,count_p)
show_hudmessage ( 0, "投票结果为 %f% ! 投票失败 ( 需要达到 %f% ).^n^n 是 ( %i ) . 不是 ( %i ) . 诽谤 ( %i )",result,rate,count_y,count_n,count_p)
}
}
}
count_y=0
count_n=0
count_p=0
voting=false
return PLUGIN_CONTINUE
}
//---------------------------punish------------------------------------------
punish(player)
{
set_task(5.0,"punishdelay",player)
return PLUGIN_CONTINUE
}
public punishdelay(player)
{
player_flag[player]=true
punish_count[player]=0
get_user_info(player,"name",oldname,31)
uid=get_user_userid(player)
if(punishtimes[player]>MAXPUNISHTIMES && get_cvar_num("amx_pcheater_kick"))
{
set_hudmessage ( 200, 100, 0, 0.2, 0.2, 0, 0.4, 10.0, 0.2, 0.2, 2 )
//show_hudmessage ( 0, "player (%s) will be kicked !",oldname)
show_hudmessage ( 0, "作弊者 (%s) 将被踢掉 !",oldname)
server_cmd("kick #%i",uid)
return PLUGIN_HANDLED
}
set_hudmessage ( 200, 100, 0, 0.4, 0.6, 0, 0.02, 5.0, 0.01, 0.2, 2 )
//show_hudmessage ( 0, "One cheater ( %s ) will be punished in %i round!",oldname,count )
show_hudmessage ( 0, "作弊者 ( %s ) 将被惩罚 %i 局!",oldname,count )
set_user_rendering(player, kRenderFxGlowShell, 0, 255, 0, kRenderTransAlpha, 150)
return PLUGIN_CONTINUE
}
//-------------------------check alive enemy-------------------------
check_team(id)
{
if( !is_user_alive(id) )
return 0
new pteam[32],eteam[32],i
get_user_team(id,pteam,31)
get_players(players,num,"a")
for(i=0;i<num;i++)
{
get_user_team(players,eteam,31)
if( !equal(eteam,pteam) )
break
}
if(i==num)
return 0
get_players(players,index,"ae",eteam)
return index
}
//------------------------------Teleport--------------------------------------------
before_tele(id)
{
if( !is_user_alive(id) )
return PLUGIN_HANDLED
get_user_name(id,oldname,31)
set_hudmessage ( 200, 100, 0, 0.2, 0.2, 0, 0.4, 10.0, 0.2, 0.2, 2 )
//show_hudmessage ( 0, "Oh,player ( %s ) will be teleported. ^nkill him to win %i$ !",oldname,get_cvar_num("amx_pcheater_givemoney") )
show_hudmessage ( 0, "重金悬赏:玩家 ( %s ) 将被传送 . ^n杀掉他可以得到 %i$ !",oldname,get_cvar_num("amx_pcheater_givemoney") )
client_cmd(id, "bind ^"space^" ^"say 对不起^"")
new par[1]
par[0]=id
new number=random_num(2,3)
set_user_health(id,20)
//glow
set_user_rendering(id, kRenderFxGlowShell, 200, 200, 20, kRenderTransAlpha, 155)
set_task(number*(0.5),"teleport",56789,par,1,"b")
return PLUGIN_CONTINUE
}
public teleport(par[1])
{
new id=par[0]
new origin[3]
new org1,org2
if( !check_team(id) || !is_user_alive(id) )
{
remove_task(56789,0)
teleportplayer[id]=false
client_cmd(id, "bind ^"space^" ^"+jump^"")
set_user_rendering(id, kRenderFxGlowShell, 0,0, 0, kRenderTransAlpha, 255)
return PLUGIN_HANDLED
}
new ran=random_num(0,index-1)
new ranid=players[ran]
teleportplayer[id]=true
get_user_origin(ranid,origin)
strip_user_weapons ( id )
org1=random_num(-150,150)
org2=random_num(-150,150)
origin[0]+=org1
origin[1]+=org2
origin[2]-=50
set_user_origin(id,origin)
get_user_name(id,oldname,31)
client_cmd(id, "bind ^"space^" ^"+jump^"")
return PLUGIN_CONTINUE
}
//----------------------------death event---------------------------------------
public hook_death()
{
new Killer = read_data(1)
new Victim = read_data(2)
if( get_cvar_num("amx_pcheater_enable") && teleportplayer[Victim] && get_user_team(Victim)!=get_user_team(Killer) )
{
remove_task(56789,0)
teleportplayer[Victim]=false
set_user_rendering(Victim, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 255)
addmoney(Killer)
}
if( get_cvar_num("amx_pcheater_enable") && playerfly[Victim] && Victim!=Killer )
{
set_user_gravity(Victim, 1.00)
//playerfly[Victim]=false
set_user_rendering(Victim, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 255)
addmoney(Killer)
}
return PLUGIN_HANDLED
}
addmoney(id)
{
get_user_name(id,oldname,31)
set_hudmessage ( 200, 100, 0, 0.2, 0.2, 0, 0.4, 10.0, 0.2, 0.2, 2 )
//show_hudmessage ( 0, "player ( %s ) kill the cheater ! add %i$ :) !",oldname,get_cvar_num("amx_pcheater_givemoney") )
show_hudmessage ( 0, "玩家 ( %s ) 杀死作弊者 ! 得到 %i$ 奖金 :) !",oldname,get_cvar_num("amx_pcheater_givemoney") )
new kmoney=cs_get_user_money(id)
cs_set_user_money ( id,kmoney+get_cvar_num("amx_pcheater_givemoney"), 1 )
}
//--------------------------fly--------------------------------------------
before_fly(id)
{
set_task(6.0,"fly",id)
}
public fly(id)
{
if( !is_user_alive(id) )
return PLUGIN_HANDLED
get_user_name(id,oldname,31)
set_hudmessage ( 200, 100, 0, 0.2, 0.2, 0, 0.4, 10.0, 0.2, 0.2, 2 )
// show_hudmessage ( 0, "Oh,player ( %s ) is in the sky. ^nkill him to win %i$ !",oldname,get_cvar_num("amx_pcheater_givemoney") )
show_hudmessage ( 0, "作弊者 ( %s ) 在天上. ^n杀死他将赢得 %i$ !",oldname,get_cvar_num("amx_pcheater_givemoney") )
set_user_rendering(id, kRenderFxGlowShell, 255, 50, 0, kRenderTransAlpha, 255)
set_user_gravity(id,-0.5)
client_cmd(id, "+jump;wait;wait;-jump")
strip_user_weapons ( id )
playerfly[id]=true
return PLUGIN_HANDLED
}
[/PHP]
这是cheating_punish.sma 的源码! 在附件中附上了!
根本没这个命令的啊!!! |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注个册吧
×
|