SA-MP Forums Archive
[MySQL] /cahngepass - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [MySQL] /cahngepass (/showthread.php?tid=234519)



[MySQL] /cahngepass - Unknown123 - 03.03.2011

Error:
Код:
C:\Users\Unknown123\Documents\Server\gamemodes\Unknown.pwn(2282) : error 035: argument type mismatch (argument 1)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Code:
pawn Код:
dcmd_changepass(playerid, params[])
{
    new oldpass;
    new queue[313], WPhash[145], escape[145];
    if(sscanf(params, "ss", oldpass, WPhash)) return SendClientMessage(playerid, COLOR_USAGE, "USAGE: /changepass (Old Password) (New Password)");
    else
    {
        mysql_real_escape_string(oldpass, escape); //Line 2282
        WP_Hash(WPhash, sizeof(WPhash), escape);
        format(queue, sizeof(queue), "UPDATE `Players` SET `Password` = '%s' WHERE `Username` = '%s'", WPhash, PlayerIP(playerid));
        mysql_query(queue);
    }
    return 1;
}



Re: [MySQL] /cahngepass - JaTochNietDan - 03.03.2011

Why is oldpass an integer? It should be an array to store all of the characters.

pawn Код:
new oldpass[128];
Also your array sizes are complete madness, just think about them for a while


Re: [MySQL] /cahngepass - Unknown123 - 03.03.2011

Quote:
Originally Posted by JaTochNietDan
Посмотреть сообщение
Why is oldpass an integer? It should be an array to store all of the characters.

pawn Код:
new oldpass[128];
Also your array sizes are complete madness, just think about them for a while
Thanks, but still dont working =/

And if i type wrong "oldpass" then i get a message like "Wrong Old Password!" but i dont know how to do it =/

About my array sizes... i know... complete madness xD


Re: [MySQL] /cahngepass - Antonio [G-RP] - 03.03.2011

Quote:
Originally Posted by Unknown123
Посмотреть сообщение
Thanks, but still dont working =/

And if i type wrong "oldpass" then i get a message like "Wrong Old Password!" but i dont know how to do it =/

About my array sizes... i know... complete madness xD
How could that happen if there isn't a line saying "Wrong Old Password"?


Re: [MySQL] /cahngepass - Unknown123 - 03.03.2011

Quote:
Originally Posted by Antonio [G-RP]
Посмотреть сообщение
How could that happen if there isn't a line saying "Wrong Old Password"?
Because i dont know how to add it

You probaliby mis-understood me, undestandable, i got bad english :P