AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   Help with counting scores (https://forums.alliedmods.net/showthread.php?t=58162)

Floppe 07-20-2007 04:46

Help with counting scores
 
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 :(

BAILOPAN 07-20-2007 09:19

Re: Help with counting scores
 
If the event doesn't fire, that probably means the game/mod is never bothering to fire it for you.

ferret 07-20-2007 10:36

Re: Help with counting scores
 
as a minor note, shouldn't his callback be tagged as Action?

Floppe 07-20-2007 11:17

Re: Help with counting scores
 
Quote:

Originally Posted by ferret (Post 505798)
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?

teame06 07-20-2007 11:18

Re: Help with counting scores
 
Quote:

Originally Posted by ferret (Post 505798)
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.

Floppe 07-20-2007 17:21

Re: Help with counting scores
 
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.


All times are GMT -4. The time now is 12:23.

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