Raised This Month: $51 Target: $400
 12% 

[CSS] Block player from join a team


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ecca
Sexy Santa
Join Date: Jan 2011
Old 12-29-2011 , 15:01   [CSS] Block player from join a team
Reply With Quote #1

Well, its a pretty easy part but i can't get it solved
I check the jointeam commando

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

Why doesnt it work?
__________________

Last edited by ecca; 12-29-2011 at 15:02.
ecca is offline
lokizito
Veteran Member
Join Date: Dec 2010
Location: Brazil
Old 12-29-2011 , 15:09   Re: [CSS] Block player from join a team
Reply With Quote #2

Quote:
Originally Posted by ecca View Post
Well, its a pretty easy part but i can't get it solved
I check the jointeam commando

PHP Code:
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.
__________________
[CS:S] RankMe - Why pay for a rank plugin if you can have one for free?
[CS:S] RankMe Connect Announcer - Announce when a player connect
Translation Project - Let's make the plugins to be international
lokizito is offline
Impact123
Veteran Member
Join Date: Oct 2011
Location: Germany
Old 12-29-2011 , 15:45   Re: [CSS] Block player from join a team
Reply With Quote #3

Quote:
Originally Posted by ecca View Post
PHP Code:
if (client == CS_TEAM_CT)
{
//Want to do something if he select this team

Why doesnt it work?
This Can't work.
PHP Code:
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
__________________
Impact123 is offline
ecca
Sexy Santa
Join Date: Jan 2011
Old 12-29-2011 , 16:00   Re: [CSS] Block player from join a team
Reply With Quote #4

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,
__________________
ecca is offline
databomb
Veteran Member
Join Date: Jun 2009
Location: california
Old 12-29-2011 , 16:23   Re: [CSS] Block player from join a team
Reply With Quote #5

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 got it spot on when he suggested you look more closely at the arguments for jointeam.
__________________

Last edited by databomb; 12-29-2011 at 16:25.
databomb is offline
ecca
Sexy Santa
Join Date: Jan 2011
Old 12-29-2011 , 16:29   Re: [CSS] Block player from join a team
Reply With Quote #6

You use cookies i use another way so i really dont get your code ;$
__________________
ecca is offline
ecca
Sexy Santa
Join Date: Jan 2011
Old 12-29-2011 , 19:37   Re: [CSS] Block player from join a team
Reply With Quote #7

Solved used #include <cstrike> instead
__________________

Last edited by ecca; 12-29-2011 at 19:57.
ecca is offline
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 12-29-2011 , 20:07   Re: [CSS] Block player from join a team
Reply With Quote #8

Quote:
Originally Posted by ecca View Post
Solved used #include <cstrike> instead
yes, you need to include <cstrike> if you use CS_TEAM_T or CS_TEAM_anything... unless you #define each one
TnTSCS is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 12-30-2011 , 09:41   Re: [CSS] Block player from join a team
Reply With Quote #9

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)

Last edited by Bacardi; 12-30-2011 at 09:42.
Bacardi 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 13:46.


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