SA-MP Forums Archive
: error 035: argument type mismatch (argument 3) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: : error 035: argument type mismatch (argument 3) (/showthread.php?tid=655181)



: error 035: argument type mismatch (argument 3) - div - 15.06.2018

Code:
CMD:changepass(playerid, params[])
{
    new player[MAX_PLAYER_NAME],string[256]; // the player name, // and the string for the path
    if(sscanf(params, "s[256]", params))return SendClientMessage(playerid, -1, "/changepassword [password]");//sscanf, what ever u write after /change
    format(string, 256, "Users/%s.ini", player);//put ur ini path here but keep the player
    new INI:file = INI_Open(string); // opening the path
    INI_WriteString(file,  "Password", udb_hash(params));//writing in the path
    INI_Close(file);// close the file
    return 1;

}

Code:
C:\Users\div\Desktop\sampsv\gamemodes\cnr1.pwn(584) : error 035: argument type mismatch (argument 3)



Re: : error 035: argument type mismatch (argument 3) - TadePoleMG - 15.06.2018

GetPlayerName missing.


Re: : error 035: argument type mismatch (argument 3) - div - 15.06.2018

can u show me please? im rookie :/


Re: : error 035: argument type mismatch (argument 3) - TadePoleMG - 15.06.2018

new player[MAX_PLAYER_NAME];
GetPlayerName(playerid, player, MAX_PLAYER_NAME);


Re: : error 035: argument type mismatch (argument 3) - div - 15.06.2018

still not working :/


Re: : error 035: argument type mismatch (argument 3) - jlalt - 15.06.2018

You're using ini write string while udb_hash return value is integer.

PHP Code:
CMD:changepass(playeridparams[])
{
    new 
player[MAX_PLAYER_NAME],string[256]; // the player name, // and the string for the path
    
if(sscanf(params"s[256]"params))return SendClientMessage(playerid, -1"/changepassword [password]");//sscanf, what ever u write after /change
    
GetPlayerName(playeridplayerMAX_PLAYER_NAME);
    
format(string256"Users/%s.ini"player);//put ur ini path here but keep the player
    
new INI:file INI_Open(string); // opening the path
    //INI_WriteString(file,  "Password", udb_hash(params));//writing in the path
    
INI_WriteInt(file"Password"udb_hash(params));
    
INI_Close(file);// close the file
    
return 1;





Re: : error 035: argument type mismatch (argument 3) - div - 15.06.2018

thanks bro! +rep