Raised This Month: $ Target: $400
 0% 

no need for this


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 06-03-2019 , 09:20   Re: Start Round Effect for CSS
Reply With Quote #2

something like:

PHP Code:
#define PLUGIN_VERSION "1.0"

#pragma semicolon 1
#pragma newdecls required

#include <sourcemod>

UserMsg g_FadeUserMsgId;

public 
APLRes AskPluginLoad2(Handle myselfbool latechar[] errorint err_max)
{
    
g_FadeUserMsgId GetUserMessageId("Fade");
    if (
g_FadeUserMsgId == INVALID_MESSAGE_ID) {
        
strcopy(errorerr_max"Cannot find Fade user message ID.");
        return 
APLRes_SilentFailure;
    }
    return 
APLRes_Success;
}

public 
void OnPluginStart()
{
    
HookEvent("round_start",             Event_RoundStart,    EventHookMode_PostNoCopy);
}

public 
void Event_RoundStart(Event eventchar[] namebool dontBroadcast)
{
    for (
int i 1<= MaxClientsi++)
        if (
IsClientInGame(i) && !IsFakeClient(i))
            
BlindClient(i128);
}

stock void BlindClient(int targetint amount)
{
    
int targets[2];
    
targets[0] = target;
    
    
int holdtime;
    
int duration 0;

    
int flags;
    if (
amount == 0)
    {
        
flags = (0x0001 0x0010);
        
holdtime 10000;
    }
    else
    {
        
flags = (0x0002 0x0008);
        
holdtime 10;
    }
    
    
int color[4] = { 000};
    
color[3] = amount// 255 for the full blind
    
    
Handle message StartMessageEx(g_FadeUserMsgIdtargets1);
    if (
GetUserMessageType() == UM_Protobuf)
    {
        
Protobuf pb UserMessageToProtobuf(message);
        
pb.SetInt("duration"duration);
        
pb.SetInt("hold_time"holdtime);
        
pb.SetInt("flags"flags);
        
pb.SetColor("clr"color);
    }
    else
    {
        
BfWrite bf UserMessageToBfWrite(message);
        
bf.WriteShort(duration);
        
bf.WriteShort(holdtime);
        
bf.WriteShort(flags);
        
bf.WriteByte(color[0]);
        
bf.WriteByte(color[1]);
        
bf.WriteByte(color[2]);
        
bf.WriteByte(color[3]);
    }
    
EndMessage();

__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline
 



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 03:14.


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