jason5312
|
分享:
▼
x0
|
[1.6][插件] 怎么侦测死亡?
就是当我死亡之后 它会执行123(id) public 123(id) { } 要怎么用?? 我还是贴上原码好了 我选单部分是用 新式选单下去做的 复制程式
#include <amxmodx>
#include <amxmodx>
#include <cstrike>
#include <fun>
#include <hamsandwich>
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#define PLUGIN "解毒剂"
public plugin_init()
{
register_clcmd( "say /menu","ExtraMenu");
register_event( "DeathMsg" , "DeathMsgEvent" , "a" );
}
public event_death()
{
new victim = read_data(2)
ExtraMenu(victim)
}
public ExtraMenu(id)
{
new menu = menu_create("\r你死了是否要用解毒剂?", "menu_handler");
menu_additem(menu, "\w 我要用解毒剂-16000元", "1", 0);
menu_additem(menu, "\w 我想当僵尸", "2", 0);
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
menu_display(id, menu, 0);
}
public menu_handler(id, menu, item)
{
if( item == MENU_EXIT )
{
menu_destroy(menu);
return PLUGIN_HANDLED;
}
new data[6], iName[64];
new access, callback;
menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);
new key = str_to_num(data);
switch(key)
{
case 1:
{
if(cs_get_user_team(id) == CS_TEAM_CT)
{
ExecuteHam(Ham_CS_RoundRespawn,id);
{
give_item(id,"weapon_knife")
}
client_print(id, print_chat, "请珍惜你的生命");
}
else
{
client_print(id, print_chat, "病毒已经扩散至你全身");
}
menu_destroy(menu);
return PLUGIN_HANDLED;
}
case 2:
{
client_print(id, print_chat, "我看你根本就没钱吧?");
menu_destroy(menu);
return PLUGIN_HANDLED;
}
}
menu_destroy(menu);
return PLUGIN_HANDLED;
}
[ 此文章被jason5312在2012-07-02 00:11重新编辑 ]
|
|
x0
[楼 主]
From:台湾中华电信股份有限公司 | Posted:2012-07-01 21:27 |
|
|
ccw111
|
分享:
▲
#include < amxmodx > #include < fakemeta > #include < hamsandwich >
new Debug;
public plugin_init( ) { RegisterHam( Ham_Killed , "player" , "fw_PlayerKilled" ); }
public fw_PlayerKilled( iVictim , iAttacker , shouldgib ) { }
public client_putinserver( id ) { if( Debug ) { return; } new class[ 32 ]; pev( id , pev_classname , class , charsmax( class ) ); if( !equal( class , "player" ) ) { set_task( 1.0 , "fn_Debug" , id ); Debug ++; } }
public fn_Debug( id ) { RegisterHamFromEntity( Ham_Killed , id , "fw_PlayerKilled" ); }
[ 此文章被ccw111在2012-07-02 10:36重新编辑 ]
|
|
x0
[4 楼]
From:未知地址 | Posted:2012-07-02 10:04 |
|
|
|