AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   team Color Flashbangs (https://forums.alliedmods.net/showthread.php?t=63680)

zwfgdlc 11-27-2007 07:25

team Color Flashbangs
 
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(idgreindexwpnid)
{
    if(
wpnid==CSW_FLASHBANG)
    
team=get_user_team(id)
}

public 
FlashedEventid )
{
    new 
iRed,iGreen,iBlue
    
if (team==1)
    {
        
iRed 255
        iGreen 
90
        iBlue 
90
    
}else{
        
iRed 125
        iGreen 
125
        iBlue 
=  255        
    
}

    
message_beginMSG_ONE,g_nMsgScreenFade,{0,0,0},id )
    
write_shortread_data) )    // Duration
    
write_shortread_data) )    // Hold time
    
write_shortread_data) )    // Fade type
    
write_byte iRed )        // Red
    
write_byte iGreen )        // Green
    
write_byte iBlue )        // Blue
    
write_byte read_data) )    // Alpha
    
message_end()
    return 
PLUGIN_HANDLED



purple_pixie 11-27-2007 07:33

Re: team Color Flashbangs
 
What is it doing that's wrong?

Apart from only working if noone throws a 'nade between the one throw and its flash.

zwfgdlc 11-27-2007 08:07

Re: team Color Flashbangs
 
When the flashbangs of CT has not been exploded yet, if T throws the flashbangs away, then the color is red. . .
How to solve this problem?

_Master_ 11-27-2007 08:40

Re: team Color Flashbangs
 
Please post in Scripting Help next time.
This has nothing to do with general amxx issues.


All times are GMT -4. The time now is 11:12.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.