AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Show After Team (https://forums.alliedmods.net/showthread.php?t=167764)

deadman909 09-19-2011 20:11

Show After Team
 
How would one make something appear only after one chooses a team.

Like after they join the Team have it Say You have joined the TERRORIST TEAM.

Doc-Holiday 09-19-2011 20:23

Re: Show After Team
 
When first joining a team it fires teaminfo when you select a team and a model so when its >= 2 its when the player has fully choosen a team.
PHP Code:

new iTeamInfoCounter[33];

register_event("TeamInfo""eTeamInfo""a");

public 
eTeamInfo() 

    new 
id read_data(1);
    new 
szTeam[2];
    
read_data(2szTeamcharsmax(szTeam));
    switch(
szTeam[0])
    {
        case 
'T'
        {
            if(++
iTeamInfoCounter[id] >= 2)
            {
                
//Terror waiting for reSpawn
            
}
        }
        case 
'C'
        {
            if(++
iTeamInfoCounter[id] >= 2)
            {
                
//CT Waiting for ReSpawn
            
}
        }
        case 
'S':
        {
            
//Switch to Spectate
        
}
    }



deadman909 09-19-2011 23:21

Re: Show After Team
 
This makes the message appear every time the new round starts. Is there a way to set it so it only appears the first time they connect or reconnect to server?

Doc-Holiday 09-19-2011 23:26

Re: Show After Team
 
Quote:

Originally Posted by deadman909 (Post 1559185)
This makes the message appear every time the new round starts. Is there a way to set it so it only appears the first time they connect or reconnect to server?

change it ==2 not >=

deadman909 09-20-2011 00:21

Re: Show After Team
 
Quote:

Originally Posted by Doc-Holiday (Post 1559188)
change it ==2 not >=

That worked but now msg doesnt show after a player reconnects.

Doc-Holiday 09-20-2011 01:14

Re: Show After Team
 
Quote:

Originally Posted by deadman909 (Post 1559211)
That worked but now msg doesnt show after a player reconnects.

on player disconnect you have to reset the counter :)

deadman909 09-20-2011 05:22

Re: Show After Team
 
Quote:

Originally Posted by Doc-Holiday (Post 1559227)
on player disconnect you have to reset the counter :)

Hmm I know it is

public client_disconnect()
{
// But not sure what goes here.
}

Doc-Holiday 09-20-2011 05:33

Re: Show After Team
 
Quote:

Originally Posted by deadman909 (Post 1559303)
Hmm I know it is

public client_disconnect(id)
{
// But not sure what goes here.
}

iTeamInfoCounter[id] = 0 <---- Make sure that matches the variable in the above code.

jim_yang 09-20-2011 08:04

Re: Show After Team
 
register_event("TextMsg", "Join_T", "a", "2&#Game_join_t")
register_event("TextMsg", "Join_CT", "a", "2&#Game_join_ct")

hleV 09-20-2011 08:15

Re: Show After Team
 
http://forums.alliedmods.net/showthread.php?t=63818


All times are GMT -4. The time now is 19:44.

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