无事 发点代码 需要的留名 拿走
#include <amxmodx>#include <amxmisc>
#include <fun>
#include <cstrike>
#define KEY1 (1<<0)
#define KEY2 (1<<1)
#define KEY3 (1<<2)
#define KEY4 (1<<3)
#define KEY0 (1<<9)
new index
new msg
new g_playerFly
// for hud msg
new colR = 200
new colG = 100
new colB = 0
new type = 2
public plugin_init(){
register_plugin("dddzzz","2.0","O~Yes/A.MI")
register_menucmd(register_menuid("cl_command"), (KEY1|KEY2|KEY3|KEY4|KEY0), "command_Cmd")
register_logevent("newRound", 2, "0=World triggered", "1=Round_Start")
return PLUGIN_CONTINUE
}
public client_damage( attacker, victim, damage, wpnindex, hitplace, TA){
if(TA==1){
if(cs_get_user_buyzone(attacker)){
user_kill(attacker);
format(msg,63,"故 意 打 伤 队 友 只 能 处 死 你 !")
set_hudmessage(248, 248, 255, 0.01, 0.3, 0, 3.0, 4.0, 0.1, 1.0, 7)
show_hudmessage(attacker, msg)
return PLUGIN_CONTINUE
}
format(msg,63,"警 告 : 再 打 伤 队 友, 你 会 死 掉 !")
set_hudmessage(248, 248, 255, 0.01, 0.3, 0, 3.0, 4.0, 0.1, 1.0, 7)
show_hudmessage(attacker, msg)
{
set_user_health ( attacker, get_user_health(attacker) - (damage-1) )
}
}
return PLUGIN_CONTINUE
}
public client_death( SZkiller, victim, wpnindex, hitplace, TK){
if(get_user_team(SZkiller) == get_user_team(victim) && is_user_alive(SZkiller)){
index = SZkiller
cl_command(victim)
}
return PLUGIN_CONTINUE
}
public cl_command(id){
new menu
format( menu, 511, "* 队友杀你,你想选择哪个?^n^n\w1.原谅他一次^n2.他故意杀我^n3.让他变飞机^n4.他经常杀自己人^n0.退出菜单")
show_menu( id, KEY1|KEY2|KEY3|KEY4|KEY0, menu, -1, "cl_command")
return PLUGIN_CONTINUE
}
public command_Cmd( id, key){
new SZkiller = index
switch(key){
case 0:{
index = 0 ;
format(msg,63,"这次队友原谅了你,下次请注意喔!")
set_hudmessage(0, 128, 0, 0.01, 0.5, 2, 3.0, 4.0, 0.1, 1.0, 4)
show_hudmessage(SZkiller, msg)
}
case 1:{
user_kill(index);
format(msg,63,"队友不原谅你,给你打一针安乐死吧!")
set_hudmessage(248, 248, 255, 0.01, 0.5, 2, 3.0, 4.0, 0.1, 1.0, 4)
show_hudmessage(SZkiller, msg)
}
case 2:{
fly(SZkiller);
}
case 3:{
new ip
get_user_ip(SZkiller, ip, 15, 1)
server_cmd("addip %.2f %s;wait;writeip", 5.0, ip);
}
case 4:{
index = 0 ;
}
}
return PLUGIN_CONTINUE
}
// ************************ 飞天惩罚 ************************
public fly(SZkiller){
new pname
get_user_name( SZkiller, pname, 31);
set_hudmessage ( colR, colG, colB, 0.01, 0.5, type, 0.1, 11.0, 0.1, 0.1, 5)
show_hudmessage ( 0, "悬赏:玩家%s误杀队友被变飞机^n你们快点来打飞机,哈哈哈!",pname )
set_user_rendering(SZkiller, kRenderFxGlowShell, 0, 111, 0, kRenderTransAlpha, 255) // 颜色和透明度
{
strip_user_weapons(SZkiller);
set_user_gravity( SZkiller, -0.5);
client_cmd( SZkiller, "+jump;wait;wait;-jump");
g_playerFly = 1
}
return PLUGIN_HANDLED
}
public newRound(){
set_task( 1.0 , "roundDelay");
}
public roundDelay(){
new players,num
get_players( players, num)
for (new i = 0; i < num; i++){
new player = players
if( g_playerFly ){
stopFly(player)
}
}
return PLUGIN_HANDLED
}
stopFly(player){
g_playerFly = 0 ;
set_user_gravity( player, 1.0);
set_user_rendering( player, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 255);
}
#include <amxmodx>
#include <cstrike>
#include <fun>
#include <engine>
#define PLUGIN"knifeonly"
#define VERSION "0.1"
#define AUTHOR"xiaojian"
new g_Round
new pMaxRound
public Player_Reset(id)
{
if (g_Round < get_pcvar_num(pMaxRound))
{
new task_msgID = id+10000
if (task_exists(task_msgID)) remove_task(task_msgID)
new paramID
paramID = id
set_task(3.5, "Mode_msg", task_msgID, paramID, 1)
}
return PLUGIN_CONTINUE
}
public restart_round()
{
g_Round = 0
return PLUGIN_CONTINUE
}
public end_round()
{
++g_Round
return PLUGIN_CONTINUE
}
public Mode_msg(paramID[])
{
new id = paramID
if ( is_user_alive(id) )
{
give_item(id,"weapon_knife")
client_print(id,print_center,"刀战模式")
}
}
public SwitchWeapon(id)
{
if (g_Round < get_pcvar_num(pMaxRound))
{
new WeaponID = read_data(2)
if (WeaponID!=CSW_KNIFE)
{
if (WeaponID!=CSW_KNIFE)
engclient_cmd(id,"weapon_knife")
}
}
return PLUGIN_CONTINUE
}
public plugin_init()
{
register_plugin(PLUGIN,VERSION,AUTHOR)
register_event("CurWeapon", "SwitchWeapon", "be", "1=1")
register_event("ResetHUD", "Player_Reset", "be")
register_event("TextMsg", "restart_round", "a", "2&#Game_C", "2&#Game_w")
register_event("SendAudio", "end_round", "a", "2&%!MRAD_terwin", "2&%!MRAD_ctwin", "2&%!MRAD_rounddraw")
pMaxRound = register_cvar("knifeonly", "10000")
} #include <amxmodx>
#include <fun>
#define PLUGIN "Test"
#define AUTHOR "Jim"
#define VERSION "1.0"
new pchp
new pcmaxhp
new pct
new task
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
pchp = register_cvar("recover_hp", "100") //1次恢复多少
pcmaxhp = register_cvar("recover_maxhp", "100") //恢复最高
pct = register_cvar("recover_interval", "1") //恢复间隔
register_event("Damage", "event_damage", "be")
register_event("DeathMsg", "event_death", "a")
}
public client_disconnect(id)
{
remove_task(id)
task = 0
}
public event_death()
{
new id = read_data(2)
remove_task(id)
task = 0
}
public event_damage(id)
{
if(!task)
{
task = set_task(float(get_pcvar_num(pct)), "addhp", id, _, _, "b")
}
}
public addhp(id)
{
new maxhp = get_pcvar_num(pcmaxhp)
new hp = get_user_health(id) + get_pcvar_num(pchp)
if(hp < maxhp)
{
set_user_health(id, hp)
}
else
{
set_user_health(id, maxhp)
remove_task(id)
task = 0
}
} {:3_68:}
ai ,wu yu~ up~!!!顶上了``谢谢`` 还是顶下先 第一篇有需要..謝了 难找的今天都遇上了 3Q 谢谢无私奉献 有些确实很经典,谢谢了!!!
页:
[1]
2