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

Need something like preBotTakeOver event


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
intercostal_noisE
Member
Join Date: May 2014
Old 03-31-2015 , 18:30   Need something like preBotTakeOver event
Reply With Quote #1

think of a lonely beautifull island somewhere deep in the see ...

and now the problem:

- the player is dead
- he is spectating a bot
- the bot has flashlight on ... ( SetEntProp(client, Prop_Send, "m_fEffects", 4); )

... when the player overtakes the bot and botTakeOver was fired, the bot is controlled by player and has flashlight off (thats no problem, just have to enable it again)

... but a the location, where the player has overtaken the bot , the flashlight light conus is still present (see picture)
http://i.imgur.com/uwzBTdj.png

-> so i thought, the simpliest way is to disable the bots flashlight before the player overtakes it.

but how to do this? there is no pre event of botTakeOver (post/pre hook modes) and when botTakeOver is fired, the bot is already controlled by player...

or

is there an other way to remove that flashlight light conus?

thanks!

Last edited by intercostal_noisE; 03-31-2015 at 19:29.
intercostal_noisE is offline
intercostal_noisE
Member
Join Date: May 2014
Old 04-01-2015 , 08:43   Re: Need something like preBotTakeOver event
Reply With Quote #2

Got the answer:

the bot_takeover event has an userid and a botid

... while this
new client = GetClientOfUserId(GetEventInt(event, "userid"));
SetEntProp(client, Prop_Send, "m_fEffects", 4);
enables the flashlight on the client player id (controlling the bot)

... this
new bot = GetClientOfUserId(GetEventInt(event, "botid"));
SetEntProp(bot, Prop_Send, "m_fEffects", 0);
will disable the bots flashlight that was already activated

after this the player controlling the bot have flashlight on and the bots flashlight isnt shown anymore at the bots last location

XD

Last edited by intercostal_noisE; 04-01-2015 at 08:53.
intercostal_noisE is offline
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 04-01-2015 , 08:54   Re: Need something like preBotTakeOver event
Reply With Quote #3

I think you need TarotCards extension, then you can predict player's actions like bot_takeover etc.

PHP Code:
TarotPredict(callback"bot_takeover");

public 
callback()
{
    new 
client GetTarotValue("client");
    new 
bot GetTarotValue("bot");
    
    
// your code

KissLick is offline
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 04-01-2015 , 09:31   Re: Need something like preBotTakeOver event
Reply With Quote #4

If the bot_takeover event doesn't work by changing the value of the flashlight prop, then couldn't you use SDKHooks to do this? A prethink or something? Check if client is pressing USE key (if that's the key used to take over a bot), then check if they're spectating a bot, then check if that bot has the flashlight on and turn it off before the player takes control of the bot.

Or, in the bot_takeover event, use the RequestFrame to turn the flashlight off (or a quick 0.1 timer to do that).

Probably other ways as well.
__________________
View my Plugins | Donate
TnTSCS 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 23:37.


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