[Pedido] Ler report's
#1

Queria pedir um sistema que quando o player desse olhar em alguma pessoa que foi reportada (APENAS QUEM FOI REPORTADA) Aparecerб no /admins e quero que salvasse quando o player desconectar pois breve irei fazer um rank contendo essa informaзгo

Ex: Admin: %s | [%s] | [Status: %s] | [Reports Lidos: %s]

comando /reports
Код:
dcmd_reports(playerid,params[])
{
    #pragma unused params
	if(Player[playerid][pAdmin] >= 1)
	{
		SCM(playerid, COR_BARRAS,"* Ъltimos reports efetuados *");
		new string[128], acount;
		for(new i = 0; i < sizeof(Reports); i ++)
		{
			if(IsPlayerConnected(Reports[i]))
			{
		    	acount ++;
		    	format(string,128,"%d. %s (id: %d) | Motivo: %s", acount, getPName(Reports[i]), Reports[i], ReportsReasons[i]);
		    	SCM(playerid, TEXTO, string);
			}
		}
		if(acount == 0)
		{
			SCM(playerid, TEXTO, "Nenhum report encontrado.");
		}
	}
	return 1;
}
comando /admins
Код:
dcmd_admins(playerid, params[])
{
    #pragma unused params

    if(Player[playerid][pLogged] == false)
	    return SCM(playerid, COR_ERRO, "[ERRO] Vocк nгo estб logado!");

    SCM(playerid, COR_BARRAS, "* Administradores Online *");
	new AdmLevel[64], StatusAdmin[64];
	new count=0;
	new sztring[15000];

	for(new i=0; i<MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i))
		{
		    if(Player[i][pLogged] == true)
			{
				if(Player[i][pAdmin] >= 1)
				{
                    if(Player[i][pAdmin] == 7) { AdmLevel = "Dono do Servidor"; }
                    if(Player[i][pAdmin] == 6) { AdmLevel = "Lнder Geral"; }
				    if(Player[i][pAdmin] == 5) { AdmLevel = "Game Master"; }
				    if(Player[i][pAdmin] == 4) { AdmLevel = "Sub Game Master"; }
				    if(Player[i][pAdmin] == 3) { AdmLevel = "Administrador Fixo"; }
				    if(Player[i][pAdmin] == 2) { AdmLevel = "Administrador Ajudante"; }
				    if(Player[i][pAdmin] == 1) { AdmLevel = "Administrador Teste"; }
				    
				    if(Trabalhando[i] == 1) { StatusAdmin = "Trabalhando"; }
				    if(Trabalhando[i] == 0) { StatusAdmin = "Jogando"; }


                    format(sztring, sizeof(sztring), CONTAS, getPName(i));

					if(Player[i][pAdmin] >= 1)
					{
					SendFormattedMessage(playerid, COLOR_WHITE, "Admin: %s | [%s] | [Status: %s]", getPName(i), AdmLevel, StatusAdmins);
					count++;
					}
				}
			}
		}
	}

	if(count == 0)
	   	SCM(playerid, TEXTO, "Nenhum Administrador Online!");



	return 1;
}
comando /olhar
Код:
dcmd_olhar(playerid, params[])
{
	if(Player[playerid][pAdmin] < 1)
		return 0;
	else
	{

	  	new tmp[256], idx, specid;
		tmp = strtok(params, idx);

		if(!strlen(tmp)) {
			SCM(playerid, COR_USOCORRETO, "[SERVER] [USO] /olhar [id/off]");
			return 1;
		}

		if(strcmp(tmp, "off", true)==0)
		{
		 	if(GetPlayerState(playerid) == PLAYER_STATE_SPECTATING )
		 	{
		 	    StopSpectate(playerid);
				return 1;
			}
			else
			{
			    return SCM(playerid, COR_USOCORRETO, "[SERVER] Erro: Vocк nгo estб espectando ninguйm.");
			}
		}
		if(!IsNumeric(params))
			specid = ReturnPlayerID(params);
		else
			specid = strval(params);

		if(!IsPlayerConnected(specid)) {
			SCM(playerid, COR_GREY, "[ERRO] Jogador nгo encontrado.");
			return 1;
		}
		else if(specid == playerid) {
	  		SCM(playerid, COR_GREY, "[SERVER] Erro: ID Invбlido.");
			return 1;
		}
		else if(GetPlayerState(specid) == PLAYER_STATE_SPECTATING && Player[specid][gSpectateID] != INVALID_PLAYER_ID) {
			SCM(playerid, COR_GREY, "[SERVER] Erro: Jogador escolhido jб estб espectando alguйm.");
			return 1;
		}
		else if(GetPlayerState(specid) != 1 && GetPlayerState(specid) != 2 && GetPlayerState(specid) != 3) {
	 		SCM(playerid, COR_GREY, "[SERVER] Erro: O jogador nгo estб jogando.");
			return 1;
		}

		if(GetPlayerState(playerid) != PLAYER_STATE_SPECTATING)
	    {
	       	SaveVariables(playerid);
			SCM(playerid, COR_RED, "[SERVER] Vocк entrou no modo espectador, para sair digite /olhar off.");
		}

		StartSpectate(playerid, specid);
	}
	return 1;
}
Reply
#2

Eu fiz sу de bobeira, pode implementar umas ideias desse sistema.
Estб funcionando perfeitamente e nгo causa crash!
File Functions puro!
Код:
CMD:report(playerid, params[])
{
	new File:ArquivoReports;
	
	if(!fexist("reports.txt")) ArquivoReports = fopen("reports.txt", io_write);
	fclose(ArquivoReports);
	
	new 
		Fmt[100],
		Name[24],
		Name_2[24],
		Motivo[20],
		TargetID
	;
	
	ArquivoReports = fopen("reports.txt", io_read);
	
	if(sscanf(params, "us[20]", TargetID, Motivo))
		return SendClientMessage(playerid, -1, "/report [id] [motivo]");
	
	if(!IsPlayerConnected(TargetID))
		return SendClientMessage(playerid, -1, "Jogador nгo conectado!");
	
	GetPlayerName(TargetID, Name, sizeof Name);
	GetPlayerName(playerid, Name_2, sizeof Name_2);
	
	format(Fmt, sizeof Fmt, "%s reportou %s motivo %s", Name_2, Name, Motivo);
	
	fwrite(ArquivoReports, Fmt);
	fclose(ArquivoReports);
	
	return 1;
}

CMD:lerreports(playerid)
{
	
	if(!fexist("reports.txt"))
		return SendClientMessage(playerid, -1, "Nгo hб reports!");
	
	new 
		Buf[100],
		Fmt[100],
		FileSize[20],
		File:ArquivoReports = fopen("reports.txt", io_read)
	;
	
	format(FileSize, sizeof FileSize, "%i", flength(ArquivoReports));
	if(strval(FileSize) < 1) SendClientMessage(playerid, -1, "Nгo hб reports!");
	
	for(new i = 0; i < fread(ArquivoReports, Buf); i ++)
	{
		format(Fmt, sizeof Fmt, "%s\n", Buf);
		strcat(ReportsTXT, Buf);
	}
	ShowPlayerDialog(playerid, 1245, DIALOG_STYLE_MSGBOX, "Reports:", ReportsTXT, "OK","");
	
	fclose(ArquivoReports);
	
	return 1;
}

CMD:limparreports(playerid)
{
	new 
		File:ArquivoReports = fopen("reports.txt", io_write)
	;
	
	fwrite(ArquivoReports, "\0");
	fclose(ArquivoReports);
	
	SendClientMessage(playerid, -1, "Reports limpos!");
	
	return 1;
}
Reply
#3

vocк me ajudou muito estudei esse codigo todo e tive mais conhecimento de algumas coisas
mais deixou a principal coisa escapar , Tinha que Contar os rpts lidos no /admins ,

ex: Admin: %s | [%s] | [Status: %s] | [Report's lidos: ]

e como eu falei , tinha que apenas salvar os reports lidos para quando o player sair do servidor,os rpts deles ficaram salvos , e tambйm se possivel , pхe para contar o report sу quando o player estiver reportado
Reply
#4

PHP код:
enum PV
{
    
RPTL
};
new 
file[155];
new 
nome[MAX_PLAYER_NAME+1];
new 
Player[MAX_PLAYERS][PV]; 
PHP код:
// No comando
GetPlayerName(playeridnomeMAX_PLAYER_NAME);
format(filesizeof(file), "Contas/%s.ini"nome);
format(stringsizeof(string), "Admin: %s [Administrador] [Reports Lidos: %d]"nomeDOF2::GetInt(file"ReportL")); 
PHP код:
// OnPlayerDisconnect
format(filesizeof(file), "Contas/%s.ini"nome);
DOF2::SetInt(file"ReportL"Player[playerid][RPTL]);
DOF2::SaveFile(); 
PHP код:
// OnPlayerConnect
format(filesizeof(file), "Contas/%s.ini"nome);
if(
DOF2::FileExists(file))
{
    
Player[playerid][RPTL] = DOF2::GetInt(file"ReportL");
    
DOF2::SaveFile();

PHP код:
// Na stock StarSpectate
    
new string[128];
    for(new 
0<= HighestID++)
    {
        if(
IsPlayerConnected(i) && Player[i][LastReport] == specid)
        {
            
format(string,128,"** Recebido do %s %s: Seu ъltimo report estб sendo verificado por min."AccountName(playerid), getPName(playerid));
            
SendClientMessage(iCOR_YELLOWstring);
            
Player[i][LastReport] = INVALID_PLAYER_ID;
            
Player[playerid][RPTL]++;
        }
    } 
Nгo precisa fazer algumas coisas tб, Isso e so uma base como tu deve fazer mais e funcional

Alйm disso eu sei quer vocк estб usando o GameMode do GTA Torcidas como base para criar um de facзгo, Maioria faz isso
Reply
#5

ainda nгo estou entendendo pode fazer um code para mim ?
Reply
#6

Quote:
Originally Posted by LukasMartins
Посмотреть сообщение
ainda nгo estou entendendo pode fazer um code para mim ?
Ja ja eu edito
Reply
#7

Estou editando um de torcidas para aprimorar mais o conhecimento em pawno
acha que eu comeзando agora vou criar um gamemode de facзхes do 0 sem conhecimento em quase nada ?
Reply
#8

Quote:
Originally Posted by LukasMartins
Посмотреть сообщение
Estou editando um de torcidas para aprimorar mais o conhecimento em pawno
acha que eu comeзando agora vou criar um gamemode de facзхes do 0 sem conhecimento em quase nada ?
Sim vocк estudando vocк criar um do 0 amigo, Veja se o meu exemplo ajudo vocк ai
Reply
#9

Quote:
Originally Posted by LukasMartins
Посмотреть сообщение
Estou editando um de torcidas para aprimorar mais o conhecimento em pawno
acha que eu comeзando agora vou criar um gamemode de facзхes do 0 sem conhecimento em quase nada ?
Й o mais recomendбvel vocк aprender Pawn assistindo vнdeos tutorias e lendo, tem muito conteъdo pelo fуrum, jб editar algo jб feito nгo adianta pois pode estar mal feito com isso vocк aprende tudo errado ou nгo aprende.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)