[Ajuda] Sistema de Banimento de Serial
#1

Estou com problemas no sistema de banimento de serial do meu server, da pra banir a serial normalmente, o problema esta no desban, o comando nao esta funcionando, quando uso o comando aparece "Serial nгo encontrado na base de dados".


PHP Code:
native gpci (playeridserial [], len);
if(
strcmp(cmd"/banserial"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
        if(
PlayerInfo[playerid][pAdmin] != 10) return SendClientMessage(playeridCOLOR_RED" Esse Comando й Totalmente Restrito, Vocк nгo tem acesso a ele.");
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_GRAD2"USE: /banserial [id] [motivo]");
                return 
1;
            }
                new 
id strval(tmp);
                if(!
IsPlayerConnected(id))
                {
                
SendClientMessage(playeridCOLOR_RED" ID Informado й Invalido.");
                return 
1;
                }
                
giveplayerid ReturnUser(tmp);
                if(
admtrampando[playerid] < && PlayerInfo[playerid][pAdmin] != 10)
                    {
                    
SendClientMessage(playeridCOLOR_GRAD1"Vocк nгo estб trabalhando! (/trabalhar)");
                    return 
1;
                    }
                        
GetPlayerName(giveplayeridgiveplayersizeof(giveplayer));
                        
GetPlayerName(playeridsendernamesizeof(sendername));
                        new 
length strlen(cmdtext);
                        while ((
idx length) && (cmdtext[idx] <= ' '))
                        {
                            
idx++;
                        }
                        new 
offset idx;
                        new 
result[64];
                        while ((
idx length) && ((idx offset) < (sizeof(result) - 1)))
                        {
                            
result[idx offset] = cmdtext[idx];
                            
idx++;
                        }
                        
result[idx offset] = EOS;
                        if(!
strlen(result))
                        {
                            
SendClientMessage(playeridCOLOR_GRAD2"USE: /banserial [id] [motivo]");
                            return 
1;
                        }
                        if(
PlayerInfo[giveplayerid][pAdmin] >= 10)
                        {
                            
SendClientMessage(playeridCOLOR_GRAD1"Vocк nгo pode banir um Desenvolvedor !");
                            return 
1;
                        }
                        new 
arquivo[64], tmp2[20], stri[64], playerserial[128], string2[64];
                        
gpci(giveplayeridplayerserialsizeof(playerserial));
                        
format(stringsizeof(string), "O %s %s Baniu o Serial %s de %s"CargoAdmin(playerid), sendernameplayerserialgiveplayer);
                        
ChatDono(COLOR_ORANGEstring10);
                        
getdate(AnoMesDia);
                        
format(tmp20"%d/%d/%d"DiaMesAno);
                        
gettime(HoraMinutoSegundo);
                        
format(tmp220"%d:%d:%d"HoraMinutoSegundo);
                        
format(stringsizeof(string), "O %s %s baniu o Serial do Jogador %s, Motivo: %s",CargoAdmin(playerid), sendernamegiveplayer, (result));
                        
SendClientMessageToAll(COLOR_REDstring);
                        
format(gstring,sizeof(gstring), " %s Serial:%s foi banido pelo %s %s, motivo: %s"PlayerName(giveplayerid), playerserialCargoAdmin(playerid), PlayerName(playerid), resultstring2string);
                        
SBanLog(gstring);
                        
Kick(giveplayerid);
                        if(!
dini_Exists(arquivo))
                        {
                            
format(strisizeof(stri), "SerialBanidos/%s.ini",playerserial);
                            
dini_Create(stri);
                            
dini_Set(stri,"Motivo",(result));
                            
dini_Set(stri,"Admin",PlayerName(playerid));
                            
dini_Set(stri,"Data",tmp);
                            
dini_Set(stri,"Hora",tmp2);
                            
dini_Set(stri,"Nick",PlayerName(giveplayerid));
                            
StatusPlayer(5giveplayerid);
                            return 
1;
                 }
             }
    }
if(
strcmp(cmd,"/desbanserial",true)==0)
       {
        if(
PlayerInfo[playerid][pAdmin] != 10) return SendClientMessage(playeridCOLOR_RED" Apenas O Desenvolvedor pode usar esse comando.");
          {
            
tmp strtok(cmdtext,idx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playerid,COLOR_GRAD1,"USE: /desbanserial [Serial DO JOGADOR]");
                return 
1;
               }
            
format(gstring,sizeof(gstring), "SerialBanidos/%s.ini"tmp);
            if(
dini_Exists(gstring))
            {
                
GetPlayerName(playeridsendernamesizeof(sendername));
                new 
arquivo[78];
                
format(arquivosizeof(arquivo), "SerialBanidos/%s.ini",tmp);
                
format(string,sizeof(string), "O %s %s desbaniu o Serial do jogador %s",CargoAdmin(playerid), sendernamedini_Get(arquivo,"Nick"));
                
SendClientMessageToAll(COLOR_REDstring);
                
dini_Remove(gstring);
                return 
1;
            }
            else
            {
            
SendClientMessage(playerid,COLOR_GRAD1,"Serial nгo encontrado na base de dados");
            return 
1;
            }
        }
    } 
Reply


Messages In This Thread
Sistema de Banimento de Serial - by MateGPlay - 19.01.2019, 17:46
Re: Sistema de Banimento de Serial - by InsaneBR - 19.01.2019, 18:29
Re: Sistema de Banimento de Serial - by MateGPlay - 19.01.2019, 19:00
Re: Sistema de Banimento de Serial - by InsaneBR - 19.01.2019, 19:01
Re: Sistema de Banimento de Serial - by MateGPlay - 19.01.2019, 19:03
Re: Sistema de Banimento de Serial - by InsaneBR - 19.01.2019, 19:14
Re: Sistema de Banimento de Serial - by MateGPlay - 19.01.2019, 20:11
Re: Sistema de Banimento de Serial - by InsaneBR - 19.01.2019, 20:45
Re: Sistema de Banimento de Serial - by MateGPlay - 19.01.2019, 22:34

Forum Jump:


Users browsing this thread: 1 Guest(s)