Raised This Month: $ Target: $400
 0% 

Blinded by the flash


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
alvedro
Member
Join Date: Feb 2012
Old 02-11-2012 , 14:20   Blinded by the flash
Reply With Quote #1

Hi,
How can I make a function that checks whether the player is blinded by the flash grenade?
alvedro is offline
Ex1ne
Senior Member
Join Date: Oct 2011
Location: Norway
Old 02-11-2012 , 15:10   Re: Blinded by the flash
Reply With Quote #2

Flashbang Remote Control API [Flash events]
__________________
Ex1ne is offline
alvedro
Member
Join Date: Feb 2012
Old 02-11-2012 , 15:56   Re: Blinded by the flash
Reply With Quote #3

It is too complicated for me. Do not have a single function can indicate if we are blinded - true or false?
alvedro is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 02-11-2012 , 16:07   Re: Blinded by the flash
Reply With Quote #4

http://forums.alliedmods.net/showpos...91&postcount=4

get_user_flashed(id, &iPercent=0)

return flash alpha (200 for semi blinded or 255 for full blinded) and pass by ref remaining blinded percentage.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 02-11-2012 at 16:08.
ConnorMcLeod is offline
LukeyB
Member
Join Date: Dec 2011
Old 02-12-2012 , 15:33   Re: Blinded by the flash
Reply With Quote #5

How can I get a bot to do something when flashed?

PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#include <fun>
#include <hamsandwich>
new const ActiveItemOffset 373;
new const 
ExtraOffset 5;
new 
g_bitFlashedPlayers
#define IsPlayerFlashed(%0)        g_bitFlashedPlayers & 1<<(%0&31)
public plugin_init()
{
 
register_forwardFM_CmdStart "fm_CmdStart" )
}
public 
fm_CmdStart(id)
{
 if(
is_user_bot(id) && is_user_alive(id) && IsPlayerFlashed(id) && user_has_weapon(idCSW_FLASHBANG) )
 {
  
engclient_cmd(id"weapon_flashbang")
  
ExecuteHam(Ham_Weapon_PrimaryAttackget_pdata_cbase(idActiveItemOffsetExtraOffset))
 }


Last edited by LukeyB; 02-12-2012 at 15:34.
LukeyB is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 02-12-2012 , 18:01   Re: Blinded by the flash
Reply With Quote #6

Quote:
Originally Posted by LukeyB View Post
How can I get a bot to do something when flashed?
Stop threadjacking, and stop to think that FM_CmdStart is the solution to everything, it's not at all.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
LukeyB
Member
Join Date: Dec 2011
Old 02-12-2012 , 20:25   Re: Blinded by the flash
Reply With Quote #7

Working with FM_CmdStart...if you have a better way, I am all for it.

PHP Code:
#include <amxmodx>
#include <cstrike>
#include <engine>
#include <fakemeta>
#include <fun>
#include <hamsandwich>
#define m_iFlashAlpha 518
#define ALPHA_FULLBLINDED 255
#define m_pActiveItem 373
#define XO_PLAYER 5
public plugin_init()
{
register_plugin("BotCounterFlash""1.0""LB")
register_forwardFM_CmdStart "fm_CmdStart" )
}
public 
fm_CmdStart(id)
{
new 
iFlashAlpha get_pdata_int(idm_iFlashAlphaXO_PLAYER)
if(
is_user_alive(id) && is_user_bot(id) && user_has_weapon(idCSW_FLASHBANG) && iFlashAlpha == ALPHA_FULLBLINDED)
{
engclient_cmd(id"weapon_flashbang")
ExecuteHam(Ham_Weapon_PrimaryAttackget_pdata_cbase(idm_pActiveItemXO_PLAYER))
}
if(
is_user_alive(id) && is_user_bot(id) && user_has_weapon(idCSW_HEGRENADE) && !user_has_weapon(idCSW_FLASHBANG) && iFlashAlpha == ALPHA_FULLBLINDED)
{
engclient_cmd(id"weapon_hegrenade")
ExecuteHam(Ham_Weapon_PrimaryAttackget_pdata_cbase(idm_pActiveItemXO_PLAYER))
}
if(
is_user_alive(id) && is_user_bot(id) && user_has_weapon(idCSW_SMOKEGRENADE) && !user_has_weapon(idCSW_FLASHBANG) && !user_has_weapon(idCSW_HEGRENADE) && iFlashAlpha == ALPHA_FULLBLINDED)
{
engclient_cmd(id"weapon_smokegrenade")
ExecuteHam(Ham_Weapon_PrimaryAttackget_pdata_cbase(idm_pActiveItemXO_PLAYER))
}


Last edited by LukeyB; 02-20-2012 at 09:39.
LukeyB is offline
Reply



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


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