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

Help with counting scores


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Floppe
Junior Member
Join Date: Jun 2007
Old 07-20-2007 , 04:46   Help with counting scores
Reply With Quote #1

Why doesn't this work?

Code:
public OnPluginStart()
{
  if(!HookEventEx("team_score", Event_TeamScore))
  {
    decl String:Error[PLATFORM_MAX_PATH + 64];
    FormatEx(Error, sizeof(Error), "FATAL *** ERROR ***");
    SetFailState(Error);
  }
}

public Event_TeamScore(Handle:event, const String:name[], bool:dontBroadcast)
{
  LogMessage("EVENT TeamScore FIRED!");
}
No errors, no fired event
Floppe is offline
BAILOPAN
Join Date: Jan 2004
Old 07-20-2007 , 09:19   Re: Help with counting scores
Reply With Quote #2

If the event doesn't fire, that probably means the game/mod is never bothering to fire it for you.
__________________
egg
BAILOPAN is offline
ferret
SourceMod Developer
Join Date: Dec 2004
Location: Atlanta, GA
Old 07-20-2007 , 10:36   Re: Help with counting scores
Reply With Quote #3

as a minor note, shouldn't his callback be tagged as Action?
__________________
I'm a blast from the past!
ferret is offline
Floppe
Junior Member
Join Date: Jun 2007
Old 07-20-2007 , 11:17   Re: Help with counting scores
Reply With Quote #4

Quote:
Originally Posted by ferret View Post
as a minor note, shouldn't his callback be tagged as Action?
I borrowed the code from your plugin mapchooser ;)

If not with team_score, then how should I read the team scores?

Last edited by Floppe; 07-20-2007 at 11:21. Reason: another way?
Floppe is offline
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 07-20-2007 , 11:18   Re: Help with counting scores
Reply With Quote #5

Quote:
Originally Posted by ferret View Post
as a minor note, shouldn't his callback be tagged as Action?
It only should be tag as action if he hooks pre hook. There are two functag for HookEvent look for funcenum EventHook.
__________________
No private support via Instant Message
GunGame:SM Released

Last edited by teame06; 07-20-2007 at 11:59.
teame06 is offline
Send a message via AIM to teame06
Floppe
Junior Member
Join Date: Jun 2007
Old 07-20-2007 , 17:21   Re: Help with counting scores
Reply With Quote #6

One solution found that's not so nice.

Made global integers which increases on each round_end depending on which team wins and all counters are reseted on game_start.
Floppe 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 22:26.


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