Discuz! Board
标题:
[代码|Code]强弱判定系统|Power Struggle System
[打印本页]
作者:
Jerry小坏
时间:
2017-7-13 16:27
标题:
[代码|Code]强弱判定系统|Power Struggle System
#include < amxmodx >
#include < engine >
#include < fakemeta >
public plugin_init()
{
register_plugin( "PowerStruggleEditEntry", "1.0", "ESFKAMI" );
register_message( get_user_msgid( "PowerStrug" ), "PowerStruggle" );
}
public PowerStruggle( MsgID, Dest, Client )// Hook
{
if( get_msg_arg_int( 1 ) == 127 ) return;
if( get_pdata_int( Client, 198 ) == 1 )// 挡波时|Block Struggle
{
if( get_msg_arg_int( 1 ) < 0 )// 快挡不住时|While the client is going to lose
{
entity_set_float( Client, EV_FL_fuser4, 1000.0 );
client_print( Client, print_center, "[Blocking] %d", get_msg_arg_int( 1 ) );
// Add your own effects here...
}
if( get_msg_arg_int( 1 ) > 0 )// 快把波弹开时|While the client is going to win
{
entity_set_float( Client, EV_FL_fuser4, 10.000_000 );
client_print( Client, print_center, "[Blocking] %d", get_msg_arg_int( 1 ) );
// Add your own effects here...
}
}
else // 对波时|Beam Struggle
{
if( get_msg_arg_int( 1 ) < 0 ) // 快对不过敌人时|While the client is going to lose
{
entity_set_float( Client, EV_FL_fuser4, 1000.000_000 );
client_print( Client, print_center, "%d", get_msg_arg_int( 1 ) );
// Add your own effects here...
}
if( get_msg_arg_int( 1 ) > 0 ) // 快对过敌人时|While the client is going to win
{
entity_set_float( Client, EV_FL_fuser4, 10.000_000 );
client_print( Client, print_center, "%d", get_msg_arg_int( 1 ) );
// Add your own effects here...
}
}
//set_msg_arg_int( 1, ARG_CHAR, 100 );// -100 ~ 100: -100 = lose, 100 = win, this only changes the StruggleHud of clients. 本参数只能在HUD表面上给对波强弱判定进度条位置做出改变[]
}
复制代码
欢迎光临 Discuz! Board (https://esfbbs.foxnyx.top/)
Powered by Discuz! X3.2