Raised This Month: $ Target: $400
 0% 

if (killed by bomb)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Flynn
Senior Member
Join Date: Sep 2009
Old 09-28-2009 , 23:29   Re: if (killed by bomb)
Reply With Quote #1

Quote:
Originally Posted by meng View Post
no weapon either. pretty sure the event isnt called. would make sense since death by bomb doesnt count as a death in the players score. intercepted by the engine!
Now my head is screwed on, is there a bomb event (aha lateral thinking) that is called by the bomb? When it occurs, have it check for any deaths within a given timeframe.

For example (Pseudo Code warning!)
Code:
 
public BombPreEvent()
{
  StoreAlivePlayersToArray();
  CreateTimer(0.3,Check);
}
 
public CheckStoredPlayers()
{
  for()
  {
    if(Stored[X] == dead)
    {
      DeathByBomb[Stored[X]] = true;
    }
  }
}
 
public Action:Check(Handle:timer)
{
  CheckStoredPlayers();
}
You get the idea. Store all the currently alive players to an array *before* the bomb event using a prehook, then check for any of them who have died after the bomb event has occurred and set them as death by bomb.

Obviously downside is that it might catch non-bomb related deaths during that split-second frame (unless they trigger a death_event, in which case you can tell it to set death by bomb as false again - because our bomb doesn't apparently trigger that).
Flynn is offline
Send a message via MSN to Flynn Send a message via Skype™ to Flynn
meng
Veteran Member
Join Date: Oct 2005
Location: us
Old 09-29-2009 , 00:10   Re: if (killed by bomb)
Reply With Quote #2

thx,

maybe check between bomb_exploded and round_start? but, how the hell do i keep track of that? is there a set interval by the engine there? maybe create a timer for the same time?
meng is offline
Send a message via Yahoo to meng
Flynn
Senior Member
Join Date: Sep 2009
Old 10-01-2009 , 13:28   Re: if (killed by bomb)
Reply With Quote #3

Quote:
Originally Posted by meng View Post
maybe check between bomb_exploded and round_start? but, how the hell do i keep track of that? is there a set interval by the engine there? maybe create a timer for the same time?
Well, just setup an array of currently alive players on the bomb explosion, and then a timer after a matter of 0.5 seconds later to check who of the previously alive players died.
Flynn is offline
Send a message via MSN to Flynn Send a message via Skype™ to Flynn
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 18:21.


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