/changepass problem
#1

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

Reply
#2

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!
Reply
#3

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

Reply
#4

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.
Reply
#5

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")

Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)