[Ajuda] Colocar Data no ban
#1

Olб tenho uma "linha" que dб efeito no dialog do ban (quando a pessoa ta banida e vai logar) Sу que tentei colocar a data e o mesmo nгo funcionou. Na linha eu adicionei:

PHP код:
dUserSet(PlayerName2(player1)).("ban_admin",PlayerName2(playerid));
dUserSet(PlayerName2(player1)).("ban_motivo",params[2]);
dUserSet(PlayerName2(player1)).("ban_data",day,month,year,hour,minuite); 
Porem a parte da data nгo funcionou,sу funcionou a do admin e o motivo,a data nгo.

PHP код:
C:\Users\ata\Desktop\Minha GM\filterscripts\ladmin4v2.pwn(3998) : error 035argument type mismatch (argument 3
Comando ban:

PHP код:
dcmd_ban(playerid,params[]) {
    if(
PlayerInfo[playerid][LoggedIn] == 1)
    {
        if(
PlayerInfo[playerid][Level] >= 2)
        {
            new 
tmp[256], tmp2[256], Indextmp strtok(params,Index), tmp2 strtok(params,Index);
            if(!
strlen(params)) return SendClientMessage(playeridred"| ERRO | Digite: /Ban [ID] [Motivo]");
            if(!
strlen(tmp2)) return SendClientMessage(playeridred"| ERRO | Coloque um Motivo!");
            new 
player1playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], string[800], string2[800];
            
player1 strval(tmp);
            if(
IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid && (PlayerInfo[player1][Level] != ServerInfo[MaxAdminLevel]) )
            {
                if(
PlayerInfo[player1][Level] >= && PlayerInfo[playerid][Level] != ServerInfo[MaxAdminLevel]) return SendClientMessage(playerid,red,"| ERRO | Vocк nгo pode banir um Admin!");
                if(!
IsNumeric(tmp)) return SendClientMessage(playerid,red,"| ERRO | ID invalido.");
                
GetPlayerName(player1playernamesizeof(playername)); GetPlayerName(playeridadminnamesizeof(adminname));
                new 
year,month,day,hour,minuite,secondgetdate(yearmonthday); gettime(hour,minuite,second);
                
CMDMessageToAdmins(playerid,"BAN");
                
format(string,sizeof(string),"| GNC-Admin | O(A) Administrador(a) %s baniu o(a) jogador(a) %s ( Motivo: %s )",adminname,playername,params[2],day,month,year,hour,minuite);
                
format(string2,sizeof(string2),"| BAN-LOG | O(A) Admin %s baniu o(a) jogador(a) %s Motivo: (%s)",adminname,playername,params[2],day,month,year,hour,minuite);
                
PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
                
SendClientMessageToAll(vermelho,string);
                
SaveToFile("BanLog",string2);
                print(string);
                if(
udb_Exists(PlayerName2(player1)) && PlayerInfo[player1][LoggedIn] == 1dUserSetINT(PlayerName2(player1)).("banned",1);
                
format(string,sizeof(string),"Banido pelo Administrador %s ( Motivo: %s )"adminnameparams[2] );
                
BanNotify(player1);
                
dUserSet(PlayerName2(player1)).("ban_admin",PlayerName2(playerid));
                
dUserSet(PlayerName2(player1)).("ban_motivo",params[2]);
                
dUserSet(PlayerName2(player1)).("ban_data",day,month,year,hour,minuite);
                return 
SetTimerEx("DelayedBan"1000false"d"player1);
            }
            else return 
SendClientMessage(playeridred"| ERRO | Jogador(a) nгo conectado(a) ou й vocк mesmo ou admin de alto Nivel.");
        }
        else return 
SendClientMessage(playerid,red,"| ERRO | Comando Invalido!  /Comandos");
    }
    else return 
SendClientMessage(playerid,red,"| ERRO | Voce deve estar logado para usar estes comandos");
}
forward DelayedBan(playerid);
public 
DelayedBan(playerid)
{
    
Kick(playerid);
    
Ban(playerid);

Obrigado a quem me ajudar! ^^
Reply
#2

PHP код:
new string[40];
format(string,sizeof(string),"%02d:%02d:%02d",day,month,year);
dUserSet(PlayerName2(player1)).("ban_data",string); 
Reply
#3

PHP код:
if(PlayerInfo[playerid][LoggedIn] == 1
Em vez de vocк colocar essa checagem em cada comando que vocк for criar em seu servidor, utilize desta forma:

PHP код:
public OnPlayerCommandReceived(playerid,cmdtext[])
{
    if(
PlayerInfo[playerid][LoggedIn] != 1)
        return 
SendClientMessage(playerid, -1"Vocк precisa estб logado para digitar comandos! Use: /logar.");
    return 
true;

Reply
#4

Obg!!!!!!!!!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)