Raised This Month: $ Target: $400
 0% 

help with screenfade


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
alan_el_more
Veteran Member
Join Date: Jul 2008
Location: amxmodx-es.com
Old 03-31-2009 , 09:34   help with screenfade
Reply With Quote #1

i have this plugin
PHP Code:
#include <amxmodx>
#include <zombieplague>

new g_msgScreenFadecvar_togglecvar_humanoscvar_zombiescvar_rounddraw

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")
}

public 
zp_round_ended(winteam)
{
    if (
get_pcvar_num(cvar_toggle))
    {
        if ((
get_pcvar_num(cvar_humanos)) && winteam == WIN_HUMANS
        {
            
screenfade(00255)
        }
        if ((
get_pcvar_num(cvar_zombies)) && winteam == WIN_ZOMBIES
        {
            
screenfade(25500)
        }
        if ((
get_pcvar_num(cvar_rounddraw)) && winteam == WIN_NO_ONE
        {
            
screenfade(02550)
        }
    }
}

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()

my questions are...
how do i determine the color of each screenfade with a cvar for each?
and
how do i that the color of screenfade is solid or opaque?

thanks in advance
__________________
alan_el_more is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 03-31-2009 , 09:55   Re: help with screenfade
Reply With Quote #2

Quote:
Originally Posted by alan_el_more View Post
how do i determine the color of each screenfade with a cvar for each?
From Jim's grenade trail:
PHP Code:
   get_pcvar_string(nadecolor9)
   new 
str_to_num(color)
   
1000000
   c 
%= 1000000 
   g 
1000
   b 
1000 
SnoW is offline
Send a message via MSN to SnoW
Dr.G
Senior Member
Join Date: Nov 2008
Old 03-31-2009 , 09:59   Re: help with screenfade
Reply With Quote #3

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 #4

@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
Dr.G
Senior Member
Join Date: Nov 2008
Old 03-31-2009 , 11:06   Re: help with screenfade
Reply With Quote #5

then you have to do like snow says. find Jim's grenade trail plugin and see how the values are passed on
__________________
Dr.G is offline
alan_el_more
Veteran Member
Join Date: Jul 2008
Location: amxmodx-es.com
Old 03-31-2009 , 11:23   Re: help with screenfade
Reply With Quote #6

sorry but do not understand the code
does any other way?
__________________
alan_el_more is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-31-2009 , 12:23   Re: help with screenfade
Reply With Quote #7

For transparency, set the last param (actually 250)
See my stock : http://forums.alliedmods.net/showthread.php?t=87623
__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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