Raised This Month: $ Target: $400
 0% 

help with screenfade


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dr.G
Senior Member
Join Date: Nov 2008
Old 03-31-2009 , 09:59   Re: help with screenfade
Reply With Quote #1

yes as snow says that would be the best, but a simple way, thats easy could be like this:

PHP Code:
#include <amxmodx>
#include <zombieplague>
 
new g_msgScreenFadecvar_togglecvar_humanoscvar_zombiescvar_rounddraw
 
new cvar_color_one
new cvar_color_two
new cvar_color_three
 
public plugin_init()
{
 
register_plugin("[ZP] ScreenFade""1.3""alan_el_more")
 
g_msgScreenFade get_user_msgid("ScreenFade")
 
cvar_toggle register_cvar("zp_screenfade""1")
 
cvar_humanos register_cvar("zp_screenfade_humanos""1")
 
cvar_zombies register_cvar("zp_screenfade_zombies""1")
 
cvar_rounddraw register_cvar("zp_screenfade_rounddraw""1")
 
 
cvar_color_one register_cvar("zp_screenfade_color_one""0")
 
cvar_color_two register_cvar("zp_screenfade_color_two""0")
 
cvar_color_threeregister_cvar("zp_screenfade_color_three""256")
}
 
public 
zp_round_ended(winteam)
{
 if (
get_pcvar_num(cvar_toggle))
 {
  if ((
get_pcvar_num(cvar_humanos)) && winteam == WIN_HUMANS
  {
   
screenfade(get_pcvar_num(cvar_color_one), get_pcvar_num(cvar_color_two), get_pcvar_num(cvar_color_three))
  }
  if ((
get_pcvar_num(cvar_zombies)) && winteam == WIN_ZOMBIES
  {
   
screenfade(get_pcvar_num(cvar_color_one), get_pcvar_num(cvar_color_two), get_pcvar_num(cvar_color_three))
  }
  if ((
get_pcvar_num(cvar_rounddraw)) && winteam == WIN_NO_ONE
  {
   
screenfade(get_pcvar_num(cvar_color_one), get_pcvar_num(cvar_color_two), get_pcvar_num(cvar_color_three))
  }
 }
}
 
public 
screenfade(redgreenblue)
{
 
message_begin(MSG_BROADCASTg_msgScreenFade)
 
write_short((1<<12)*4)
 
write_short((1<<12)*1)
 
write_short(0x0001
 
write_byte (red)
 
write_byte (green)
 
write_byte (blue)
 
write_byte (250)
 
message_end()

__________________
Dr.G is offline
alan_el_more
Veteran Member
Join Date: Jul 2008
Location: amxmodx-es.com
Old 03-31-2009 , 10:11   Re: help with screenfade
Reply With Quote #2

@Snow
do Something more simple?

@DR.G
i want the color of one screenfade be changed to one cvar, not 3
for example:
zp_screenfade_zombies 255000000
__________________

Last edited by alan_el_more; 03-31-2009 at 10:14.
alan_el_more is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:15.


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