All player's screens are blue when it is played that CT throws away to FLASHBANG;
All player's screens are red when it is played that T throws away to FLASHBANG;
The following is a code, the fault where? Help me!
PHP Code:
#include <amxmodx>
#include <engine>
#define PLUGIN "team Color Flashbangs"
#define VERSION "1.0"
#define AUTHOR "zwfgdlc"
new g_nMsgScreenFade
new team
public plugin_init()
{
register_plugin(PLUGIN,VERSION,AUTHOR)
register_event("ScreenFade","FlashedEvent","be","4=255","5=255","6=255","7>199")
g_nMsgScreenFade = get_user_msgid("ScreenFade")
}
public grenade_throw(id, greindex, wpnid)
{
if(wpnid==CSW_FLASHBANG)
team=get_user_team(id)
}
public FlashedEvent( id )
{
new iRed,iGreen,iBlue
if (team==1)
{
iRed = 255
iGreen = 90
iBlue = 90
}else{
iRed = 125
iGreen = 125
iBlue = 255
}
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
}