AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   New round events (https://forums.alliedmods.net/showthread.php?t=25249)

Werewolf 03-10-2006 16:14

New round events
 
How can the mod see if it is a new round?
Found this. Not working, or my mod menu is wierd.
Code:
register_event("HLTV", "event_new_round", "a", "1=0", "2=0")
If it is my menu that is wierd then tell me what is wrong here.
Code:
public ChooseClass(id) {     new menu[192]     format(menu, 191, "*: Choose Class^n^n1. *^n2. *^n3. *^n4. *^n^n5. *^n6. *^n^n0. Exit")     new key = KEY_1|KEY_2|KEY_3|KEY_4|KEY_5|KEY_6|KEY_0       show_menu(id, key, menu, -1, "ChooseClass")     }

Jordan 03-10-2006 18:53

I think it has to be MENU_KEY_1, but post your whole code to lemme see.

Werewolf 03-11-2006 05:53

Yes I know but I defined the keys. Check this.
Code:

//Define keys
#define KEY_1      (1<<0)
#define KEY_2      (1<<1)
#define KEY_3      (1<<2)
#define KEY_4      (1<<3)
#define KEY_5      (1<<4)
#define KEY_6      (1<<5)
#define KEY_7      (1<<6)
#define KEY_8      (1<<7)
#define KEY_9      (1<<8)
#define KEY_0      (1<<9)

Should be no problems with that :P

VEN 03-11-2006 08:52

Not enough information on the problem.

Werewolf 03-11-2006 09:52

I know what the problem is now. I made a test menu. It wont show up and I did in same way as in my mod :?
This was the menu I used in my test :wink:
Code:
public test(id) { new menu[192] format(menu, 191, "Select power^n^n1. Godmode!^n2. Noclip!^n^n0. Exit") new key = KEY_1|KEY_2|KEY_0 show_menu(id, key, menu) } public testkeys(id, key) {     switch(key)     {         case 0:         {         if(!is_user_admin(id)) {         client_print(id, print_chat, "You do not have access to that power.")         } else {         set_user_godmode(id, 1)         }         }         case 1:         {         if(!is_user_admin(id)) {         client_print(id, print_chat, "You do not have access to that power.")         } else {         set_user_noclip(id, 1)         }         }         case 9:         {         return PLUGIN_CONTINUE         }     }     return PLUGIN_CONTINUE }
And my keys is always defined as (1<<0) etc.

[ --<-@ ] Black Rose 03-11-2006 10:31

how do you call the menu?
its a lot easier if you would post the WHOLE script

Werewolf 03-11-2006 10:36

Omg. If you want to see whole script then here you have it.
Code:
#include <amxmodx> #include <amxmisc> #include <fun> #define KEY_1 (1<<0) #define KEY_2 (1<<1) #define KEY_3 (1<<2) #define KEY_4 (1<<3) #define KEY_5 (1<<4) #define KEY_6 (1<<5) #define KEY_7 (1<<6) #define KEY_8 (1<<7) #define KEY_9 (1<<8) #define KEY_0 (1<<9) public plugin_init() {     register_plugin("test", "1.00", "Werewolf")             register_clcmd("say menu", "test")     register_clcmd("say_team menu", "test")     register_clcmd("say /menu", "test")     register_clcmd("say_team /menu", "test")             register_menucmd(register_menuid("test"),1023,"testkeys") } public test(id) {     new menu[1024]     format(menu, 1023, "Select power^n^n1. Godmode!^n2. Noclip!^n^n0. Exit")     new key = KEY_1|KEY_2|KEY_0     show_menu(id, key, menu) } public testkeys(id, key) {     switch(key)     {         case 0:         {         if(!(get_user_flags(id)&ADMIN_IMMUNITY)) {         client_print(id, print_chat, "You do not have access to that power.")         return PLUGIN_HANDLED         } else {         set_user_godmode(id, 1)         }         }         case 1:         {         if(!(get_user_flags(id)&ADMIN_IMMUNITY)) {         client_print(id, print_chat, "You do not have access to that power.")         return PLUGIN_HANDLED         } else {         set_user_noclip(id, 1)         }         }         case 9: return PLUGIN_CONTINUE     }     return PLUGIN_CONTINUE }
There. I hope you can help me now.
*EDIT*
WORKS NOW!!!!

Brad 03-11-2006 11:51

Quote:

Originally Posted by Werewolf
Omg. If you want to see whole script then here you have it.
<code snipped>
There. I hope you can help me now.

Nice attitude.

Werewolf 03-11-2006 14:04

Quote:

Originally Posted by Brad
Quote:

Originally Posted by Werewolf
Omg. If you want to see whole script then here you have it.
<code snipped>
There. I hope you can help me now.

Nice attitude.

Hehe. Well I added everything that was a part of this thread before so I got a bit annoyed :lol: . And you didn't have to post anything more to this thread because I already found the problem and fixed it. Without any help. Only scratched my head for a while and checked some include files. 1 more thing. Lock this thread please :)
No need to have it unlocked when the problem is solved :wink:


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

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