| 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;
}
//-----------------------------------------------------------------------------
|