Raised This Month: $ Target: $400
 0% 

How to get player joins team event ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
reinert
Veteran Member
Join Date: Feb 2007
Old 04-09-2011 , 11:38   How to get player joins team event ?
Reply With Quote #1

Hey, I how to get when player joins to CT or T team and print him a message etc. ???
reinert is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 04-09-2011 , 12:22   Re: How to get player joins team event ?
Reply With Quote #2

http://forums.alliedmods.net/showthread.php?t=153787
hornet is offline
Nyuszy
Senior Member
Join Date: Apr 2009
Old 04-09-2011 , 12:23   Re: How to get player joins team event ?
Reply With Quote #3

http://wiki.amxmodx.org/Half-Life_1_...vents#TeamInfo
Nyuszy is offline
reinert
Veteran Member
Join Date: Feb 2007
Old 04-09-2011 , 12:38   Re: How to get player joins team event ?
Reply With Quote #4

Thanks Nyuszy, thats what I wanted ;)
reinert is offline
reinert
Veteran Member
Join Date: Feb 2007
Old 04-09-2011 , 12:49   Re: How to get player joins team event ?
Reply With Quote #5

PHP Code:
register_event("ShowMenu","TeamSelect","b","4&Team_Select"
But how can I check where did player join ? UNASSIGNED, CT, T, or SPEC ?

I would like to print a message if player is CT or T...
PHP Code:
public TeamSelect(id)
{
    
client_print(idprint_chat"welcome")

reinert is offline
Nyuszy
Senior Member
Join Date: Apr 2009
Old 04-09-2011 , 13:56   Re: How to get player joins team event ?
Reply With Quote #6

i'm not sure but i think:
PHP Code:
register_event("TeamSelect""select_team""a"
PHP Code:
public select_team()
{
new 
id read_data(1)
new 
team[32]
read_data(2team31)
if(
equali(team"TERRORIST"))
{
     
// something
}
else if(
equali(team"CT"))
{
     
// something
}
else if(
equali(team"SPECTATOR"))
{
     
// something
}

Nyuszy is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-09-2011 , 16:37   Re: How to get player joins team event ?
Reply With Quote #7

No need to use equal

PHP Code:
switch ( team[0] )
{
 case 
'C':
 case 
'T':
 case 
'S':

Instead of read_data(2), you could also directly do switch( get_user_team(id) )
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
reinert
Veteran Member
Join Date: Feb 2007
Old 04-09-2011 , 16:45   Re: How to get player joins team event ?
Reply With Quote #8

Like this ?

PHP Code:
public select_team()
{
    new 
id read_data(1)
    switch( 
get_user_team(id) ) 
    {
        case 
1,2client_print(idprint_chat"Welcome")
    }

??
reinert is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 04-09-2011 , 17:05   Re: How to get player joins team event ?
Reply With Quote #9

Better todo with cstrike and then:

case: CS_TEAM_*
bibu is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-09-2011 , 18:14   Re: How to get player joins team event ?
Reply With Quote #10

Quote:
Originally Posted by bibu View Post
Better todo with cstrike and then:

case: CS_TEAM_*
Only if using the cstrike function cs_get_user_teams().
__________________
fysiks 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 19:48.


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