Raised This Month: $ Target: $400
 0% 

Fraglimit help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
CLLlAgOB
Senior Member
Join Date: Oct 2007
Location: Russia
Old 01-05-2008 , 18:29   Fraglimit help
Reply With Quote #1

How to limit glasses if input of a command goes from a server? Excuse me, I badly speak on English
This kick work only if myac_fraglimit = 0
Code:
 
register_concmd("myac_kick","kick_now",ADMIN_LEVEL_A,"[USER_ID] [REASON]")
---------------------------------------------------------------
 
public kick_now(id,level,cid)
{
 if (!cmd_access(id, level, cid, 2))
  return PLUGIN_HANDLED
 
 new num[10], reas[32]
 read_argv(1,num,9)
 read_argv(2, reas, 31)
 remove_quotes(reas)
 new numb=str_to_num(num)
 new Frags
 Frags = get_user_frags(id)
 if(Frags >= get_cvar_num("myac_fraglimit"))
  {
  server_cmd("kick #%d ^"%s^"",numb, reas)
  } 
 return PLUGIN_CONTINUE 
}

Last edited by CLLlAgOB; 01-05-2008 at 18:33.
CLLlAgOB is offline
taheri6
Member
Join Date: Mar 2006
Old 01-07-2008 , 00:54   Re: Fraglimit help
Reply With Quote #2

Quote:
Originally Posted by CLLlAgOB View Post
How to limit glasses if input of a command goes from a server?
What does that mean?
__________________
http://www.yaur.com -=[Yaur]=- Clan Website
taheri6 is offline
CLLlAgOB
Senior Member
Join Date: Oct 2007
Location: Russia
Old 01-12-2008 , 02:11   Re: Fraglimit help
Reply With Quote #3

Quote:
Originally Posted by taheri6 View Post
What does that mean?
I mean if you send command myac_kick 5 without # .
I have solved this problem:
Code:
//-----------------------------------------------------------------------------
/* Flags:
*  1 - obey immunity
*  2 - allow yourself
*  4 - must be alive
*  8 - can't be bot */
stock cmd_target_id(id,const arg[],flags = 1) 
{
 new player = find_player("bl", arg);
 if(player)
 {
  if (player != find_player("blj",arg)) 
  {
#if defined AMXMOD_BCOMPAT
   console_print(id, SIMPLE_T("There are more clients matching to your argument"));
#else
   console_print(id,"%L",id,"MORE_CL_MATCHT");
#endif
   return 0;
  }
 }
 // NOTE: there is implicit search by authid!
 else if((player = find_player("c", arg)) == 0 && arg[0])
 {
  player = find_player("k", str_to_num(arg[0])); // search by userid
 }
 if (!player)
 {
#if defined AMXMOD_BCOMPAT
  console_print(id, SIMPLE_T("Client with that name, userid not found"));
#else
  //console_print(id,"%L",id,"CL_NOT_FOUND");
  console_print(id,"Client with that name, userid not found");
#endif
  return 0;
 }
 if(flags & 1)
 {
  if ((get_user_flags(player)&ADMIN_IMMUNITY) && ((flags&2)?(id!=player):true) ) 
  {
   new imname[32];
   get_user_name(player,imname,31);
#if defined AMXMOD_BCOMPAT
   console_print(id, SIMPLE_T("Client ^"%s^" has immunity"), imname);
#else
   console_print(id,"%L",id,"CLIENT_IMM",imname);
#endif
   return 0;
  }
 }
 if(flags & 4)
 {
  if (!is_user_alive(player)) 
  {
   new imname[32];
   get_user_name(player,imname,31);
#if defined AMXMOD_BCOMPAT
   console_print(id, SIMPLE_T("That action can't be performed on dead client ^"%s^""), imname);
#else
   console_print(id,"%L",id,"CANT_PERF_DEAD",imname);
#endif
   return 0;
  }
 }
 if(flags & 8)
 {
  if (is_user_bot(player)) 
  {
   new imname[32];
   get_user_name(player,imname,31);
#if defined AMXMOD_BCOMPAT
   console_print(id, SIMPLE_T("That action can't be performed on bot ^"%s^""), imname);
#else
   console_print(id,"%L",id,"CANT_PERF_BOT",imname);
#endif
   return 0;
  }
 }
 return player;
}
//-----------------------------------------------------------------------------
CLLlAgOB is offline
Reply


Thread Tools
Display Modes

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 11:08.


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