|
发表于 2010-6-4 19:38:22
|
显示全部楼层
来自 中国–广东–广州
本帖最后由 kk阿朗 于 2010-6-8 14:29 编辑
- /* Plugin generated by AMXX-Studio */
- #include <amxmodx>
- #include <fakemeta>
- #define PLUGIN "New Plug-In"
- #define VERSION "0.1"
- #define AUTHOR "K.K.Lv"
- new g_pCvarEnable;
- new g_MaxPlayers;
- public plugin_init() {
- register_plugin( PLUGIN, VERSION, AUTHOR );
-
- g_pCvarEnable = register_cvar( "wg_enable", "1" );
-
- register_forward( FM_SetModel,"forward_model" );
-
- g_MaxPlayers = get_maxplayers();
- }
- public forward_model( ent, const model[] ) {
- if ( !pev_valid( ent ) && !get_pcvar_num( g_pCvarEnable ) )
- return FMRES_IGNORED;
- //use random color
- static id;
- id = pev( ent, pev_owner );
- if ( !( 1<= id <= g_MaxPlayers ) )
- return FMRES_IGNORED;
- static red, green, blue;
-
- red = random_num( 1, 255 );
- green = random_num( 1, 255 );
- blue = random_num( 1, 255 );
-
- fm_set_rendering( ent, kRenderFxGlowShell, red, green, blue, kRenderNormal, 15 );
- return FMRES_IGNORED;
- }
- stock fm_set_rendering( ent, fx = kRenderFxNone, r = 0, g = 0, b = 0, mode = kRenderNormal, amount = 16 ) {
- static Float:RenderColor[ 3 ];
- RenderColor[ 0 ] = float( r );
- RenderColor[ 1 ] = float( g );
- RenderColor[ 2 ] = float( b );
- set_pev( ent, pev_renderfx, fx );
- set_pev( ent, pev_rendercolor, RenderColor );
- set_pev( ent, pev_rendermode, mode );
- set_pev( ent, pev_renderamt, float( amount ) );
- }
复制代码 测试过!自己可以 改一下不要随机颜色! |
|