SA-MP Forums Archive
[Ajuda] VERIFICAR PLAYER ONLINE AGENDA BAN - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] VERIFICAR PLAYER ONLINE AGENDA BAN (/showthread.php?tid=649633)



VERIFICAR PLAYER ONLINE AGENDA BAN - matheusdorado - 12.02.2018

Olб Pessoal boa tarde, tudo bom com vocкs?

Estou desenvolvendo um comando para Agendar BAN, porem gostaria que ao agendar o comando verifique se o Player esta online e Bana o mesmo de imediato, vou deixar o comando feito atй o presente momento.
Se possнvel me ajudem com o que falta para terminar este projetinho de comando.

PHP код:
CMD:agendarban(playeridparams[])
{
    new 
string[128], NomePlayer[21], Motivo[50], file[64], filedois[64], Hora[15], Data[15];
    if(
PlayerInfo[playerid][pAdmin] == 0) return SendClientMessage(playeridBRANCO"Vocк precisa ser admin para usar este comando!");
    if(
PlayerInfo[playerid][pTrabalhando] == false) return SendClientMessage(playeridCINZA"Vocк precisa trabalhar para usar o comando. Use /trabalhar.");
    if(
sscanf(params"s[21]s[50]"NomePlayerMotivo)) return SendClientMessage(playeridCINZA"[SERVER] Use /agendarban [NOME] [MOTIVO]");
    
format(file64"Contas/%s.ini"NomePlayer);
    if(!
DOF2_FileExists(file))    return SendClientMessage(playerid, -1"Este Nome nгo estб Registrado!");
    
    
format(stringsizeof(string), "O Admin %s Agendou o BAN do Player %s, Motivo: (%s)"PlayerName(playerid), NomePlayerMotivo);
    
SendClientMessageToAll(SALMONstring);
    
     
getdate(AnoMesDia);
    
gettime(HoraMinutoSegundo);
    
format(Data15"%d/%d/%d"DiaMesAno);
    
format(Hora15"%d:%d:%d"HoraMinutoSegundo);
     
format(filedois64"AgendadosBan/%s.ini"NomePlayer);
    
    if(!
DOF2_FileExists(filedois))
    {
        
DOF2_CreateFile(filedois);
        
DOF2_SetString(filedois"Admin"PlayerName(playerid));
        
DOF2_SetString(filedois"Motivo"Motivo);
        
DOF2_SetString(filedois"Data"Data);
        
DOF2_SetString(filedois"Hora"Hora);
        
DOF2_SaveFile();
    }
    else return 
SendClientMessage(playerid0x0000CDFF"ESTE NOME JБ ESTA AGENDADO!");
    return 
true;

Desde jб agradeзo a cada um pela ajuda, Fiquem com Deus e um Forte Abraзo, atй breve.

Atenciosamente,
Matheus Dorado


Re: VERIFICAR PLAYER ONLINE AGENDA BAN - XandyMello - 12.02.2018

PHP код:
    new
        
Name[MAX_PLAYER_NAME],
        
MAX_PLAYERS;
    ;
    while(
i--)
    {
        if(!
IsPlayerConnected(i)) continue;
        
GetPlayerName(iNamesizeof(Name));
        if(
strcmp(NameNomePlayerfalse) == 0)
        {
            
Ban(i);
            break;
        }
    } 



Re: VERIFICAR PLAYER ONLINE AGENDA BAN - matheusdorado - 12.02.2018

Quote:
Originally Posted by XandyMello
Посмотреть сообщение
PHP код:
    new
        
Name[MAX_PLAYER_NAME],
        
MAX_PLAYERS;
    ;
    while(
i--)
    {
        if(!
IsPlayerConnected(i)) continue;
        
GetPlayerName(iNamesizeof(Name));
        if(
strcmp(NameNomePlayerfalse) == 0)
        {
            
Ban(i);
            break;
        }
    } 
Vlw Irmгo, isso mesmo que eu precisava! Tmj Fica com Deus Forte abraзo e Muito Obrigado!

Atenciosamente,
Matheus Dorado