Raised This Month: $ Target: $400
 0% 

Ban from ct team


Post New Thread Reply   
 
Thread Tools Display Modes
unnyquee
Senior Member
Join Date: Jun 2009
Location: Constanta, Romania
Old 03-12-2010 , 09:37   Re: Ban from ct team
Reply With Quote #11

In case you might refer to what Brreaker said..

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>

#define ACCESS ADMIN_BAN // your access level
#define isPlayer(%1) (1 <= %1 <= get_maxplayers())

new bool:g_bClientBanned[32];

public 
plugin_init()
{
      
register_plugin("Ban for Joining CT Team""0.0.1""benamo6");
      
      
register_event("TextMsg""eJoiningCT""b""2=#Cstrike_TitlesTXT_Game_join_ct");
      
      
register_concmd("amx_ctban""_ctBan"ACCESS"<nickname> <status> - sets whether <nickname> can join the CT team or not");
}

public 
_ctBan(idlevelcid)
{
      if(!
cmd_access(idlevelcid3))
      {
            return 
PLUGIN_HANDLED;
      }
      
      new 
szNickname[32], szStatus[2];
      new 
iStatusiTarget;
      
      
read_argv(1szNickname31);
      
read_argv(2szStatus1);
      
      
iStatus str_to_num(szStatus);
      
      
iTarget cmd_target(idszNickname8);
      
      if(!
iTarget || !isPlayer(iTarget))
      {
            return 
PLUGIN_HANDLED;
      }
      
      if(
iStatus == 1)
      {
            
g_bClientBanned[iTarget] = true;
      }
      
      else 
      {
            
g_bClientBanned[iTarget] = false;
      }
      
      return 
PLUGIN_HANDLED;
}

public 
eJoiningCT(id)
{
      if(
g_bClientBanned[id] == true)
      {
            
client_print(idprint_chat"* You have been banned from joining the CT Team.");
            
client_print(idprint_chat"* You have been moved to SPECTATORS.");
      }
      
      
_moveToSpec(id);
}

_moveToSpec(id)
{
      
cs_set_user_team(idCS_TEAM_SPECTATOR);

..Hope that will do the trick!

Non-tested!
__________________

Last edited by unnyquee; 03-12-2010 at 09:49.
unnyquee is offline
benamo6
Veteran Member
Join Date: Aug 2008
Location: NeverLand
Old 03-12-2010 , 10:13   Re: Ban from ct team
Reply With Quote #12

fR4gn0tiX! you got it right. I need that.
and unny that would work if player stay in server. Because steamid or any playerinfo isnt saved in some data file, so if he reconnect the bool will be false.
__________________
Please help me with this Thread
I am 70% addicted to Counterstrike. What about you?
Ill make any spanish translation of a plugin. Just ask for it
benamo6 is offline
Send a message via MSN to benamo6
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 09:33.


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