o mica problema

Modificari necesare ale pluginurilor

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
User avatar
@LeX
Membru, skill 0
Membru, skill 0
Posts: 21
Joined: 09 Feb 2015, 19:28
Detinator Steam: Da
SteamID: STEAM_0:1:452037874
Fond eXtream: 0
Location: Brasov
Has thanked: 1 time

08 Sep 2020, 12:04

Plugin Cerut: Modificare plugin BanLiat

Descriere (adica ce face el mai exact): plugin-ul cauta in advanced_bans.txt pentru a afisa banurile
la activ plugin-ul sufera 2 mici probleme, care inca nu am gasit rezolvare.
1. plugin-ul daca gaseste in banlist doar un singur jucatori acest ban este afisat de 2 ori, vreau sa fie afisat doar unul daca doar unul exista in banlist
2. plugin-ul nu poate determina daca ceea ce am cautat eu este in banlist sau nu, vreau ca acest plugin sa stie daca exista sau nu ce am cautat eu

Serverul impune conditii strict HLDS/REHLDS?: nu neaparat

Ai cautat pluginul?(daca da, precizeaza cum): prin search si nu doar aici, nici un rezultat.

Necesita mod special?: nu

amx_banlist.sma | Afiseaza codul
#include <amxmodx>
#include <amxmisc>

public plugin_init()
{
	register_plugin("AMXX Ban List Viewer","0.1a","Drak");
	register_concmd("amx_test","CmdBanList");
}

public CmdBanList(id)
{
	if(!(get_user_flags(id) & ADMIN_BAN) )
	{
		console_print(id, you do not have access to this command !");
		return 1;
	}
		
	new Search[32];
	read_args(Search, 31);
	
	if(!Search[0])
	{
		console_print(id, "^n[BanList] INVALID FORMAT !");
		console_print(id, "[BanList] Format: amx_test <Search>^n");
		return 1;
	}
	
	new pFile = fopen("addons/amxmodx/data/advanced_bans.txt","r");
	
	if(!pFile)
		return client_print(id,print_console,"[BanList] Unable to open BanList File.");
	
	new Data[256],Arg1[101],Arg2[101],Arg3[32],Arg4[101],Arg5[101],Arg6[101];
	
	for(new i; i < pFile; ++i)
	{
		while(!feof(pFile))
		{
			fgets(pFile,Data,255);
			parse(Data, Arg1, 100, Arg2, 100, Arg3, 31, Arg4, 100, Arg5, 100, Arg6, 100);
			if(containi(Data,Search) != -1)
			{
				console_print(id, "****************[%i]****************", 1 + i++);
				console_print(id, "Name: %s", Arg2);
				console_print(id, "IP/SteamID: %s", Arg1);
				console_print(id, "Unban Time: %s", Arg4);
				console_print(id, "Reason: %s",Arg5);
				console_print(id, "Admin: %s", Arg6);
				console_print(id, "************************************^n^n");
			}
		}
	}
	fclose(pFile);
	return 1
}
Rapidserver
User avatar
@LeX
Membru, skill 0
Membru, skill 0
Posts: 21
Joined: 09 Feb 2015, 19:28
Detinator Steam: Da
SteamID: STEAM_0:1:452037874
Fond eXtream: 0
Location: Brasov
Has thanked: 1 time

12 Sep 2020, 16:23

??? nu mai activeaza nimeni ?
Post Reply

Return to “Modificari pluginuri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 6 guests