AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Fraglimit help (https://forums.alliedmods.net/showthread.php?t=65310)

CLLlAgOB 01-05-2008 18:29

Fraglimit help
 
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
}


taheri6 01-07-2008 00:54

Re: Fraglimit help
 
Quote:

Originally Posted by CLLlAgOB (Post 570629)
How to limit glasses if input of a command goes from a server?

What does that mean?

CLLlAgOB 01-12-2008 02:11

Re: Fraglimit help
 
Quote:

Originally Posted by taheri6 (Post 571302)
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;
}
//-----------------------------------------------------------------------------



All times are GMT -4. The time now is 11:08.

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