Raised This Month: $ Target: $400
 0% 

Open menu after connect


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Debesėlis
Senior Member
Join Date: Aug 2008
Location: Lithuania
Old 12-23-2009 , 12:09   Open menu after connect
Reply With Quote #1

PHP Code:
public client_connectid )
{
        if ( 
is_user_connectedid ) & is_user_aliveid ) )
        {
            
show_menu(id);
        }

why doesn't show the menu?
Debesėlis is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 12-23-2009 , 12:25   Re: Open menu after connect
Reply With Quote #2

It would be best to show the menu after they join a team. client_connect is called when they connect, they aren't fully in the server yet.
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Mxnn
Veteran Member
Join Date: Aug 2009
Location: AT MY HOME
Old 12-23-2009 , 12:56   Re: Open menu after connect
Reply With Quote #3

You can use client_putinserver()
Mxnn is offline
Lure.d
BANNED
Join Date: Dec 2009
Location: Lithuania->USA
Old 12-23-2009 , 13:27   Re: Open menu after connect
Reply With Quote #4

Sorry for a bit of lithuanian, just want to welcome this guy, becouse hes from my country.
[IGNORE THIS IF YOUR NOT LTU]
Sveikas, paprasciausiai naudok:
public client_putinserver(), atsidaryk { }
ir viduje irasyk kad atidarytu meniu. Skype motd_lt daugiau info ;]

[/IGNORE THIS IF YOUR NOT LTU]

Here's code for it to open menu when player is connected.

PHP Code:
public client_putinserver(id) {
     
show_menu(id);
     } 
if you wane, you can make a delay, for e.g:
player joins, and usually takes ~1,2 secs,
to choose team so he could clearly see the menu.
(becouse the chooseteam menu is on top of
your menu. So you press to team 1, it chooses 1 option of ur menu.

Ok so we add 5 seconds delay: (and another block of code )
PHP Code:
public client_putinserver(id) {
     
set_task(0.5show_menu_cmdid);
     }
public 
show_menu_cmd(id) {
     
show_menu(id);
     } 
Notes, not sure for the show_menu_cmd in task - maybe,
you can just type in show_menu(id) , but it might give an error,
in mine case works fine

Last edited by Lure.d; 12-23-2009 at 13:30.
Lure.d is offline
Send a message via Skype™ to Lure.d
platzpatrone
Veteran Member
Join Date: Apr 2007
Location: Germany
Old 12-23-2009 , 14:07   Re: Open menu after connect
Reply With Quote #5

yeah Lure.d but the best way is to use the team_join event
after the team is choosen he gets the menu
platzpatrone is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 12-23-2009 , 14:27   Re: Open menu after connect
Reply With Quote #6

Quote:
Originally Posted by Lure.d View Post
Ok so we add 5 seconds delay: (and another block of code )
PHP Code:
public client_putinserver(id) {
     
set_task(0.5show_menu_cmdid);
     }
public 
show_menu_cmd(id) {
     
show_menu(id);
     } 
0.5 is half a second not 5 seconds.

BEST way would be to create a 2-5 second task on team_join/class_select and show the menu. This way you can make sure that they are ready.
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
worldspawn
Senior Member
Join Date: Aug 2009
Location: Russia, Yekaterinburg
Old 12-23-2009 , 15:33   Re: Open menu after connect
Reply With Quote #7

how to detect team_join/class_select?
worldspawn is offline
Send a message via ICQ to worldspawn Send a message via Skype™ to worldspawn
platzpatrone
Veteran Member
Join Date: Apr 2007
Location: Germany
Old 12-23-2009 , 16:07   Re: Open menu after connect
Reply With Quote #8

Quote:
Originally Posted by worldspawn View Post
how to detect team_join/class_select?
PHP Code:
register_event("TextMsg","team_join","a","1=1","2&Game_join_te","2&Game_join_ct"
platzpatrone is offline
Reply


Thread Tools
Display Modes

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 04:16.


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