[Ajuda] Simples rep+
#1

Gente ta dando erro aki:

pawn Код:
PlayerInfo[playa][Pontos] = result;
PlayerInfo:
pawn Код:
new PlayerInfo[MAX_PLAYERS][pInfo];
pInfo:

pawn Код:
enum pInfo
{
    Pontos
};
erro:
PHP код:
(18803) : error 006must be assigned to an array 
Ajudem pfvr!!!
Reply
#2

Oque tem nessa variбvel result ? Numeros ou textos ?
Reply
#3

Numeros
Reply
#4

Pode passar a linha onde result foi declarada?
Reply
#5

PHP код:
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
Reply
#6

Mostre o cуdigo inteiro.
Reply
#7

ta ai lуs

PHP код:
    if(strcmp(cmd"/darptsdonate"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_GRAD2"USE: /darptsdonate [id] [pontos]");
                return 
1;
            }
            new 
playa;
            
playa ReturnUser(tmp);
            
tmp strtok(cmdtextidx);
            if (
PlayerInfo[playerid][pAdmin] == 3000 && ServerOwner[playerid] == 1)
            {
                if(
IsPlayerConnected(playa))
                {
                    if(
playa != INVALID_PLAYER_ID)
                    {
                        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: /darptsdonate [id] [pontos]");
                            return 
1;
                        }
                        
ptss strval(tmp);
                        
GetPlayerName(playeridsendernameMAX_PLAYER_NAME);
                        
GetPlayerName(playagiveplayerMAX_PLAYER_NAME);
                        
PlayerInfo[playa][Pontos] = result;
                        
format(stringsizeof(string), "Vocк deu %s pontos de donate para o player: %s!"resultgiveplayer);
                        
SendClientMessage(playeridCOLOR_GRAD1string);
                        
format(stringsizeof(string), "Vocк recebeu %s pontos de donate do dono admin: %s"resultsendername);
                        
SendClientMessage(playaCOLOR_GRAD1string);
                    }
                }
            }
            else
            {
                
SendClientMessage(playeridCOLOR_GRAD1"   Vocк nгo tem permissao para usar esse comando!");
            }
        }
        return 
1;
    } 
Reply
#8

o RESULT й uma string, vc tem que converter para um valor inteiro (int) -.-
Reply
#9

Sou leigo ainda em pawn, poderia me explicar oque preciso fazer?
Reply
#10

strval(result);

Ou tente trocar esta linha:
pawn Код:
PlayerInfo[playa][Pontos] = result;

Para:
pawn Код:
PlayerInfo[playa][Pontos] = strval(tmp);
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)