[Ajuda] Ajuda em bug
#1

galera quando eu digito /rg ele mostra minhas infos e a hab se a hab total for 2 й para mostrar hab nivel B sу que estб mostrando N/A q no caso se fosse 0 mas no arquivo da conta estб 2

COD:

PHP код:
if(strcmp(cmd,"/rg", true)==0)
{
        if(
RGAberto[playerid] == false){
        new 
stringHab[256];
        new 
HabNivel[50];
        if(
PlayerInfo[playerid][HabTotal] == 0) HabNivel = "N/A";
        if(
PlayerInfo[playerid][HabTotal] == 1) HabNivel = "A";
        if(
PlayerInfo[playerid][HabTotal] == 2) HabNivel = "B";
        if(
PlayerInfo[playerid][HabTotal] == 3) HabNivel = "C";
        if(
PlayerInfo[playerid][HabTotal] == 4) HabNivel = "D";
        if(
PlayerInfo[playerid][HabTotal] == 5) HabNivel = "E";
        
format(stringHab, sizeof(stringHab),"%s",HabNivel);
        
TextDrawSetString(NivelHab[playerid], HabNivel);
        
TextDrawShowForPlayer(playerid, NivelHab[playerid]);
        return 
1;
        }
} 
Reply
#2

Provavelmente й algum erro na hora de colocar os dados do arquivo na variбvel PlayerInfo. Verifique a parte em que se carregam os dados dos players.
Reply
#3

Quote:
Originally Posted by SamuelMatheus05
Посмотреть сообщение
PHP код:
        if(PlayerInfo[playerid][HabTotal] == 0) HabNivel = "N/A";
        if(
PlayerInfo[playerid][HabTotal] == 1) HabNivel = "A";
        if(
PlayerInfo[playerid][HabTotal] == 2) HabNivel = "B";
        if(
PlayerInfo[playerid][HabTotal] == 3) HabNivel = "C";
        if(
PlayerInfo[playerid][HabTotal] == 4) HabNivel = "D";
        if(
PlayerInfo[playerid][HabTotal] == 5) HabNivel = "E"; 
Posso estar errado , faz tempo que nгo mecho com isto mas ...
PHP код:
        switch(PlayerInfo[playerid][HabTotal])
        {
              case 
0:{HabNivel = "N/A";}
              case 
1:{HabNivel = "A";}
              case 
2:{HabNivel = "B";}
              case 
3:{HabNivel = "C";}
              case 
4:{HabNivel = "D";}
              case 
5:{HabNivel = "E";}
        } 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)