
 ///////////////////////////////////////
 //  Finds the target of the command  //
 ///////////////////////////////////////
 bool:get_info(id, arg1[], name[], namelen, bool:console=true, player_return[MAX_PLAYERS], &pnum_return, bool:admin=true)
 {
	#if RCON_POKEADMINS == 1
	if( id && !(get_user_flags(id)&ADMIN_RCON) && admin ){
		player_return[0] = id;
		pnum_return = 1;
		get_user_name(id, name, namelen);
		return true;
	}
	#endif

	new placeholder[33]
	new players[MAX_PLAYERS], pnum, pid, found = 0;
	poke_get_players(players, pnum)
	remove_quotes(arg1)
	replace_all(arg1,31," ", EMPTY)

	for(new i=0; i<pnum; i++){
		pid = players[i]
		get_user_name(pid, placeholder, 32)
		replace_all(placeholder,32," ", EMPTY)
		if(containi(placeholder, arg1) != -1 || equali(placeholder, arg1)){
			if( found ){
				if(console)
					PokeAdminNotice(id,"Znaleziono graczy z takim samym nickiem.")
				else
					poke_print(id, print_chat, "Znaleziono graczy z takim samym nickiem.")
				return false;
			}
			found = pid
			get_user_name(pid, name, namelen)
		}
	}
	if( found ){
		player_return[0] = found;
		pnum_return = 1;
		return true;
	}
	else {

		//check for all first, because in some mods, @A is a team
		if(equali(arg1,"@ALL") || equali(arg1,"*")){
			copy(name,namelen,"everyone");
			poke_get_players(player_return, pnum_return);
		}

		#if MOD==CS
		else if(equali(arg1,"@T",2)){
			copy(name,namelen,"all Terrorists");
			poke_get_players(players, pnum, "e", 1);
		}
		#endif
		#if MOD==DOD
		else if(equali(arg1,"@AL",3)){
			copy(name,namelen,"all Allieds");
			poke_get_players(players, pnum, "e", 1);
		}
		#endif
		#if MOD==NS
		else if(equali(arg1,"@M",2)){
			copy(name,namelen,"all Marines");
			poke_get_players(players, pnum, "e", 1);
		}
		#endif

		#if MOD==CS
		else if(equali(arg1,"@C",2)){
			copy(name,namelen,"all Counter-Terrorists");
			poke_get_players(players, pnum, "e", 2);
		}
		#endif
		#if MOD==DOD
		else if(equali(arg1,"@AX",3)){
			copy(name,namelen,"all Axis");
			poke_get_players(players, pnum, "e", 2);
		}
		#endif
		#if MOD==NS
		else if(equali(arg1,"@A",2)){
			copy(name,namelen,"all Aliens");
			poke_get_players(players, pnum, "e", 2);
		}
		#endif

		else if(equali(arg1,"@BOT")){
			copy(name,namelen,"all Bots");
			poke_get_players(player_return, pnum_return, "d");
		}

		if( pnum_return < 1 ){
			if(console)
				PokeAdminNotice(id,"Nie znaleziono gracza/druzyny.");
			else
				poke_print(id, print_chat, "Nie znaleziono gracza/druzyny.");
			return false;
		}
	}
	return true;
 }
 bool:GetPlayersPokes(id, target_id=0, pname[NAME_LENGTH], poke[MAX_POKES], pokenum[1], endname[NAME_LENGTH])
 {
	if( equal(pname, AT, 1) || equal(pname, STAR, 1) ){
		if(equali(pname,"@ALL") || equali(pname,STAR)){
			copy(endname,NAME_LENGTH-1,"pokemon")
			pokenum[0] = MAX_POKES
			for(new i=0; i<pokenum[0]; i++)
				poke[i] = PlayersPoke[target_id][i]
		}
		else if(isdigit(pname[1]) && 0<str_to_num(pname[1])<MAX_POKES){
			new temp[25]
			new apple = str_to_num(pname[1])
			pokenum[0] = 1
			poke[0] = PlayersPoke[target_id][apple-1]
			switch(apple)
			{
				case 1,21,31,41,51,61,71,81,91,101,121,131,141,151:
					formatex(temp, 25,"%dst pokemon",apple)
				case 2,22,32,42,52,62,72,82,92,102,122,132,142:
					formatex(temp, 25,"%dnd pokemon",apple)
				case 3,23,33,43,53,63,73,83,93,103,123,133,143:
					formatex(temp, 25,"%drd pokemon",apple)
				default:{
					formatex(temp, 25,"%dth pokemon",apple)
				}
			}
			copy(endname,NAME_LENGTH-1,temp)
		}
		else if(pname[1]=='C'){
			pokenum[0] = 1
			poke[0] = PlayersPoke[target_id][PlayersActive[id]]
			copy(endname,NAME_LENGTH-1,"current pokemon")
		}
		else{
			PokeAdminNotice(id,"Nieprawidlowy wybor pokemona")
			return false
		}
	}
	else{
		new apple = NameToPoke(pname);
		if( apple ){
			PokeToName(apple, endname, NAME_LENGTH);
			pokenum[0] = 1;
			poke[0] = apple;
		}
	}

	if( !pokenum[0] )
	{
		PokeAdminNotice(id,"Nieprawidlowy pokemon.")
		return false
	}

	return true
 }
 
 ////////////////////
 //  Sets pokemon  //
 ////////////////////
 public admin_setpoke(id)
 {
	if(!poke_access(id))
		return PokeAdminNoticeAccess(id)

	if(!PMon())
		return PokeAdminNoticeOff(id)

	if (read_argc() > 3) {	//thank you SHmod
		PokeAdminNotice(id,"Too many arguments supplied. Do not use a space in the name.")
		return PokeAdminNotice(id,"You only need to put in a partial name to use this command.")
	}

	new arg1[32], pname[NAME_LENGTH]
	read_argv(1,arg1,31)
	read_argv(2,pname,NAME_LENGTH-1)

	if(isdigit(pname[0]))
		return PokeAdminNotice(id,"Usage: pm_setpoke <nick | @TEAM | @ALL> <pokemon name>")

	new name[32], poke = NameToPoke(pname)
	new players[MAX_PLAYERS], pnum, tid
	if( !get_info(id,arg1,name,31,true,players,pnum) )
		return PLUGIN_HANDLED

	if(!ValidPoke(poke))
		return PokeAdminNotice(id,"Invalid pokemon name.")

	#if RCON_POKEADMINS == 1
	if( SpecialPoke(poke) && !(get_user_flags(id)&ADMIN_RCON) )
		return PokeAdminNotice(id,"You cannot set special pokemon.")
	#endif

	PokeToName(poke, pname, NAME_LENGTH)	//make sure it is capitalized correctly

	for(new i=0; i<pnum; i++){
		tid = players[i]
		Pokemon[tid] = poke
	}

	if( pnum == 1 )
		PokeAdminNotice(id,"%s jest teraz %s.",name,pname)
	else
		PokeAdminNotice(id,"%s sa teraz %ss.",name,pname)

	new command[255]
	formatex(command, 254, "zamienil %s w %s.",name, pname)
	AdminPrint( id, command)

	return PLUGIN_HANDLED
 }
 
 ////////////////////
 //  Give pokemon  //
 ////////////////////
 public admin_givepoke(id)
 {
	if(!poke_access(id))
		return PokeAdminNoticeAccess(id)

	if(!PMon())
		return PokeAdminNoticeOff(id)

	if (read_argc() > 4) {	//thank you SHmod
		PokeAdminNotice(id,"Too many arguments supplied. Do not use a space in the name.")
		return PokeAdminNotice(id,"You only need to put in a partial name to use this command.")
	}

	new arg1[32], pname[NAME_LENGTH], amount[25]
	read_argv(1,arg1,31)
	read_argv(2,pname,NAME_LENGTH-1)
	read_argv(3,amount,24)

	if( isdigit(pname[0]) || ( amount[0] && !isdigit(amount[0]) ) )
		return PokeAdminNotice(id,"Usage: pm_givepoke <nick | @TEAM | @ALL> <pokemon name> <level>")

	new name[32], poke, level = str_to_num(amount)
	new players[MAX_PLAYERS], pnum, tid
	if( !get_info(id,arg1,name,31,true,players,pnum) )
		return PLUGIN_HANDLED

	poke = NameToPoke(pname)
	if(!ValidPoke(poke))
		return PokeAdminNotice(id,"Niewlasciwa nazwa pokemona.")

	#if RCON_POKEADMINS == 1
	if( SpecialPoke(poke) && !(get_user_flags(id)&ADMIN_RCON) )
		return PokeAdminNotice(id,"Nie mozesz dac specjalnego pokemona.")
	#endif

	if(equali(amount,EMPTY))
		level = 1
	else if( TotalLevels < level || level < 1 )
		return PokeAdminNotice(id,"Niewlasciwy poziom.")

	new xp = PokeLevels[level-1]+1
	PokeToName(poke, pname, NAME_LENGTH)	//make sure it is capitalized correctly

	new bool:givegood = true;
	for(new i=0; i<pnum; i++){
		tid = players[i]

		if( pnum == 1 )
			switch( AvailableSlot(tid, poke) )
			{
				case AS_NOGOOD:		return PokeAdminNotice(id,"You cannot give pokemon to wild players.");
				case AS_NOROOM:		return PokeAdminNotice(id,"%s has too many pokemon.",name);
				case AS_DUPLICATE:	return PokeAdminNotice(id,"%s already has a %s.",name,pname);
				case AS_OK:			givegood = AddPoke(tid, poke, xp, id);
			}
		else if( AvailableSlot(tid, poke) == AS_OK )
			AddPoke(tid, poke, xp, id);
	}

	if( givegood )
		PokeAdminNotice(id,"%s otrzymal poziom %d %s.",name,level,pname)
	else
		PokeAdminNotice(id,"Nie mozna dac %s z poziomem %d %s.",name,level,pname)

	new command[255]
	if( givegood )
		formatex(command, 254, "daje %s z poziomem %d %s.",name, level, pname)
	else
		formatex(command, 254, "nie moze dac %s z poziomem %d %s.",name, level, pname)
	AdminPrint( id, command)

	return PLUGIN_HANDLED
 }
 
 ////////////////////
 //  Take pokemon  //
 ////////////////////
 public admin_takepoke(id)
 {
	if(!poke_access(id))
		return PokeAdminNoticeAccess(id)

	if(!PMon())
		return PokeAdminNoticeOff(id)

	if (read_argc() > 3) {	//thank you SHmod
		PokeAdminNotice(id,"Too many arguments supplied. Do not use a space in the name.")
		return PokeAdminNotice(id,"You only need to put in a partial name to use this command.")
	}

	new arg1[32], pname[NAME_LENGTH], endname[NAME_LENGTH]
	read_argv(1,arg1,31)
	read_argv(2,pname,NAME_LENGTH-1)

	if(isdigit(pname[0]))
		return PokeAdminNotice(id,"Usage: pm_takepoke <nick | @TEAM | @ALL> <pokemon | @ALL | @#>")

	new name[32], poke[MAX_POKES], pokenum[1]
	new players[MAX_PLAYERS], pnum, tid
	if( !get_info(id,arg1,name,31,true,players,pnum) )
		return PLUGIN_HANDLED

	new bool:valid_poke = GetPlayersPokes(id, _, pname, poke, pokenum, endname)
	if(!valid_poke)
		return PLUGIN_HANDLED

	new i, j;

	for( i=0; i<pnum; i++){
		tid = players[i]
		GetPlayersPokes(id, tid, pname, poke, pokenum, endname)

		for( j=0; j<pokenum[0]; j++){
			if( pnum == 1 ){
				if( HasPokemon(tid, poke[j], CHECK_ALL)==-1 && pokenum[0]==1)
					return PokeAdminNotice(id,"%s nie ma %s.",name,endname)
				else
					ReleasePoke(tid, poke[j], false)
			}
			else if(HasPokemon(tid, poke[j], CHECK_ALL))
				ReleasePoke(tid, poke[j], false)
		}
	}

	PokeAdminNotice(id,"%s wypuscil %s.",name,endname)

	new command[255]
	formatex(command, 254, "%s wypuscil %s.",name, endname)
	AdminPrint( id, command)

	return PLUGIN_HANDLED
 }
 /////////////////
 //  Show help  //
 /////////////////
 public admin_help(id)
 {
	if(!poke_access(id))
		return PokeAdminNoticeAccess( id );

	new arg1[8], flags = get_user_flags(id)
	new start = read_argv(1, arg1, 7) ? str_to_num(arg1) : 1
	new lHelpAmount = 10
	
	if (id == 0 && read_argc() == 3)
		lHelpAmount = read_argv(2, arg1, 7) ? str_to_num(arg1) : 10

	if (--start < 0)
		start = 0

	new clcmdsnum = get_concmdsnum(flags, id)

	if (start >= clcmdsnum)
		start = clcmdsnum - 1

	new help_title[31]
	formatex(help_title, 30, "%L", id, "HELP_COMS")
	replace(help_title, 30, "AMX Mod X", "PokeMod")
	console_print(id, "\n----- %s -----", help_title)

	new info[128], cmd[32], eflags
	new end = start + lHelpAmount // HELPAMOUNT

	if (end > clcmdsnum)
		end = clcmdsnum

	new actualfound
	for (new i = 0; i < clcmdsnum; i++)
	{
		get_concmd(i, cmd, 31, eflags, info, 127, flags, id)
		#if PM_ADMIN_COMMANDS==1
		if( !equal( cmd,"pm_",3 ) )
			continue
		#endif
		actualfound++
		if(actualfound > start && actualfound < end)
			console_print(id, "%3d: %s %s", actualfound, cmd, info)
	}

	if (end > actualfound)
		end = actualfound
	
	console_print(id, "----- %L -----", id, "HELP_ENTRIES", start + 1, end, actualfound)

	if (end < actualfound)
		formatex(help_title, 30, "%L", id, "HELP_USE_MORE", end + 1)
	else
		formatex(help_title, 30, "%L", id, "HELP_USE_BEGIN")

	#if PM_ADMIN_COMMANDS==1
	replace(help_title, 30, "amx_help", "pm_help")
	#endif

	console_print(id, "----- %s -----", help_title)

	return PLUGIN_HANDLED
 }
 
 ///////////////////////
 //  Give xp pokemon  //
 ///////////////////////
 public admin_givexp(id)
 {
	if(!poke_access(id))
		return PokeAdminNoticeAccess(id)

	if(!PMon())
		return PokeAdminNoticeOff(id)

	if (read_argc() > 4) {	//thank you SHmod
		PokeAdminNotice(id,"Too many arguments supplied. Do not use a space in the name.")
		return PokeAdminNotice(id,"You only need to put in a partial name to use this command.")
	}

	new arg1[32], pname[NAME_LENGTH], amount[25], poke_num, endname[NAME_LENGTH]
	read_argv(1,arg1,31)
	read_argv(2,pname,NAME_LENGTH-1)
	read_argv(3,amount,24)

	if(!(isdigit(amount[0]) || (equal(amount,DASH,1) && isdigit(amount[1]))))
		return PokeAdminNotice(id,"Usage: pm_givexp <nick | @TEAM | @ALL> <pokemon | @ALL | @#> <amount>")

	new name[32], poke[MAX_POKES], pokenum[1], xp = str_to_num(amount)
	new players[MAX_PLAYERS], pnum, tid
	if( !get_info(id,arg1,name,31,true,players,pnum) )
		return PLUGIN_HANDLED

	new bool:valid_poke = GetPlayersPokes(id, _, pname, poke, pokenum, endname)
	if(!valid_poke)
		return PLUGIN_HANDLED

	if(!xp)
		return PokeAdminNotice(id,"Niewlasciwa ilosc doswiadczenia.")

	new i, j;
	for( i=0; i<pnum; i++){
		tid = players[i]
		GetPlayersPokes(id, tid, pname, poke, pokenum, endname)

		for( j=0; j<pokenum[0]; j++){
			poke_num = HasPokemon(tid, poke[j])
			if(poke_num>=0){
				if( pnum == 1 && poke_num < 0 && pokenum[0] == 1 )
					return PokeAdminNotice(id,"%s nie ma %s.",name,endname)

				GiveXP(tid, poke_num, xp)
				Check_Evolve(tid, poke[j])
			}
		}
	}

	PokeAdminNotice(id,"%s's %s otrzyma; %dexp.",name,endname,xp)

	new command[255]
	formatex(command, 254, "dal %s's %s %dexp.",name, endname, xp)
	AdminPrint( id, command)

	return PLUGIN_HANDLED
 }
 
 ///////////////////////
 //  Sets pokemon xp  //
 ///////////////////////
 public admin_setxp(id)
 {
	if(!poke_access(id))
		return PokeAdminNoticeAccess(id)

	if(!PMon())
		return PokeAdminNoticeOff(id)

	if (read_argc() > 4) {	//thank you SHmod
		PokeAdminNotice(id,"Too many arguments supplied. Do not use a space in the name.")
		return PokeAdminNotice(id,"You only need to put in a partial name to use this command.")
	}

	new arg1[32], pname[NAME_LENGTH], amount[25], poke_num, endname[NAME_LENGTH]
	read_argv(1,arg1,31)
	read_argv(2,pname,NAME_LENGTH-1)
	read_argv(3,amount,24)

	if(!(isdigit(amount[0]) || (equal(amount[0],"-",1) && isdigit(amount[1]))))
		return PokeAdminNotice(id,"Usage: pm_setxp <nick | @TEAM | @ALL> <pokemon | @ALL | @#> <amount>")

	new name[32], poke[MAX_POKES], pokenum[1], xp = str_to_num(amount)
	new players[MAX_PLAYERS], pnum, tid
	if( !get_info(id,arg1,name,31,true,players,pnum) )
		return PLUGIN_HANDLED

	new bool:valid_poke = GetPlayersPokes(id, _, pname, poke, pokenum, endname)
	if(!valid_poke)
		return PLUGIN_HANDLED

	if(xp<1)
		return PokeAdminNotice(id,"Niewlasciwa ilosc doswiadczenia.")

	new i, j;
	for( i=0; i<pnum; i++){
		tid = players[i]
		GetPlayersPokes(id, tid, pname, poke, pokenum, endname)

		for( j=0; j<pokenum[0]; j++){
			poke_num = HasPokemon(tid, poke[j])
			if( poke_num >= 0 ){
				PlayersXP[tid][poke_num] = xp
				Check_Evolve(tid, poke[j])
			}
			else if( pnum == 1 && pokenum[0] == 1 )
				return PokeAdminNotice(id,"%s nie ma %s.",name,endname)
		}
	}

	PokeAdminNotice(id,"%s's %s zostal ustawiony na %dexp.",name,endname,xp)

	new command[255]
	formatex(command, 254, "ustawil %s's %s's doswiadczenie do %d.",name, endname, xp)
	AdminPrint( id, command)

	return PLUGIN_HANDLED
 }
 
 ///////////////////////
 //  Sets pokemon lv  //
 ///////////////////////
 public admin_setlvl(id)
 {
	if(!poke_access(id))
		return PokeAdminNoticeAccess(id)

	if(!PMon())
		return PokeAdminNoticeOff(id)

	if (read_argc() > 4) {	//thank you SHmod
		PokeAdminNotice(id,"Too many arguments supplied. Do not use a space in the name.")
		return PokeAdminNotice(id,"You only need to put in a partial name to use this command.")
	}

	new arg1[32], pname[NAME_LENGTH], amount[25], poke_num, endname[NAME_LENGTH]
	read_argv(1,arg1,31)
	read_argv(2,pname,NAME_LENGTH-1)
	read_argv(3,amount,24)

	if(!(isdigit(amount[0]) || (equal(amount,DASH,1) && isdigit(amount[1]))))
		return PokeAdminNotice(id,"Usage: pm_setlvl <nick | @TEAM | @ALL> <pokemon | @ALL | @#> <level>")

	new name[32], poke[MAX_POKES], pokenum[1], lvl = str_to_num(amount)
	new players[MAX_PLAYERS], pnum, tid
	if( !get_info(id,arg1,name,31,true,players,pnum) )
		return PLUGIN_HANDLED

	new bool:valid_poke = GetPlayersPokes(id, _, pname, poke, pokenum, endname)
	if(!valid_poke)
		return PLUGIN_HANDLED

	if( TotalLevels < lvl || lvl < 1 )
		return PokeAdminNotice(id,"Niewlasciwy poziom.")

	new i, j;
	for( i=0; i<pnum; i++){
		tid = players[i]
		GetPlayersPokes(id, tid, pname, poke, pokenum, endname)

		for( j=0; j<pokenum[0]; j++){
			poke_num = HasPokemon(tid, poke[j], CHECK_ALL)
			if( poke_num >= 0 ){
				PlayersXP[tid][poke_num] = PokeLevels[lvl-1]+1
				Check_Evolve(tid, poke[j])
			}
			else if( pnum == 1 && pokenum[0] == 1 )
				return PokeAdminNotice(id,"%s does not have %s.",name,endname)
		}
	}

	PokeAdminNotice(id,"%s's %s ustawil poziom %d.",name,endname,lvl)

	new command[255]
	formatex(command, 254, "ustaswil %s's %s's poziom do %d.",name, endname, lvl)
	AdminPrint( id, command)

	return PLUGIN_HANDLED
 }
 
 //////////////////////////////////
 //  Resets PokeMod to defaults  //
 //////////////////////////////////
 public admin_reset(id)
 {
	if(!(get_user_flags(id)&ADMIN_RCON ) && id )
		return PokeAdminNoticeAccess(id)

	new arg1[32], command[255], con_print[255]
	read_argv(1,arg1,31)

	formatex(command, 254, "reset %s.",arg1)
	formatex(con_print, 254, "%s reset.",arg1)

	if(equali(arg1,"config"))
		ResetConfig()
	else if(equali(arg1,"pokemon")){
		ResetPokemon()
		ReadPokemon(0)
		ReadPokemon(1)
	}
	else if(equali(arg1,"skills")){
		ResetSkillInfo()
		ReadSkills()
		ReadPokemon(0)
		ReadPokemon(1)
	}
	else if(equali(arg1,"items")){
		ResetPokemart()
		ReadItems(1)
	}
	else if(equali(arg1,"safari")){
		ResetSafari()
	}
	else if(equali(arg1,"maps"))
		ResetMapsConfig()
	else if(equali(arg1,"xp")){
		ResetXPs()
		ReadXPs()
	}
	else if(equali(arg1,"all")){
		ResetConfig()
		ResetPokemart()
		ResetSafari()
		ResetMapsConfig()
		ResetSkillInfo()
		ResetPokemon()
		ResetXPs()

		StartPokeMod(0);

		copy(command, 254, "reset all PokeMod files.")
		copy(con_print, 254, "All files reset.")
	}
	else{
		PokeAdminNotice(id, "Please specify what to reset.")
		return PokeAdminNotice(id, "Available Resets: config ; pokemon ; skills ; items ; safari ; maps ; xp ; all")
	}

	PokeAdminNotice(id,con_print)

	AdminPrint( id, command)

	return PLUGIN_HANDLED
 }
 
 /////////////////////////
 //  Loads saved cvars  //
 /////////////////////////
 public admin_loadconfig(id)
 {
	if(!(get_user_flags(id)&ADMIN_CVAR ) && id )
		return PokeAdminNoticeAccess(id)

	StartPokeMod(0);
	PokeAdminNotice(id,"Config Files Loaded.");

	AdminPrint( id, "loaded the PokeMod config files.");

	return PLUGIN_HANDLED;
 }
 
 ///////////////////////
 //  Erases saved XP  //
 ///////////////////////
 public admin_erasexp(id)
 {
	if(!(get_user_flags(id)&ADMIN_RCON ) && id )
		return PokeAdminNoticeAccess(id)

	PokeAdminNotice(id,"Please wait while everything is erased.")

	cleanXP(true)
	new players[MAX_PLAYERS], pnum, tid, i, k;
	get_players(players, pnum);
	for( i = 0; i < pnum; i++ ){
		tid = players[i];
		Pokemon[tid] = 0;
		for( k = 0; k<MAX_POKES; k++){
			PlayersPoke[tid][k] = 0;
			PlayersXP[tid][k] = 0;
		}
		client_connect(tid);
	}

	PokeAdminNotice(id,"Everything erased successfully.")

	new command[255]
	copy(command, 254, "erased all PokeMod experience and levels.")
	AdminPrint( id, command)

	return PLUGIN_HANDLED
 }
 
 /////////////////////////////
 //  Prints admin commands  //
 /////////////////////////////
 public AdminPrint( id, text[])
 {
	new name[32];
	get_user_name(id, name, 31);

	switch( get_pcvar_num(amx_show_activity) ){
		case 1: poke_print(0, print_chat, "[Admin] Admin %s", text);
		case 2: poke_print(0, print_chat, "[Admin] %s %s", name, text);
	}

	new authid[35];
	get_user_authid(id, authid, 34);
	log_amx("%s: \"%s<%d><%s><>\" %s", PREFIX, name, get_user_userid(id), authid, text);
 }

 //////////////////////////////////////////////
 //  If user has access to PokeMod commands  //
 //////////////////////////////////////////////
 poke_access(id)
 {
	if( !id )
		return true

	new accessflags[11]
	get_ppcvar_string(pm_admin, accessflags, 10)
	return ( get_user_flags(id) & read_flags(accessflags) )
 }
 
 //////////////////////////////////////////////////
 //  displays/changes information about pokemod  //
 //////////////////////////////////////////////////
 public Console_Pokemod(id)
 {
	if(!PM_disabled && !PMon() && !poke_access(id) && 0<id<=MAX_PLAYERS)
		return PokeAdminNoticeOff(id)

	new arg1[32], arg2[32];
	read_argv(1,arg1,31);
	read_argv(2,arg2,31);

	if(	equali(arg1,EMPTY)
	||	((PM_disabled || !poke_access(id)) && 0<id<=MAX_PLAYERS)
	){
		//display info about pokemod
		switch(PM_disabled)
		{
			case 0:{
				if( PMon() )
					if(Safari())
						console_print(id, "[PokeMod is set to SAFARI");
					else{
						console_print(id, "[PokeMod is set to ON");
						if(SaveXPon())
							console_print(id, "[Saving is set to ON");
						else
							console_print(id, "[Saving is set to OFF");
					}
				else
					console_print(id, "[PokeMod is set to OFF");
			}
			case 1:{
				new missing = poke_missing_files();
				if( missing == 1 )
					console_print(id, "[PokeMod is Missing a File" );
				else
					console_print(id, "[PokeMod is Missing %d Files", missing );
			}
			case -1:{
				console_print(id, "[PokeMod has its Skills Disabled (no precache)");
			}
			case -2:{
				console_print(id, "[PokeMod has its Skills Disabled");
			}
		}

		console_print(id, "[Version : %s",VERSION);
		console_print(id, "[PokeMod Team : %s",POKETEAM);
		if(get_ppcvar_num(pm_debug)){
			new debug_key[51];
			get_ppcvar_string(pm_debug_key, debug_key, 50);
			console_print(id, "[Debug is '%d' : '%s'",get_ppcvar_num(pm_debug),debug_key);
		}
		return PLUGIN_HANDLED;
	}

	new PokeFile[128];
	Poke_FileName( F_ModConfig, PokeFile);

	if(equali(arg1,"on")){
		if(PMon())
			return PokeAdminNotice(id, "jest wlaczony");

		PokeAdminNotice(id, "is now ON");
		set_ppcvar_num(pm_pokemod, 1);
		set_ppcvar_line(pm_pokemod, "1");
	}
	else if(equali(arg1,"off")){
		if(!PMon())
			return PokeAdminNotice(id, "jest wylaczony");

		PokeAdminNotice(id, "is now OFF");
		set_ppcvar_num(pm_pokemod, 0);
		set_ppcvar_line(pm_pokemod, "0");
	}
	else if(equali(arg1,"safari")){
		if(equali(arg2,"on")){
			if(!Safari()){
				save_all();
				PokeAdminNotice(id, "Safari jest wlaczone");
				set_ppcvar_num(pm_safari_mode, 1);
				set_ppcvar_line(pm_safari_mode, "1");
			}
			else
				PokeAdminNotice(id, "Safari jest wlaczone.");
		}
		else if(equali(arg2,"off")){
			if(Safari()){
				PokeAdminNotice(id, "Safari is now OFF");
				set_ppcvar_num(pm_safari_mode, 0);
				set_ppcvar_line(pm_safari_mode, "0");
				load_all();
			}
			else
				PokeAdminNotice(id, "Safari jest wylaczone.");
		}
	}
	else if(equali(arg1,"debug")){
		if(equal(arg2,EMPTY)){
			new debug_key[51];
			get_ppcvar_string(pm_debug_key, debug_key, 50);
			PokeAdminNotice(id, "Debug is '%d' : '%s'",get_ppcvar_num(pm_debug),debug_key);
		}
		else{
			new debug_value = str_to_num(arg2);
			if(!debug_value && !equali(arg2,"0") && !equali(arg2,"off")){
				set_ppcvar_string(pm_debug_key, arg2);
				set_ppcvar_line(pm_debug_key, arg2);
				PokeAdminNotice(id, "Debug Key is now '%s'",arg2);
			}
			else{
				set_ppcvar_num(pm_debug, debug_value);
				if(debug_value>0){
					set_ppcvar_line(pm_debug, arg2);
					PokeAdminNotice(id, "Debug is now Level:%d",debug_value);
				}
				else{
					set_ppcvar_line(pm_debug, "0");
					PokeAdminNotice(id, "Debug is now OFF");
				}
			}
		}
	}

	return PLUGIN_HANDLED;
 }
 
 /////////////////////////////////////////////////
 //  adds/changes pokemart values (of pokemon)  //
 /////////////////////////////////////////////////
 public admin_pokemart(id)
 {
	if(!poke_access(id))
		return PokeAdminNoticeAccess(id)

	if(!PMon())
		return PokeAdminNoticeOff(id)

	if (read_argc() > 3)	//thank you SHmod
		return PokeAdminNotice(id,"Too many arguments supplied. Do not use a space in the name.");

	new arg1[32], arg2[32];
	read_argv(1,arg1,31);
	read_argv(2,arg2,31);

	new PokeFile[128];
	Poke_FileName( F_Items, PokeFile);
	new item = str_to_num(arg1), price = str_to_num(arg2), iname[NAME_LENGTH], is_item=0, line=-1 ;
	new size = file_size(PokeFile, 1);

	if(!item){
		item = NameToItem(arg1);
		if(item==MAX_ITEMS){
			item = NameToPoke(arg1);
			if(item){
				is_item = 0;
				PokeToName(item, iname, NAME_LENGTH);
			}
			else
				return PokeAdminNotice(id,"You did not supply a valid pokemon or item.");
		}
		else{
			is_item = 1;
			ItemToName(item, iname, NAME_LENGTH);
		}
	}
	if(!price && !equal(arg2,"0"))
		return PokeAdminNotice(id,"%s's current price is: %d",iname,is_item?CostOfItem(item):CostOfPoke(item));

	new Left[NAME_LENGTH], Right[151], LeftN;

	new is_in_file;

	new pokedexline[255], i, charnum;

	for(i=0; i<=size; i++){
		read_file(PokeFile,i,pokedexline,255,charnum);
		strbreak(pokedexline, Left, NAME_LENGTH-1, Right, 150);

		if(is_item){
			LeftN = NameToItem(Left, false);
			if(LeftN == MAX_ITEMS)
				continue;
		}
		else{
			LeftN = NameToPoke(Left);
			if(!LeftN)
				continue;
		}

		if(LeftN==item){
			is_in_file = i;
			break;
		}
	}
	if(is_in_file)
		line = is_in_file;
	else
		line = -1;
	if( is_item )
		ItemPrice[item] = price;
	else
		ItemPrice[MAX_ITEMS+item] = price;


	new line_to_write[128];
	replace_all(iname, 31, " ", "_");
	strbreak(Right, Left, NAME_LENGTH-1, Right, 150);		//need to get the old price out
	formatex(line_to_write, 127, "%s %d %s",iname, price, Right);
	write_file(PokeFile, line_to_write, line);

	new command[255], bool:AdminOnly = false;
	if(price<0)
		AdminOnly = true;
	PokeAdminNotice(id,"You changed the price of %s to $%d%s.", iname, abs(price), AdminOnly?"(Admin Only)":EMPTY);

	if(price)
		formatex(command, 254, "changed Pokemart price of: %s to $%d%s.",iname, abs(price), AdminOnly?"(Admin Only)":EMPTY);
	else
		formatex(command, 254, "disabled Pokemart selling of %s.",iname);
	AdminPrint( id, command );

	return PLUGIN_HANDLED;
 }
 
 ///////////////////////////////////////////////
 //  adds/changes safari values (of pokemon)  //
 ///////////////////////////////////////////////
 public admin_safari(id)
 {
	if(!poke_access(id))
		return PokeAdminNoticeAccess(id)

	if(!PMon())
		return PokeAdminNoticeOff(id)

	if (read_argc() > 3)	//thank you SHmod
		return PokeAdminNotice(id,"Too many arguments supplied. Do not use a space in the name.")

	new arg1[32], arg2[32]
	read_argv(1,arg1,31)
	read_argv(2,arg2,31)

	new poke, level = str_to_num(arg2), pname[NAME_LENGTH],line=-1

	poke = NameToPoke(arg1)
	if( !ValidPoke(poke) )
		return PokeAdminNotice(id,"You did not supply a valid pokemon.")

	if(!level && !equali(arg2,"0"))
		return PokeAdminNotice(id,"%s's current safari level is: %d",pname,SafariLevel(poke))

	PokeToName(poke, pname, NAME_LENGTH)	//correct capitalization

	new PokeFile[128];
	Poke_FileName( F_Safari, PokeFile);
	new is_in_file
	new size = file_size(PokeFile, 1)

	new pokedexline[255], i, charnum
	new Left[NAME_LENGTH], Right[151], LeftN

	for(i=0; i<=size; i++){
		read_file(PokeFile,i,pokedexline,255,charnum)
		strbreak(pokedexline, Left, NAME_LENGTH-1, Right, 150)
		LeftN = str_to_num(Left)
		if(!LeftN){
			LeftN = NameToPoke(Left)
			if(!LeftN)
				continue
		}
		if(LeftN==poke){
			is_in_file = i
			break
		}
	}
	if(is_in_file)
		line = is_in_file
	else
		line = -1

	new line_to_write[128]
	formatex(line_to_write, 127, "%s %d",pname, level)

	new oldlevel = SafariLevels[poke]
	SafariLevels[poke] = level

	write_file(PokeFile, line_to_write, line)

	new command[255], bool:AdminOnly = false
	if(level<0)
		AdminOnly = true

	if(level!=-1000)
		PokeAdminNotice(id,"You changed the safari level of %s to %d%s.", pname, abs(level), AdminOnly?"(Admin Only)":EMPTY)
	else{
		for(new q=0; q<MAX_PLAYERS; q++){
			if(Pokemon[q]==poke)
				RefreshPoke(q)
		}
		PokeAdminNotice(id,"You completely disabled %s.", pname)
	}

	if(level && level!=-1000)
		formatex(command, 254, "changed Safari level of %s to %d%s.",pname, abs(level), AdminOnly?"(Admin Only)":EMPTY)
	else{
		if(level==-1000)
			formatex(command, 254, "disabled the use of %s.",pname)
		else{
			if(oldlevel==-1000)
				formatex(command, 254, "enabled the use of %s.",pname)
			else
				formatex(command, 254, "disabled the use of %s in Safari mode.",pname)
		}
	}
	AdminPrint( id, command)

	return PLUGIN_HANDLED
 }
 
 
 
 ////////////////////
 //  Give pokemon  //
 ////////////////////
 public admin_giveitem(id)
 {
	if(!poke_access(id))
		return PokeAdminNoticeAccess(id)

	if(!PMon())
		return PokeAdminNoticeOff(id)

	if (read_argc() > 4) {	//thank you SHmod
		PokeAdminNotice(id,"Too many arguments supplied. Do not use a space in the name.")
		return PokeAdminNotice(id,"You only need to put in a partial name to use this command.")
	}

	new arg1[32], iname[NAME_LENGTH], amount[25]
	read_argv(1,arg1,31)
	read_argv(2,iname,NAME_LENGTH-1)
	read_argv(3,amount,24)

	if(	isdigit(iname[0])
	|| (amount[0] && !( isdigit(amount[0] ) || ( equal(amount,DASH,1) && isdigit(amount[1]) ) ) )
	)
		return PokeAdminNotice(id,"Usage: pm_givepoke <nick | @TEAM | @ALL> <item name> <amount>")

	new name[32], item, num = str_to_num(amount)
	new players[MAX_PLAYERS], pnum, tid
	if( !get_info(id,arg1,name,31,true,players,pnum) )
		return PLUGIN_HANDLED

	item = NameToItem(iname, false)
	if( item==MAX_ITEMS )
		return PokeAdminNotice(id,"Invalid item name.")

	if(equali(amount,EMPTY))
		num = 1
	else if(!num)
		return PokeAdminNotice(id,"Invalid amount.")

	ItemToName(item, iname, NAME_LENGTH)

	for(new i=0; i<pnum; i++){
		tid = players[i]

		PlayersItem[tid][item] += num
		if(PlayersItem[tid][item]<0)
			PlayersItem[tid][item] = 0
	}

	PokeAdminNotice(id,"%s was %s %d %s.",name,num>0?"given":"robbed of",abs(num),iname)

	new command[255]
	if(num>0)
		formatex(command, 254, "gave %s %d %s.",name, num, iname)
	else
		formatex(command, 254, "stole %d %s from %s.", abs(num), iname, name)
	AdminPrint( id, command)

	return PLUGIN_HANDLED
 }
 
 
 ///////////////////////
 //  Morph a pokemon  //
 ///////////////////////
 public admin_morph(id)
 {
	if(!poke_access(id))
		return PokeAdminNoticeAccess(id)

	if(!PMon())
		return PokeAdminNoticeOff(id)

	if (read_argc() > 4) {	//thank you SHmod
		PokeAdminNotice(id,"Too many arguments supplied. Do not use a space in the name.")
		return PokeAdminNotice(id,"You only need to put in a partial name to use this command.")
	}

	new arg1[32], pname[NAME_LENGTH], newpname[NAME_LENGTH], poke_num, endname[NAME_LENGTH]
	read_argv(1,arg1,31)
	read_argv(2,pname,NAME_LENGTH-1)
	read_argv(3,newpname,NAME_LENGTH-1)

	if(isdigit(newpname[0]))
		return PokeAdminNotice(id,"Usage: pm_morph <nick | @TEAM | @ALL> <pokemon | @ALL | @#> <new pokemon>")

	new name[32], poke[MAX_POKES], pokenum[1]
	new players[MAX_PLAYERS], pnum, tid
	if( !get_info(id,arg1,name,31,true,players,pnum) )
		return PLUGIN_HANDLED

	new bool:valid_poke = GetPlayersPokes(id, _, pname, poke, pokenum, endname)
	if(!valid_poke)
		return PLUGIN_HANDLED

	new newpoke = NameToPoke(newpname)
	if(!newpoke)
		return PokeAdminNotice(id,"Invalid new pokemon.")

	PokeToName(newpoke, newpname, NAME_LENGTH)

	for(new i=0; i<pnum; i++){
		tid = players[i]
		GetPlayersPokes(id, tid, pname, poke, pokenum, endname)

		for(new j=0; j<pokenum[0]; j++){
			poke_num = HasPokemon(tid, poke[j])
			if(poke_num>=0)
				PlayersPoke[tid][poke_num] = newpoke
			else if( pnum == 1 && pokenum[0] == 1 )
				return PokeAdminNotice(id,"%s does not have %s.",name,endname)
		}
	}

	PokeAdminNotice(id,"%s's %s was morphed into %s.",name,endname,newpname)

	new command[255]
	formatex(command, 254, "morphed %s's %s into %s.",name, endname, newpname)
	AdminPrint( id, command)

	return PLUGIN_HANDLED
 }
 
 ////////////////////////
 //  Enable a pokemon  //
 ////////////////////////
 public admin_enable(id)
 {
	if(!poke_access(id))
		return PokeAdminNoticeAccess(id)

	if(!PMon())
		return PokeAdminNoticeOff(id)

	new cmd[20], pname[NAME_LENGTH], poke, bool:temp = false
	read_argv(0,cmd,19)
	read_argv(1,pname,NAME_LENGTH-1)

	if(containi(cmd,"temp")!=-1)
		temp = true

	new totalpokes[TOTAL_POKES], pnum, i
	new command[255], arg_count = read_argc();
	formatex(command, 254, "%senabled the use of ",temp?"temporarily ":EMPTY)

	poke = NameToPoke(pname)
	if( !ValidPoke(poke) ){
		if(equali(pname,"@ALL")){
			add(command, 254, "all pokemon.");
			for(i=0;i<=PokesCreated;i++)
				totalpokes[i] = i+1;
			pnum = PokesCreated+1;
		}
		else
			return PokeAdminNotice(id,"Invalid pokemon to enable.")
	}
	else{
		for( i=1; i < arg_count; i++ ){
			read_argv(i,pname,NAME_LENGTH-1)
			poke = NameToPoke(pname)
			PokeToName(poke, pname, NAME_LENGTH)
			if( i == 1 ){
				add(command, 254, pname);
			}
			else if( i == arg_count-1 ){
				if( arg_count > 3 )
					add(command, 254, ",");
				add(command, 254, " and ");
				add(command, 254, pname);
			}
			else {
				add(command, 254, ", ");
				add(command, 254, pname);
			}
			totalpokes[ pnum++ ] = poke
		}
		add(command, 254, ".");
	}


	new PokeFile[128];
	Poke_FileName( F_Safari, PokeFile);
	new is_in_file, line
	new size
	new pokedexline[255], k, charnum
	new Left[NAME_LENGTH], Right[151], LeftN

	for(i=0; i<pnum; i++)
	{
		poke = totalpokes[i]
		if(!temp){
			size = file_size(PokeFile, 1)

			for(k=0; k<=size; k++){
				read_file(PokeFile,k,pokedexline,255,charnum)
				strbreak(pokedexline, Left, NAME_LENGTH-1, Right, 150)
				LeftN = str_to_num(Left)
				if(!LeftN){
					LeftN = NameToPoke(Left)
					if(!LeftN)
						continue
				}
				if(LeftN==poke){
					is_in_file = k
					break
				}
			}
			if(is_in_file)
				line = is_in_file
			else
				line = -1

			formatex(pokedexline, 254, "%s 1",PokeToName(poke))
			write_file(PokeFile, pokedexline, line)
		}

		SafariLevels[poke] = 0
	}

	AdminPrint( id, command)

	return PLUGIN_HANDLED
 }
 /////////////////////////
 //  Disable a pokemon  //
 /////////////////////////
 public admin_disable(id)
 {
	if(!poke_access(id))
		return PokeAdminNoticeAccess(id)

	if(!PMon())
		return PokeAdminNoticeOff(id)

	new cmd[20], pname[NAME_LENGTH], poke, bool:temp = false
	read_argv(0,cmd,19)
	read_argv(1,pname,NAME_LENGTH-1)

	if(containi(cmd,"temp")!=-1)
		temp = true

	new totalpokes[TOTAL_POKES], pnum, i
	new command[255], arg_count = read_argc();
	formatex(command, 254, "%sdisabled the use of ",temp?"temporarily ":EMPTY)

	poke = NameToPoke(pname)
	if( !ValidPoke(poke) ){
		if(equali(pname,"@ALL")){
			add(command, 254, "all pokemon.")
			for(i=0;i<=PokesCreated;i++) totalpokes[i] = i+1
			pnum = PokesCreated+1
		}
		else
			return PokeAdminNotice(id,"Invalid pokemon to disable.")
	}
	else{
		for( i=1; i < arg_count; i++ ){
			read_argv(i,pname,NAME_LENGTH-1)
			poke = NameToPoke(pname)
			PokeToName(poke, pname, NAME_LENGTH)
			if( i == 1 ){
				add(command, 254, pname);
			}
			else if( i == arg_count-1 ){
				if( arg_count > 3 )
					add(command, 254, ",");
				add(command, 254, " and ");
				add(command, 254, pname);
			}
			else {
				add(command, 254, ", ");
				add(command, 254, pname);
			}
			totalpokes[ pnum++ ] = poke
		}
		add(command, 254, ".");
	}


	new PokeFile[128];
	Poke_FileName( F_Safari, PokeFile);
	new is_in_file, line
	new size
	new pokedexline[255], k, charnum
	new Left[NAME_LENGTH], Right[151], LeftN

	for(i=0; i<pnum; i++)
	{
		poke = totalpokes[i]
		if(!temp){
			size = file_size(PokeFile, 1)

			for(k=0; k<=size; k++){
				read_file(PokeFile,k,pokedexline,255,charnum)
				strbreak(pokedexline, Left, NAME_LENGTH-1, Right, 150)
				LeftN = str_to_num(Left)
				if(!LeftN){
					LeftN = NameToPoke(Left)
					if(!LeftN)
						continue
				}
				if(LeftN==poke){
					is_in_file = k
					break
				}
			}
			if(is_in_file)
				line = is_in_file
			else
				line = -1

			formatex(pokedexline, 254, "%s -1000",PokeToName(poke))
			write_file(PokeFile, pokedexline, line)
		}

		SafariLevels[poke] = -1000
	}

	AdminPrint( id, command)

	return PLUGIN_HANDLED
 }
 
 
 ///////////////////
 //  Change rank  //
 ///////////////////
 #if POKERANK_SYSTEM==1
 public admin_rank(id)
 {
	if(!poke_access(id))
		return PokeAdminNoticeAccess(id)

	if(!PMon())
		return PokeAdminNoticeOff(id)

	if (read_argc() > 4) {	//thank you SHmod
		PokeAdminNotice(id,"Too many arguments supplied. Do not use a space in the name.")
		return PokeAdminNotice(id,"You only need to put in a partial name to use this command.")
	}

	new cmd[20], arg1[32], amount[25], bool:set = false
	read_argv(0,cmd,19)
	read_argv(1,arg1,31)
	read_argv(2,amount,24)

	if(containi(cmd,"set")!=-1)
		set = true

	if(!(isdigit(amount[0]) || (equal(amount,DASH,1) && isdigit(amount[1])))){
		if(set)
			return PokeAdminNotice(id,"Usage: pm_setrank <nick | @TEAM | @ALL> <amount>")
		else
			return PokeAdminNotice(id,"Usage: pm_addrank <nick | @TEAM | @ALL> <amount>")
	}

	new name[32], num = str_to_num(amount)
	new players[MAX_PLAYERS], pnum, tid
	if( !get_info(id,arg1,name,31,true,players,pnum) )
		return PLUGIN_HANDLED

	if(!num)
		return PokeAdminNotice(id,"Invalid amount.")

	for(new i=0; i<pnum; i++){
		tid = players[i]

		if(set)
			PlayersCatch[tid] = num
		else
			PlayersCatch[tid] += num

		if(SpecialRank(tid)!=-1)	//update their thing, and check if they went higher
			UpdateSpecialRank(tid)
		else
			CheckUpdateRank(tid) //only check if they went higher than the last person in Elite Four
	}

	if(set)
		PokeAdminNotice(id,"%s PokeRank points was set to %d.",name,num)
	else
		PokeAdminNotice(id,"%s was %s %d PokeRank points.",name,num>0?"given":"robbed of",num)

	new command[255]
	if(set)
		formatex(command, 254, "set %s PokeRank points to %d.",name, num)
	else {
		if(num>0)
			formatex(command, 254, "dal %s %d punktow Pokerank.",name, num)
		else
			formatex(command, 254, "ukradl %d punktow Pokerank od %s.", abs(num), name)
	}
	AdminPrint( id, command)

	return PLUGIN_HANDLED
 }
 #endif

 ////////////////////////////
 //  Change pokemod cvars  //
 ////////////////////////////
 public admin_cvar(id)
 {
	if(!(get_user_flags(id)&ADMIN_CVAR ) && id )
		return PokeAdminNoticeAccess(id)

	if(!PMon())
		return PokeAdminNoticeOff(id)

	if (read_argc() > 3)	//thank you SHmod
		return PokeAdminNotice(id,"Too many arguments supplied.");

	new arg1[32], cvar_num;
	read_argv(1,arg1,31);
	cvar_num = get_pokecvar(arg1, true);

	if(cvar_num==MAX_CVARS)
		return PokeAdminNotice(id,"Invalid PokeMod Cvar.");

	copy(arg1, 31, get_pokecvar_name(cvar_num) );	//refresh the name

	if( id && !(get_user_flags(id)&ADMIN_RCON) ){
		new bool:deny = false;
		if(	cvar_num == pm_admin )
			deny = true;
	#if SAVE==SAVE_SQLX || SAVE==SAVE_MYSQL
		if(	cvar_num == pm_mysql_host
		||	cvar_num == pm_mysql_user
		||	cvar_num == pm_mysql_pass
		||	cvar_num == pm_mysql_db
		)
			deny = true;
	#endif
	#if SAVE==SAVE_MYSQL
		if(	cvar_num == pm_mysql_persistent )
			deny = true;
	#endif
		if( deny )
			return PokeAdminNotice(id,"You have no access to change that cvar.");
	}

	new arg2[64];
	read_argv(2,arg2,63);

	if( !ValidData(arg2) ){
		get_ppcvar_string(cvar_num,arg2,63);
		return PokeAdminNotice(id,"'%s' is set to '%s'.",arg1,arg2)
	}

	set_ppcvar_string(cvar_num, arg2);
	set_ppcvar_line(cvar_num, arg2);

	PokeAdminNotice(id,"'%s' was set to '%s'.",arg1,arg2);

	new command[255];
	formatex(command, 254, "set '%s' to '%s'.",arg1, arg2);
	AdminPrint( id, command );

	return PLUGIN_HANDLED;
 }

 ///////////////////////////////////////////
 //  Changes who sees the debug messages  //
 ///////////////////////////////////////////
 public admin_debugger(id)
 {
	if(!(get_user_flags(id)&ADMIN_RCON ) && id )
		return PokeAdminNoticeAccess(id)

	if(!PMon())
		return PokeAdminNoticeOff(id)

	if (read_argc() > 2)	//thank you SHmod
		return PokeAdminNotice(id,"Too many arguments supplied. Do not use a space in the name.")

	new arg1[32];
	read_argv(1,arg1,31);

	if( equali(arg1, "0") ){
		debugger = 0;
		PokeAdminNotice(id,"The server is now the debugger.");
		AdminPrint( id, "changed the debugger to the server." );
		return PLUGIN_HANDLED
	}

	new name[32]
	new players[MAX_PLAYERS], pnum
	if( !get_info(id,arg1,name,31,true,players,pnum) )
		return PLUGIN_HANDLED

	if( pnum > 1 )
		return PokeAdminNotice(id,"You can only set one player to be the debugger.");

	if( !is_user_connected( players[0] ) )
		return PokeAdminNotice(id,"You must set a player to be the debugger.");

	debugger = players[0];
	PokeAdminNotice(id,"%s is now the debugger.",name);

	new command[255];
	formatex(command, 254, "changed the debugger to %s.",name);
	AdminPrint( id, command );

	return PLUGIN_HANDLED;
 }
 PokeAdminNotice(id, error_lulz[], {Float,Sql,Result,_}:...)
 {
	new output[256];
	vformat(output, 255, error_lulz, 3);
	console_print(id, "%s %s", PREFIX, output );
	return PLUGIN_HANDLED;
 }
 PokeAdminNoticeOff(id)
 {
	console_print(id,"PokeMod is not activated.")
	return PLUGIN_HANDLED
 }
 PokeAdminNoticeAccess(id)
	return PokeAdminNotice( id, "You have no access to that command.");

 
 