Raised This Month: $12 Target: $400
 3% 

Show Menu Only after player choose team


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
brlight
Senior Member
Join Date: Jun 2011
Old 05-11-2014 , 14:53   Show Menu Only after player choose team
Reply With Quote #1

Hi, like title says I´m trying to display a Menu to players that enter Server but only after they choose one team (either T or CT). At the moment I have something like this:
PHP Code:
public showmenu(id)
{
    if( 
is_user_connected(id))
    {
        
Code Here
    
}

But if some player enter Server and doesnt choose any of the teams, menu is displayed while he is in Motd.Because user is actually "connected". How can I do so it will display only after choosing team?

Thanks in advance.


Regards,

brlight
brlight is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 05-11-2014 , 15:52   Re: Show Menu Only after player choose team
Reply With Quote #2

You can just check if the player is alive.

PHP Code:
public showmenu(id)
{
    if( 
is_user_connected(id))
    {
        
Code Here
    
}



PHP Code:
public showmenu(id)
{
    if( 
is_user_alive(id))
    {
        
Code Here
    
}

If you want show to CT and TT different menus, you can use cs_get_user_team or get_user_team.

Edit:If you want to show them a menu after they select a team even if they're dead you can use cs_get_user_team or get_user_team also.
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.

Last edited by wickedd; 05-11-2014 at 15:56.
wickedd is offline
brlight
Senior Member
Join Date: Jun 2011
Old 05-11-2014 , 17:28   Re: Show Menu Only after player choose team
Reply With Quote #3

Ok, one problem solved, many thanks!!
brlight is offline
swapped
BANNED
Join Date: Mar 2014
Location: OrpheuRegisterHook
Old 05-12-2014 , 03:51   Re: Show Menu Only after player choose team
Reply With Quote #4

another idea should be to check first spawn
swapped is offline
brlight
Senior Member
Join Date: Jun 2011
Old 05-12-2014 , 10:42   Re: Show Menu Only after player choose team
Reply With Quote #5

Thanks swapped but, how can i do that?
brlight is offline
GinNNy
Senior Member
Join Date: Mar 2014
Old 05-14-2014 , 15:11   Re: Show Menu Only after player choose team
Reply With Quote #6

You can use like this
PHP Code:
if(cs_get_user_team(idCS_TEAM_UNASSIGNED))
    {
        return
    }
    else
    {
        
Code
    


Last edited by GinNNy; 05-14-2014 at 15:12.
GinNNy is offline
brlight
Senior Member
Join Date: Jun 2011
Old 05-15-2014 , 18:11   Re: Show Menu Only after player choose team
Reply With Quote #7

Quote:
Originally Posted by GinNNy View Post
You can use like this
PHP Code:
if(cs_get_user_team(idCS_TEAM_UNASSIGNED))
    {
        return
    }
    else
    {
        
Code
    

Thank you so much for helping me!
I think you did a little mistake in that should be:
PHP Code:
if(cs_get_user_team(id) == CS_TEAM_UNASSIGNED)
    {
        return
    }
    else
    {
        
code here
    

brlight is offline
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 05-15-2014 , 18:26   Re: Show Menu Only after player choose team
Reply With Quote #8

If you want to show them the menu when they choose a team then just hook the TeamInfo event, the other replies don't make much sense
Backstabnoob is offline
GinNNy
Senior Member
Join Date: Mar 2014
Old 05-15-2014 , 20:03   Re: Show Menu Only after player choose team
Reply With Quote #9

Nope its should be cs_get_user_team(id) == blabla
GinNNy is offline
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 05-15-2014 , 20:04   Re: Show Menu Only after player choose team
Reply With Quote #10

No, he should hook TeamInfo, stop posting if you don't know what you're talking about
Backstabnoob is offline
Reply



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 21:52.


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