PDA

View Full Version : [CSS] Block player from join a team


ecca
12-29-2011, 15:01
Well, its a pretty easy part but i can't get it solved
I check the jointeam commando


if (client == CS_TEAM_CT)
{
//Want to do something if he select this team
}

Why doesnt it work?

lokizito
12-29-2011, 15:09
Well, its a pretty easy part but i can't get it solved
I check the jointeam commando


if (client == CS_TEAM_CT)
{
//Want to do something if he select this team
}

Why doesnt it work?
The problem is that when the jointeam is used, player will be at his current team. It will only change after it is runned. So, you need to check its args.
You need to return Plugin_Handled for when you wanna block it. Don't forget to return Plugin_Continue to allow joining a team otherwise you will be unable to join any team.

Impact123
12-29-2011, 15:45
if (client == CS_TEAM_CT)
{
//Want to do something if he select this team
}

Why doesnt it work?
This Can't work.

SomeCallBack(client)
{
new team = GetClientTeam(client);
if(team == CS_TEAM_CT)
{
// We won't allow him to go to ct..
return Plugin_Handled;
}

return Plugin_Continue;
}

Post your whole code.

Yours sincerely
Impact

ecca
12-29-2011, 16:00
I havent written the code because i cant get it work

I wanna block that he can join CT and return a message to him,

databomb
12-29-2011, 16:23
Azelphur's Team Bans, my CT Ban, and Jailbreak Team Balance all have this code, so you may want to search one of those plugins for 'jointeam' to see some examples. lokizito (http://forums.alliedmods.net/member.php?u=100978) got it spot on when he suggested you look more closely at the arguments for jointeam.

ecca
12-29-2011, 16:29
You use cookies i use another way so :P i really dont get your code ;$

ecca
12-29-2011, 19:37
Solved used #include <cstrike> instead :P

TnTSCS
12-29-2011, 20:07
Solved used #include <cstrike> instead :P

yes, you need to include <cstrike> if you use CS_TEAM_T or CS_TEAM_anything... unless you #define each one

Bacardi
12-30-2011, 09:41
Teams are numbers
0 = no team (usually when spawn on server)
1 = spectators (team 1)
2 = team 2 (Terrorist example)
3 = team 3 (Counter Terrorist example)