Dialog buggy + rep for those who help !!!
#10

pawn Код:
CMD:reportar(playerid, params[])
{
    if(!APlayerData[playerid][LoggedIn]) return 0;
   
    new OtherPlayer, Reason[128];
    if (sscanf(params, "us[128]", OtherPlayer, Reason)) return SendClientMessage(playerid, 0xFF0000AA, "Digite: \"/reportar <Player> <Seu Report>\"");
    if (!APlayerData[OtherPlayer][LoggedIn]) return SendClientMessage(playerid, 0xFFFFFFFF, "O Player nao esta Online");

    new Name[24], Msg[128];
    SendReportToAdmins(OtherPlayer, Reason);

    GetPlayerName(OtherPlayer, Name, sizeof(Name));
   
    format(Msg, 128, "Voce Reportou {FFFFFF}%s", Name);
    SendClientMessage(playerid, 0xFFFFFFFF, Msg);
    return 1;
}

command(relato,playerid,params[])
{
    SendAdminText(playerid,"/relato",params);
    if(!APlayerData[playerid][LoggedIn]) return 0;
   
    new OtherPlayer, Reason[128];
    if(sscanf(params,"us[128]",OtherPlayer,Reason))return SendClientMessage(playerid,0xFF0000AA,"Uso: \"/relato [id] [causa]");
    if(!APlayerData[OtherPlayer][LoggedIn]) return SendClientMessage(playerid, 0xff000099, "ERRO:O jogador nao estб conectado.");

    SendReportToAdmins(OtherPlayer,Reason);

    new Name[24], msg[128], dest[256]
    GetPlayerName(OtherPlayer,Name,sizeof Name);
    format(msg,128,"Seu relato contra jogador(a) %s foi enviado aos administradores", Name);
    SendClientMessage(playerid,0x808080FF,msg);
   
    for(new i;i<sizeof(AReports);i++)
    {
        if(AReports[i][ReportUsed])
        {
            format(ReportList,5000,"%s%s: %s - %s\n",ReportList,AReports[i][ReportName],AReports[i][ReportReason],(IsPlayerConnect(i)) ? ("Online") : ("Offline"));

            strcat(dest, ReportList);
        }
    }
    ShowPlayerDialog(playerid, DialogReports, DIALOG_STYLE_MSGBOX, "Relatуrio:", dest, "OK", "Cancelar");
   
    return 1;
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 4 Guest(s)