AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   (req) help me with this (https://forums.alliedmods.net/showthread.php?t=180421)

bazhenov93 03-15-2012 12:35

(req) help me with this
 
don't know if i already created this some days ago, but could find it, so maybe no or i posted in incorrect section and it was deleted.

this image was taken not on my server, I talked with the coder, but he don't want give the code.. so maybe one of you know how to do it
http://cs11244.userapi.com/u52706343/-7/y_88423bdb.jpg

when you type /pause, the screen turn in blue colour

and when you type /pause again, the screen back to normal..

PHP Code:

public Pause(id)
{
if (
get_pcvar_num(kz_pause) == 0)
{    
kz_hud_message(id"Pause is disabled")
return 
PLUGIN_HANDLED
}

if(! 
timer_started[id])
{
kz_hud_message(id"Timer is not started")
return 
PLUGIN_HANDLED
}

if(! 
is_user_alive(id) )
{
kz_hud_message(id"You must be alive to use this command")
return 
PLUGIN_HANDLED
}


if( ( 
pevidpev_flags ) & FL_ONGROUND2 ) )
{
if(!
IsPaused[id]) 
{
g_pausetime[id] = get_gametime() - timer_time[id]
timer_time[id] = 0.0
IsPaused
[id] = true
kz_hud_message
(id"Your timer has been paused")
set_pev(idpev_flagspev(idpev_flags) | FL_FROZEN)
pev(idpev_originPauseOrigin[id])
}
else
{
timer_time[id] = get_gametime() - g_pausetime[id] + timer_time[id]
IsPaused[id] = false
kz_hud_message
(id"Your timer has been unpaused")
set_pev(idpev_flagspev(idpev_flags) & ~FL_FROZEN)
}
}
else
kz_hud_message(id"You must be on ground to get paused")

return 
PLUGIN_HANDLED


what I need add to make this screen?

bilalpro 03-15-2012 12:36

Re: (req) help me with this
 
Try to search for screenfade information, in other plugins or on our forums.

Emp` 03-15-2012 12:53

Re: (req) help me with this
 
https://forums.alliedmods.net/showthread.php?t=87623

bazhenov93 03-15-2012 14:32

Re: (req) help me with this
 
WHAT IS WRONG HERE? :(


PHP Code:

public Pause(id)
{
    
    if (
get_pcvar_num(kz_pause) == 0)
    {    
        
kz_hud_message(id"Pause is disabled")
        return 
PLUGIN_HANDLED
    
}

    if(! 
timer_started[id])
    {
        
kz_hud_message(id"Timer is not started")
        return 
PLUGIN_HANDLED
    
}
    
    if(! 
is_user_alive(id) )
    {
        
kz_hud_message(id"You must be alive to use this command")
        return 
PLUGIN_HANDLED
    
}


    if( ( 
pevidpev_flags ) & FL_ONGROUND2  ) )
    {
        if(!
IsPaused[id]) 
        {
            
      if( 
get_pcvar_numgCvar_Screenfade ))
            { 
            new 
Color_redColor_greenColor_blue;
            new 
color[16], red[4], green[4], blue[4];
            
get_pcvar_string(gCvar_Colorcolor15);
            
parse(colorred3green3blue3);
            
            
Color_red str_to_num(red);
            
Color_green str_to_num(green);
            
Color_blue str_to_num(blue);
                
            
UTIL_ScreenFadeid, {gCvar_Color},1.0,0.0,75  );
            }
            
            
g_pausetime[id] =   get_gametime() - timer_time[id]
            
timer_time[id] = 0.0
            IsPaused
[id] = true
            
            kz_hud_message
(id"Your timer has been paused")
            
set_pev(idpev_flagspev(idpev_flags) | FL_FROZEN)
            
pev(idpev_originPauseOrigin[id])
            
            
        }
        else
        {
            
timer_time[id] = get_gametime() - g_pausetime[id] + timer_time[id]
            
IsPaused[id] = false
            kz_hud_message
(id"Your timer has been unpaused")
            
set_pev(idpev_flagspev(idpev_flags) & ~FL_FROZEN)
        }
    }
    else
        
kz_hud_message(id"You must be on ground to get paused")

    return 
PLUGIN_HANDLED



Xvil 03-15-2012 14:51

Re: (req) help me with this
 
Post the full Script

bazhenov93 03-15-2012 15:03

Re: (req) help me with this
 
<removed code>

Exolent[jNr] 03-15-2012 15:04

Re: (req) help me with this
 
Don't post long code. Attach the .sma file instead.

bazhenov93 03-15-2012 15:21

Re: (req) help me with this
 
1 Attachment(s)
here you go


All times are GMT -4. The time now is 03:54.

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