AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   fadetoblack (https://forums.alliedmods.net/showthread.php?t=164751)

spiider 08-15-2011 11:16

fadetoblack
 
Hello,

is possible blind some users by steamid when is dead ?

Exolent[jNr] 08-15-2011 11:55

Re: fadetoblack
 
Yes, search for it.
(Here's a hint: I made it in Suggestions/Requests)

spiider 08-15-2011 14:51

Re: fadetoblack
 
yes i have search for that, but i only find with a file.
and i want make something like fade "steamid"

Exolent[jNr] 08-15-2011 15:04

Re: fadetoblack
 
PHP Code:

#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>

new bool:g_fade_to_black[33];

new 
ScreenFade;

public 
plugin_init()
{
    
register_plugin("FadeToBlack Per SteamID""0.1""Exolent");
    
    
register_concmd("amx_fadetoblack""CmdFadeToBlack"ADMIN_KICK"<nick, #userid, authid> <0|1>");
    
    
RegisterHam(Ham_Spawn"player""FwdPlayerSpawn"1);
    
RegisterHam(Ham_Killed"player""FwdPlayerDeath"1);
    
    
register_message((ScreenFade get_user_msgid("ScreenFade")), "MessageScreenFade");
}

public 
client_disconnect(client)
{
    
g_fade_to_black[client] = false;
}

public 
CmdFadeToBlack(clientlevelcid)
{
    if( !
cmd_access(clientlevelcid3) )
    {
        return 
PLUGIN_HANDLED;
    }
    
    new 
arg[35];
    
read_argv(1argcharsmax(arg));
    
    new 
target cmd_target(clientarg, (CMDTARGET_OBEY_IMMUNITY CMDTARGET_NO_BOTS));
    
    if( !
target )
    {
        return 
PLUGIN_HANDLED;
    }
    
    
read_argv(2argcharsmax(arg));
    
    new 
bool:fade = (arg[0] == '1');
    
    if( 
fade == g_fade_to_black[target] )
    {
        
console_print(client"Target currently %s fade to black"fade "has" "does not have");
        return 
PLUGIN_HANDLED;
    }
    
    
g_fade_to_black[target] = fade;
    
    if( !
is_user_alive(target) )
    {
        
make_ScreenFade(target00, ( _:fade 0x0004 ), 000, ( _:fade 255 ) );
    }
    
    new 
name[32], targetName[32];
    
get_user_name(clientnamecharsmax(name));
    
get_user_name(targettargetNamecharsmax(targetName));
    
    
show_activity(clientname"%s fade to black %s %s"fade "set" "removed"fade "on" "from"target_name);
    
    return 
PLUGIN_HANDLED;
}

public 
FwdPlayerSpawn(client)
{
    if( 
is_user_alive(client) && g_fade_to_black[client] )
    {
        
make_ScreenFade(client000x00000000);
    }
}

public 
FwdPlayerDeath(client)
{
    if( 
g_fade_to_black[client] )
    {
        
make_ScreenFade(client000x0004000255);
    }
}

public 
MessageScreenFade(msgiddestclient)
{
    return (!
g_fade_to_black[client] || is_user_alive(client)) ? PLUGIN_CONTINUE PLUGIN_HANDLED;
}

make_ScreenFade(clientdurationholdtimeflagsrgba)
{
    
message_begin(MSG_ONEScreenFade_client);
    
write_short(duration);
    
write_short(holdtime);
    
write_short(flags);
    
write_byte(r);
    
write_byte(g);
    
write_byte(b);
    
write_byte(a);
    
message_end();




All times are GMT -4. The time now is 19:50.

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