SA-MP Forums Archive
/changepass problem - 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: /changepass problem (/showthread.php?tid=324976)



/changepass problem - Dolph - 11.03.2012

I think the title says it all.


http://pastebin.com/K1F8SVhT


Don't really know what to do right now.


Errors:
Quote:

C:\GTA SERVER\gamemodes\Server.pwn(2307) : warning 202: number of arguments does not match definition
C:\GTA SERVER\gamemodes\Server.pwn(2307) : warning 202: number of arguments does not match definition




Re: /changepass problem - fiki574 - 11.03.2012

Add:
pawn Код:
new newpass[20];
and change:
pawn Код:
if(sscanf(params,"i")) return SendClientMessage(playerid, 0xF60000AA, "USAGE: /changepass [new password]");
to:
pawn Код:
if(sscanf(params,"s",newpass)) return SendClientMessage(playerid, 0xF60000AA, "USAGE: /changepass [new password]");
Probably wont give ya any warnings now!


Re: /changepass problem - Dolph - 11.03.2012

Thank you for helping, Fiki, but I still have the same errors. Why did you add the "newpass[20]" variable? It isn't used anywhere.

Quote:

C:\GTA SERVER\gamemodes\MyDm.pwn(2307) : warning 202: number of arguments does not match definition
C:\GTA SERVER\gamemodes\MyDm.pwn(2307) : warning 202: number of arguments does not match definition




Re: /changepass problem - Issam - 11.03.2012

Quote:
Originally Posted by Dolph
Посмотреть сообщение
I think the title says it all.


http://pastebin.com/K1F8SVhT


Don't really know what to do right now.


Errors:
Can you give us the exact line, that gives the error, i think the lines in Pastebin, are not the ones showing the error.


Re: /changepass problem - Dolph - 11.03.2012

Okay, so I have fixed a bit on it and it only returns 1 error now.
pawn Код:
dcmd_changepass(playerid, params[])
{
    new name[MAX_PLAYER_NAME], buf[150], newpass[30];
    GetPlayerName(playerid, name, sizeof(name));
    if(sscanf(params,"s", newpass)) return SendClientMessage(playerid, 0xF60000AA, "USAGE: /changepass [new password]");
    if(strlen(params) >= 3)
    {
        format(file, sizeof(file), "users/%s.txt", name);
        newpass = udb_hash(buf); // here is where I get the error
        dini_Set(file, "Password", newpass);
        SendClientMessage(playerid, COLOUR_GREEN, "Your password has been successfully been changed");
    }
    else
    {
        SendClientMessage(playerid, COLOUR_RED, "Your password must be atleast 3 characters long");
    }
    return 1;
}
Errors:

Quote:

C:\GTA SERVER\gamemodes\Server.pwn(230 : error 033: array must be indexed (variable "newpass")