Raised This Month: $ Target: $400
 0% 

Hook team Join.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 04-30-2012 , 12:41   Hook team Join.
Reply With Quote #1

How to hook Team Join event? If he joined a team, except for spectator, i want to show him a menu.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-30-2012 , 12:52   Re: Hook team Join.
Reply With Quote #2

Hook the TeamInfo event.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
mottzi
Veteran Member
Join Date: May 2010
Location: Switzerland
Old 04-30-2012 , 12:55   Re: Hook team Join.
Reply With Quote #3

Note that teaminfo also calls at roundstart.
__________________
Quote:
#define true ((rand() % 2)? true: false) //Happy debugging suckers
mottzi is offline
Send a message via MSN to mottzi
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 04-30-2012 , 12:59   Re: Hook team Join.
Reply With Quote #4

Can you give me an example of it? so i know how to work with it.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-30-2012 , 15:47   Re: Hook team Join.
Reply With Quote #5

Check the value from the TeamInfo event for the player's team against the last time the TeamInfo event was called for that player.
If the new team is a valid team (CT or Terrorist) and is not the same as the old team, then the player changed (or joined) to that team.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 04-30-2012 , 21:21   Re: Hook team Join.
Reply With Quote #6

Like i told you, i don't know how to work with this, and i asked for an example. I tried this but it didn't work any help?
PHP Code:
public GetTeamJoin(id) {
    if(
cs_get_user_team(id) == CS_TEAM_CT || cs_get_user_team(id) == CS_TEAM_T) {
        
ShowMenu(id)
    }

__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-30-2012 , 23:52   Re: Hook team Join.
Reply With Quote #7

http://forums.alliedmods.net/showpos...21&postcount=3
__________________
Bugsy is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 05-01-2012 , 06:23   Re: Hook team Join.
Reply With Quote #8

Quote:
Originally Posted by Bugsy View Post
Thanks, this helped me
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 05-01-2012 , 07:16   Re: Hook team Join.
Reply With Quote #9

Now, if i join the server, and i press 1. for Terrorist. After the menu of Team Choose popped up, the menu that i'm joining if changing to another team pops up...

Should i use set_task() for this, or is there another solution for this?
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
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:15.


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