[ create a new paste ] login | about

Link: http://codepad.org/dGvUOfsx    [ raw code | fork ]

Raheem - C, pasted on Sep 10:
#include <amxmodx>
#include <zombieplague>

new g_maxplayers
new g_MsgScreenFade

#define DUARATION 3 //In Seconds
#define HOLD 2 //In Seconds
#define FFADE_IN 0x0000
#define DENSITY 150


public plugin_init()
{
	register_plugin("[ZP] Screen Fade", "1.0", "Raheem")
	g_maxplayers = get_maxplayers()
	g_MsgScreenFade = get_user_msgid("ScreenFade")
}

public zp_round_ended(winteam)
{
	for (new id = 1; id <= g_maxplayers; id++)
	{
		if(is_user_connected(id))
		{
			if(winteam == ZP_TEAM_HUMAN)
			{
				message_begin(MSG_ONE_UNRELIABLE, g_MsgScreenFade, {0,0,0}, id)				
				write_short(DUARATION * 4096)        // Duration
				write_short(HOLD * 4096)            // Hold time
				write_short(FFADE_IN)            // Fade type
				write_byte (0)                    // Red
				write_byte (0)                  // Green
				write_byte (255)             // Blue
				write_byte (DENSITY)       // Alpha
				message_end()
			}
			else if(winteam == ZP_TEAM_ZOMBIE)
			{
				message_begin(MSG_ONE_UNRELIABLE, g_MsgScreenFade, {0,0,0}, id)				
				write_short(DUARATION * 4096)     // Duration
				write_short(HOLD * 4096)         // Hold time
				write_short(FFADE_IN)         // Fade type
				write_byte (255)              // Red
				write_byte (0)              // Green
				write_byte (0)            // Blue
				write_byte (DENSITY)   // Alpha
				message_end()
			}
		}
	}
}


Create a new paste based on this one


Comments: