AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Hook team Join. (https://forums.alliedmods.net/showthread.php?t=184065)

Napoleon_be 04-30-2012 12:41

Hook team Join.
 
How to hook Team Join event? If he joined a team, except for spectator, i want to show him a menu.

Exolent[jNr] 04-30-2012 12:52

Re: Hook team Join.
 
Hook the TeamInfo event.

mottzi 04-30-2012 12:55

Re: Hook team Join.
 
Note that teaminfo also calls at roundstart.

Napoleon_be 04-30-2012 12:59

Re: Hook team Join.
 
Can you give me an example of it? so i know how to work with it.

Exolent[jNr] 04-30-2012 15:47

Re: Hook team Join.
 
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.

Napoleon_be 04-30-2012 21:21

Re: Hook team Join.
 
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)
    }



Bugsy 04-30-2012 23:52

Re: Hook team Join.
 
http://forums.alliedmods.net/showpos...21&postcount=3

Napoleon_be 05-01-2012 06:23

Re: Hook team Join.
 
Quote:

Originally Posted by Bugsy (Post 1699699)

Thanks, this helped me :)

Napoleon_be 05-01-2012 07:16

Re: Hook team Join.
 
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?


All times are GMT -4. The time now is 07:46.

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