SA-MP Forums Archive
[Ajuda] error 035: argument type mismatch (argument 2) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] error 035: argument type mismatch (argument 2) (/showthread.php?tid=664524)



error 035: argument type mismatch (argument 2) - MineiriinHo - 02.03.2019

Estou utilizando o MySQL mais atualizado, e nгo consigo executar esse cуdigo seguinte:

PHP код:
        for (new 013++) {
        
format(querysizeof(query), "Gun%d"1);
        
cache_get_value_int(iqueryPlayerData[playerid][pGuns][i]);
        
format(querysizeof(query), "Ammo%d"1);
        
cache_get_value_int(iqueryPlayerData[playerid][pAmmo][i]);
    } 



Re: error 035: argument type mismatch (argument 2) - MineiriinHo - 02.03.2019

Alguйm?


Re: error 035: argument type mismatch (argument 2) - Felipealves - 02.03.2019

Manda as variбveis pra eu ver como elas й criada


Re: error 035: argument type mismatch (argument 2) - MineiriinHo - 02.03.2019

PHP код:
enum playerData {
    
pID,
    
pIP[16],
    
pGuns[13],
    
pAmmo[13]
};
new 
PlayerData[MAX_PLAYERS][playerData];
forward OnAccountLoad(playerid);
public 
OnAccountLoad(playerid)
{
    new
        
query[2048];
    
cache_get_value_int(0"ID"PlayerData[playerid][pID]);
    
cache_get_value(0"IP"PlayerData[playerid][pIP]);
    
/*for (new i = 0; i < 13; i ++) {
        format(query, sizeof(query), "Gun%d", i + 1);
        cache_get_value_int(i, query, PlayerData[playerid][pGuns][i]);
        format(query, sizeof(query), "Ammo%d", i + 1);
        cache_get_value_int(i, query, PlayerData[playerid][pAmmo][i]);
    }*/
    
 
    
return 1;




Re: error 035: argument type mismatch (argument 2) - Malandrin - 02.03.2019

Quote:
Originally Posted by Felipealves
Посмотреть сообщение
Manda as variбveis pra eu ver como elas й criada
Creio que o erro nгo seja nas variбveis, atй pq jб tive esse mesmo problema, o problema estб quando ele usa o format e coloca a variбvel formatada na cache_get_value... Como eu disse, jб tive esse problema, nгo consegui resolver entгo tive que fazer tudo manualmente.


Re: error 035: argument type mismatch (argument 2) - Felipealves - 02.03.2019

cache_get_value_name_int(0, query, PlayerData[playerid][pGuns][i]);
cache_get_value_name_int(0, query, PlayerData[playerid][pAmmo][i]);


Re: error 035: argument type mismatch (argument 2) - GuiKommander - 02.03.2019

Tente assim amigo, depois posta o resultado.

PHP код:
enum playerData
{
    
pID,
    
pIP[16],
};
new 
zdata[MAX_PLAYERS][playerData];

new 
pGuns[MAX_PLAYERS][13];
new 
pAmmo[MAX_PLAYERS][13];

forward OnAccountLoad(playerid);
public 
OnAccountLoad(playerid)
{
    new
        
query[2048];

    
cache_get_value_int(0"ID"zdata[playerid][pID]);
    
cache_get_value(0"IP"zdata[playerid][pIP]);


    for (new 
013++)
    {
        
format(querysizeof(query), "Gun%d"1);
        
cache_get_value_name_int(iquerypGuns[playerid][i]);

        
format(querysizeof(query), "Ammo%d"1);
        
cache_get_value_name_int(iquerypAmmo[playerid][i]);
    }
    return 
1;
}

CMD:daskj(playerid)
{
    
OnAccountLoad(playerid);
    return 
1;




Re: error 035: argument type mismatch (argument 2) - MineiriinHo - 02.03.2019

Quote:
Originally Posted by GuiKommander
Посмотреть сообщение
Tente assim amigo, depois posta o resultado.

PHP код:
enum playerData
{
    
pID,
    
pIP[16],
};
new 
zdata[MAX_PLAYERS][playerData];
new 
pGuns[MAX_PLAYERS][13];
new 
pAmmo[MAX_PLAYERS][13];
forward OnAccountLoad(playerid);
public 
OnAccountLoad(playerid)
{
    new
        
query[2048];
    
cache_get_value_int(0"ID"zdata[playerid][pID]);
    
cache_get_value(0"IP"zdata[playerid][pIP]);
    for (new 
013++)
    {
        
format(querysizeof(query), "Gun%d"1);
        
cache_get_value_name_int(iquerypGuns[playerid][i]);
        
format(querysizeof(query), "Ammo%d"1);
        
cache_get_value_name_int(iquerypAmmo[playerid][i]);
    }
    return 
1;
}
CMD:daskj(playerid)
{
    
OnAccountLoad(playerid);
    return 
1;

Opa!
Dei um debug, e estб dando erro na hora de salvar.
Apenas no compiler que funcionou

Erros:
Код:
[21:39:56] [ERROR] cache_get_value_name_int: invalid row index '1' (number of rows: '1')
[21:39:56] [ERROR] cache_get_value_name_int: invalid row index '1' (number of rows: '1')
[21:39:56] [ERROR] cache_get_value_name_int: invalid row index '2' (number of rows: '1')
[21:39:56] [ERROR] cache_get_value_name_int: invalid row index '2' (number of rows: '1')
[21:39:56] [ERROR] cache_get_value_name_int: invalid row index '3' (number of rows: '1')
[21:39:56] [ERROR] cache_get_value_name_int: invalid row index '3' (number of rows: '1')
[21:39:56] [ERROR] cache_get_value_name_int: invalid row index '4' (number of rows: '1')
[21:39:56] [ERROR] cache_get_value_name_int: invalid row index '4' (number of rows: '1')
[21:39:56] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '1')
[21:39:56] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '1')
[21:39:56] [ERROR] cache_get_value_name_int: invalid row index '6' (number of rows: '1')
[21:39:56] [ERROR] cache_get_value_name_int: invalid row index '6' (number of rows: '1')
[21:39:56] [ERROR] cache_get_value_name_int: invalid row index '7' (number of rows: '1')
[21:39:56] [ERROR] cache_get_value_name_int: invalid row index '7' (number of rows: '1')
[21:39:56] [ERROR] cache_get_value_name_int: invalid row index '8' (number of rows: '1')
[21:39:56] [ERROR] cache_get_value_name_int: invalid row index '8' (number of rows: '1')
[21:39:56] [ERROR] cache_get_value_name_int: invalid row index '9' (number of rows: '1')
[21:39:56] [ERROR] cache_get_value_name_int: invalid row index '9' (number of rows: '1')
[21:39:56] [ERROR] cache_get_value_name_int: invalid row index '10' (number of rows: '1')
[21:39:56] [ERROR] cache_get_value_name_int: invalid row index '10' (number of rows: '1')
[21:39:56] [ERROR] cache_get_value_name_int: invalid row index '11' (number of rows: '1')
[21:39:56] [ERROR] cache_get_value_name_int: invalid row index '11' (number of rows: '1')
[21:39:56] [ERROR] cache_get_value_name_int: invalid row index '12' (number of rows: '1')
[21:39:56] [ERROR] cache_get_value_name_int: invalid row index '12' (number of rows: '1')



Re: error 035: argument type mismatch (argument 2) - MineiriinHo - 02.03.2019

Up!!


Re: error 035: argument type mismatch (argument 2) - GuiKommander - 02.03.2019

Ah esqueci,

Vamos lб, se vocк quer pegar sу as informaзхes do Player, й assim

PHP код:
cache_get_value_name_int(
Use Esse, coloque o 0.