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(client, g_iFlashAlpha, ALPHA_SET);
return Plugin_Handled;
}