[Ajuda] /daradmin
#1

Olб pessoal blz?

Bom to com um bug aqui no meu /daradmin,й o seguinte,quando dou /daradmin [id] [level] ele dб admin para o player,porйm nгo salva o nick dele na pasta config/admins.cfg,ai quando eu vou dar /infoadmin para ver quem sгo os admins registrados nгo aparece,to tentando arduamente resolver mas nгo consigo,alguem pode me ajuda?

/daradmin

PHP код:
if(strcmp(cmd"/daradmin"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            if(
PlayerInfo[playerid][pAdmin] < 1340)
            {
                
SendClientMessage(playeridCOLOR_GRAD1"Vocк nгo pode usar esse comando.");
                return 
1;
            }
            
VagaAdmins();
            if(
VagasLivresAdm == 0)
            {
                
SendClientMessage(playeridCOLOR_GRAD1"Nгo hб mais vagas na lista use /limparadmin primeiro.");
                return 
1;
            }
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_GRAD2"USE: /daradmin [id] [Nivel]");
                return 
1;
            }
            new 
para1;
            new 
level;
            
para1 ReturnUser(tmp);
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_GRAD2"USE: /daradmin [id] [Nivel]");
                return 
1;
            }
            
level strval(tmp);
            
GetPlayerName(para1giveplayersizeof(giveplayer));
            
GetPlayerName(playeridsendernamesizeof(sendername));
            if(
IsPlayerConnected(para1))
            {
                if(
para1 != INVALID_PLAYER_ID)
                {
                    if(
IsPlayerConnected(playerid))
                    {
                        if(
PlayerInfo[para1][pAdmin] == 1342)
                        {
                            return 
1;
                        }
                        
PlayerInfo[para1][pAdmin] = level;
                        
format(stringsizeof(string), "Parabйns vocк acaba de receber level %d de Admin pelo %s"levelPlayerName(playerid));
                         
SendClientMessage(para1COLOR_LIGHTBLUEstring);
                        
format(stringsizeof(string), "Vocк promoveu %s para o level %d de Admin."giveplayer,level);
                        
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                        
getdate(yearmonthday);
                        
gettime(hour,minute,second);
                        
format(stringsizeof(string), "%s deu admin nivel %d para %s [%d/%d/%d] бs [%d:%d:%d]."sendernamelevelgiveplayerday,monthyearhourminutesecond);
                        
PAdminsLog(string);
                        new 
adminid 0;
                        for(new 
0sizeof(AdmInfo); i++)
                        {
                            if(
strcmp(giveplayer,AdmInfo[i][AdminNome],true)==0)
                            {
                                
AdmInfo[i][AdminNivel] = level;
                                  
adminid 1;
                                
SalvarAdmins();
                                return 
1;
                            }
                        }
                        if(
adminid == 0)
                        {
                            for(new 
0sizeof(AdmInfo); i++)
                            {
                                if(
strcmp("Ninguem",AdmInfo[i][AdminNome],true)==0)
                                {
                                    
strmid(AdmInfo[i][AdminNome], giveplayer0strlen(giveplayer), 255);
                                    
AdmInfo[i][AdminNivel] = level;
                                    
SalvarAdmins();
                                    return 
1;
                                }
                            }
                        }
                        return 
1;
                    }
                }
            }
        }
        return 
1;
    } 
/infoadmin

PHP код:
if(strcmp("/infoadm"cmdtexttrue10) == || strcmp("/infoadmin"cmdtexttrue10) == || strcmp("/infoadmins"cmdtexttrue10) == 0)
    {
          if(
PlayerInfo[playerid][pAdmin] < 1)
          {
               
SendClientMessage(playeridCOLOR_GRAD1"Vocк nгo pode usar esse comando.");
               return 
1;
          }
          new 
lol 0;
          new 
arquivo[128];
          
SendClientMessage(playeridCOLOR_VERDE"Administradores do BJA:");
          while(
lol sizeof(AdmInfo))
          {
               if(
lol == 0)
               {
                    if(
strcmp(AdmInfo[lol][AdminNome],"Ninguem",true) != 0)
                    {
                         
format(arquivosizeof(arquivo), "Players/%s.ini",AdmInfo[lol][AdminNome]);
                         
format(stringsizeof(string), "%s | Nivel: [Dono-Scripter] | Vaga:[%d]"AdmInfo[0][AdminNome],  lol);
                         
SendClientMessage(playeridCOLOR_GRAD2string);
                    }
               }
               else if(
lol == 1)
               {
                    if(
strcmp(AdmInfo[lol][AdminNome],"Ninguem",true) != 0)
                    {
                         
format(arquivosizeof(arquivo), "Players/%s.ini",AdmInfo[lol][AdminNome]);
                         
format(stringsizeof(string), "%s | Nivel: [Dono] | Vaga:[%d]"AdmInfo[1][AdminNome],  lol);
                         
SendClientMessage(playeridCOLOR_GRAD2string);
                    }
               }
               else if(
lol == 2)
               {
                    if(
strcmp(AdmInfo[lol][AdminNome],"Ninguem",true) != 0)
                    {
                         
format(arquivosizeof(arquivo), "Players/%s.ini",AdmInfo[lol][AdminNome]);
                         
format(stringsizeof(string), "%s | Nivel: [Sub-Dono] | Vaga:[%d]"AdmInfo[2][AdminNome],  lol);
                         
SendClientMessage(playeridCOLOR_GRAD2string);
                    }
               }
               else if(
lol == 3)
               {
                    if(
strcmp(AdmInfo[lol][AdminNome],"Ninguem",true) != 0)
                    {
                         
format(arquivosizeof(arquivo), "Players/%s.ini",AdmInfo[lol][AdminNome]);
                         
format(stringsizeof(string), "%s | Nivel: [Ajudante Sub-Dono] | Vaga:[%d]"AdmInfo[3][AdminNome],  lol);
                         
SendClientMessage(playeridCOLOR_GRAD2string);
                    }
               }
               else if(
lol == 4)
               {
                    if(
strcmp(AdmInfo[lol][AdminNome],"Ninguem",true) != 0)
                    {
                         
format(arquivosizeof(arquivo), "Players/%s.ini",AdmInfo[lol][AdminNome]);
                         
format(stringsizeof(string), "%s | Nivel: [Ajudante Sub-Dono] | Vaga:[%d]"AdmInfo[4][AdminNome],  lol);
                         
SendClientMessage(playeridCOLOR_GRAD2string);
                    }
               }
               else
               {
                    if(
strcmp(AdmInfo[lol][AdminNome],"Ninguem",true) != 0)
                    {
                         
format(arquivosizeof(arquivo), "Players/%s.ini",AdmInfo[lol][AdminNome]);
                         
format(stringsizeof(string), "%s | Nivel: [%d] | Vaga:[%d]"AdmInfo[lol][AdminNome],AdmInfo[lol][AdminNivel], lol);
                         
SendClientMessage(playeridCOLOR_GRAD2string);
                    }
               }
               
lol++;
          }
          return 
1;
    } 
Obrigadaa
Reply
#2

Mande a funзгo
pawn Код:
SalvarAdmins();
Reply
#3

Os GameModes denominados BPC edit/GF edit tem este erro.
Aconselho que faзa um GameMode do 0 ou entгo re-faзa o sistema por completo.
Reply
#4

Quote:
Originally Posted by ZeZin
Посмотреть сообщение
Mande a funзгo
pawn Код:
SalvarAdmins();
PHP код:
public SalvarAdmins()
{
    new 
idx;
    new 
Filefile2;
    while (
idx sizeof(AdmInfo))
    {
        new 
coordsstring[256];
        
format(coordsstringsizeof(coordsstring), "%s,%d|\n",AdmInfo[idx][AdminNome],AdmInfo[idx][AdminNivel]);
        if(
idx == 0)
        {
            
file2 fopen("Configs/Admins.cfg"io_write);
        }
        else
        {
            
file2 fopen("Configs/Admins.cfg"io_append);
        }
        
fwrite(file2coordsstring);
        
idx++;
        
fclose(file2);
    }
    return 
1;

Reply
#5

User DOF2 para salvar suas Contas de Admin ...

https://sampforum.blast.hk/showthread.php?tid=422519
Reply
#6

Nгo ajudo em nd
Reply
#7

Qual include de salvamento vocк usa ?
Reply
#8

Dini
Reply
#9

Re-faz o sistema, acho bem mais viбvel.
Reply
#10

Quote:
Originally Posted by Luan Argolo
Посмотреть сообщение
Re-faz o sistema, acho bem mais viбvel.
Mas preciso achar o erro,qual erro estб?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)