AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   A bug found?? (https://forums.alliedmods.net/showthread.php?t=11505)

Menion 03-21-2005 12:32

A bug found??
 
register_event("ShowMenu", "set_player_team", "b", "Team_Select") <--- Catches every ShowMenu-event - weird? Yeah, I know... It catches the BuyMenu and so on...

Anyone knows why?

NiGHTFiRE 03-21-2005 12:33

try this:
Code:
register_event("ShowMenu", "set_player_team", "2", "Team_Select")

Freecode 03-21-2005 12:33

because those are menus :/ u are registering an event for every single player

Menion 03-21-2005 12:44

Quote:

Originally Posted by NiGHTFiRE
try this:
Code:
register_event("ShowMenu", "set_player_team", "2", "Team_Select")

Now it doesn't catch the event at all...

Menion 03-21-2005 12:45

Quote:

Originally Posted by Freecode
because those are menus :/ u are registering an event for every single player

So what do you recommend?

Freecode 03-21-2005 13:26

are u sure its called Team_Select?
try printing all args for ShowMenu event when u r in team menu

XxAvalanchexX 03-21-2005 14:04

The fourth through infinitive parameters for register_event are conditions. "Team_Select" isn't a condition. Here are some examples of how to use it, from amxmodx.inc:

* Examples for conditions:
* "2=c4" - 2nd parameter of message must be sting "c4".
* "3>10" - 3rd parameter must be greater then 10.
* "3!4" - 3rd must be different from 4.
* "2&Buy" - 2nd parameter of message must contain "Buy" substring.
* "2!Buy" - 2nd parameter of message can't contain "Buy" substring. */


All times are GMT -4. The time now is 14:01.

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