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 |
|
|
|