[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


Messages In This Thread
/daradmin - by MarianaTorres - 18.04.2015, 14:14
Re: /daradmin - by ZeZin - 18.04.2015, 14:18
Re: /daradmin - by ipsLuan - 18.04.2015, 14:19
Re: /daradmin - by MarianaTorres - 18.04.2015, 14:20
Re: /daradmin - by Vegassilva - 18.04.2015, 16:16
Re: /daradmin - by MarianaTorres - 18.04.2015, 20:15
Re: /daradmin - by Cleyson - 19.04.2015, 00:42
Re: /daradmin - by MarianaTorres - 19.04.2015, 01:59
Re: /daradmin - by ipsLuan - 19.04.2015, 13:23
Re: /daradmin - by MarianaTorres - 19.04.2015, 13:39

Forum Jump:


Users browsing this thread: 1 Guest(s)