Raised This Month: $12 Target: $400
 3% 

CSS Block flash for team but allow flash for self


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Austinbots
Member
Join Date: Jan 2010
Old 04-28-2016 , 20:01   CSS Block flash for team but allow flash for self
Reply With Quote #1

Using the Sunglasses plugin as a start, thank you,
https://forums.alliedmods.net/showth...ght=sunglasses

I am trying to write a plugin where
1) Only bots can be flashed
2) You can't flash your teammates
3) You can flash yourself

I have 1+2 working but need help to figure out #3.

PHP Code:
#define ALPHA_SET 0.5
new g_iFlashAlpha = -1;

public 
OnPluginStart()
{
    
g_iFlashAlpha    FindSendPropOffs("CCSPlayer""m_flFlashMaxAlpha");
    
HookEvent("player_blind",Event_Flashed);
}

public 
Action:Event_Flashed(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"userid"));
    
    if (
IsFakeClient(client))
        return 
Plugin_Continue;    
    
    if (
g_iFlashAlpha != -1)
        
SetEntDataFloat(clientg_iFlashAlphaALPHA_SET);
        
    return 
Plugin_Handled;


Last edited by Austinbots; 04-28-2016 at 20:03.
Austinbots is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 04-28-2016 , 22:55   Re: CSS Block flash for team but allow flash for self
Reply With Quote #2

You could hook https://wiki.alliedmods.net/Counter-...hbang_detonate and write down the userid from that event, and possibly a time buffer
Mitchell is offline
zipcore
Veteran Member
Join Date: Mar 2010
Location: m_flZipcore
Old 04-28-2016 , 23:01   Re: CSS Block flash for team but allow flash for self
Reply With Quote #3

May this helps: https://raw.githubusercontent.com/mu...ts/flashmod.sp
__________________
zipcore is offline
Austinbots
Member
Join Date: Jan 2010
Old 05-21-2016 , 19:29   Re: CSS Block flash for team but allow flash for self
Reply With Quote #4

Quote:
Originally Posted by zipcore View Post
zipcore.
This not only answers my question and gives me exactly what I need,
it is an AWESOME plugin collection that is on a professional coding level.
It is an excellent resource for anyone writing plugs since they show how to do a wide variety of very useful things.

How did you find out about this?
Do you have any other collections to suggest?

THANK YOU!!!
Austinbots is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 05-21-2016 , 20:13   Re: CSS Block flash for team but allow flash for self
Reply With Quote #5

Anyone got this working in go?
__________________
Neuro Toxin is offline
Austinbots
Member
Join Date: Jan 2010
Old 05-22-2016 , 16:14   Re: CSS Block flash for team but allow flash for self
Reply With Quote #6

Quote:
Originally Posted by Neuro Toxin View Post
Anyone got this working in go?
I am still working on this.
It is close to working perfectly. Just need a few more days.
Austinbots is offline
Reply


Thread Tools
Display Modes

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 15:18.


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