[Ajuda] Ban
#1

Olб, queria saber como que aparece no arquivo bans.ino quem baniu o motivo e o Ip do banido.

pawn Код:
CMD:setaracc(playerid, params[])
{
    new id;
    new aName[MAX_PLAYER_NAME];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(id,name,MAX_PLAYER_NAME);
    GetPlayerName(playerid,aName,MAX_PLAYER_NAME);
    new pIp[25];
    GetPlayerIp(id, pIp, sizeof(pIp));
    new motivo[25];
    new file[256];
    if(IsPlayerAdmin(playerid) || Admin[playerid] == 1 || Admin[playerid] == 2)
    {
    if(sscanf(params,"ds",id,motivo)) return SendClientMessage(playerid, Vermelho, "| ERRO |{ffffff}Digite: /SetarAcc [id] [motivo]");
    Setado[playerid] = 1;
    SendClientMessage(playerid, azuladm,"[Admin] Jogador setado");
    format(file, 30, "%s [IP: %s] || Setado por: %s || Motivo: %s", name,pIp,aName,motivo);
    DOF2_SetInt(ARQUIVO_BANS,"",Setado[playerid]);
    }else{
    SendClientMessage(playerid, ERRO, "| ERRO | Vocк nгo й administrador(a)");
    }
    return 1;
}
Reply
#2

Use/estude a include do Lуs, й bem simples.
http://forum.sa-mp.com/showthread.ph...ighlight=Losgs
Reply
#3

nгo intendi o do lуs mano, me explica aqui por favor.
Reply
#4

Tenta isto

pawn Код:
CMD:setaracc(playerid, params[])
{
   
    static
        pReason[32],
        pID
    ;
   
    if(sscanf(params, "is[32]", pID, pReason)){
        return SendClientMessage(playerid, Vermelho, "| ERRO |{ffffff}Digite: /SetarAcc [id] [motivo]");
    }
   
   
    new
        File: _@f,
        pNam[32],
        stri[128]
    ;
   
    _@f = fopen("Banidos", io_append);
   
    format(stri, 128, "%s [IP: %s] || Setado por: %s || Motivo: %s", (GetPlayerName(pID, pNam, 24), pNam), (GetPlayerIp(pID, pNam, 32), pNam), (GetPlayerName(playerid, pNam, 24), pNam),pReason);
    fwrite(_@f, stri);
   
    fclose(_@f);
   
   
    return 1;
}

PS: nгo tstei.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)