|
发表于 2007-11-30 00:10:18
|
显示全部楼层
来自 中国–广东–深圳
回复: 五光十色闪光弹插件修正版
Post by Osker Lee
不管怎样,我还是对楼主助人为乐的精神深表感谢!
上面表示的是灰色的颜色代码,主要是用来判断当"amx_fb_mod"后面的参数不是"0","1","2"或"3"时(比如说,设置成"5,6,7......"时),玩家被FB闪到的话一律产生灰色的颜色.
明白了,原来是这样。。
我自己改了下颜色,红色我觉得好刺眼,给大家分享一下。
顺便也改了一下函数的形式,呵呵。
[php]
public FlashedEvent( id )
{
new iMode = get_cvar_num("amx_fb_mode")
new iRed,iGreen,iBlue
switch(iMode)
{
case 0:return PLUGIN_CONTINUE
case 1:{
iRed = get_cvar_num("amx_fb_r")
iGreen = get_cvar_num("amx_fb_g")
iBlue = get_cvar_num("amx_fb_b")
}
case 2:{
iRed = random_num(0,255)
iGreen = random_num(0,255)
iBlue = random_num(0,255)
}
case 3:{
if (team ==1) // Terrorist
{
iRed = 215 //255
iGreen = 145//25
iBlue = 125 //25
}
else // Counter-Terrorist
{
iRed = 128 //25
iGreen = 158 //25
iBlue = 210 //255
}
}
default:{
iRed = 100
iGreen = 100
iBlue = 100
}
}
message_begin( MSG_ONE,g_nMsgScreenFade,{0,0,0},id )
write_short( read_data( 1 ) ) // Duration
write_short( read_data( 2 ) ) // Hold time
write_short( read_data( 3 ) ) // Fade type
write_byte ( iRed ) // Red
write_byte ( iGreen ) // Green
write_byte ( iBlue ) // Blue
write_byte ( read_data( 7 ) ) // Alpha
message_end()
return PLUGIN_HANDLED
}
[/php] |
|