Raised This Month: $ Target: $400
 0% 

Strange Menu Error


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
xeroblood
BANNED
Join Date: Mar 2004
Location: Toronto, Canada
Old 02-28-2005 , 09:49  
Reply With Quote #7

Well, problem is that client_connect() is called before they are actually put in the server.. And even then, you have to wait until they pick a team and model... Once that happens, they are in-game and can now see menus and stuff..

So, you could delay showing the menu until the event ResetHUD is called for each connecting user...

something like this:

Code:
#include <amxmodx> new g_bJustJoined[33] = false public plugin_init() {     new keys = MENU_KEY_0|MENU_KEY_1|MENU_KEY_2     register_menucmd(register_menuid("*********"), keys, "BlahBlah")     register_event( "ResetHUD", "ResetHud", "b" ) } public client_connect(id) {     g_bJustJoined[id] = true     return PLUGIN_CONTINUE } public ResetHud( id ) {     if( g_bJustJoined[id] )     {         ShowMenu( id )         g_bJustJoined[id] = false     }     return PLUGIN_CONTINUE } stock ShowMenu( id ) {     new menu[192]     new keys = MENU_KEY_0|MENU_KEY_1|MENU_KEY_2     format(menu, 191, "*********^n^n1. *******^n2. *****^n3. ****")     show_menu(id, keys, menu) } public BlahBlah(id,key) {     if (key == 0)     {          client_print(id, print_chat, "******************")     } else if (key == 1) {          client_print(id, print_chat, "*****************")     } else if (key == 2) {          client_print(id, print_chat, "***************")     } }
xeroblood is offline
Send a message via MSN to xeroblood
 



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 14:02.


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