29.07.2010, 15:06
Hey.
I just tried to make a login system but i have an error with my array index...
Here my Code:
My Error:
The Exact Line:
Hm I really dont know what i did wrong...
Please help
I just tried to make a login system but i have an error with my array index...
Here my Code:
pawn Код:
CMD:login(playerid, params[])
{
new pname[56];
new file[56];
new password[256];
GetPlayerName(playerid, pname, sizeof(pname));
format(file, sizeof(file), "//USERS//%s.ini", pname);
if (sscanf(params, "", params[0]))
{
SendClientMessage(playerid, RED, "BENUTZE: /login [PASSWORT]");
}
else
{
if (fexist(file))
{
if (GetPVarInt(playerid, "IsLogged") == 0)
{
password = dini_Get(file, "Passwort");
if (udb_hash(params[0]) == password)
{
SendClientMessage(playerid, YELLOW, "Erfolgreich eingeloggt.");
Player[playerid][Kills] = dini_Int(file, "Kills");
Player[playerid][Tode] = dini_Int(file, "Tode");
Player[playerid][Money] = dini_Int(file, "Money");
Player[playerid][Konto] = dini_Int(file, "Konto");
Player[playerid][Wanted] = dini_Int(file, "Wanted");
Player[playerid][ALevel] = 0;
Player[playerid][Fraktion] = dini_Int(file, "Fraktion");
Player[playerid][Rank] = dini_Int(file, "Rank");
Player[playerid][Skin] = dini_Int(file, "Skin");
SetPlayerSkin(playerid, Player[playerid][Skin]);
SetPVarInt(playerid, "IsLogged", 1);
}
else
{
SendClientMessage(playerid, RED, "SERVER: Falsches Passwort");
printf("%s : Failed Login", pname);
}
}
else
{
SendClientMessage(playerid, RED, "SERVER: Du bist bereits eingeloggt.");
}
}
else
{
SendClientMessage(playerid, RED, "SERVER: Du hast noch keinen Account.");
SendClientMessage(playerid, RED, "SERVER: Benutze /register [PASSWORT] um einen zu erstellen.");
}
}
return 1;
}
Quote:
C:\Users\Jonni\Desktop\SA-MP Server\gamemodes\TheKillerzBeta.pwn(2140) : error 033: array must be indexed (variable "password") |
pawn Код:
if (udb_hash(params[0]) == password)
Please help