Small Error, Need Help - 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: Small Error, Need Help (
/showthread.php?tid=196641)
Small Error, Need Help -
[WF]Demon - 06.12.2010
ive never run into this error before, but here it is
Код:
***\*******\*******\*******\****.pwn(100) : error 033: array must be indexed (variable "dini_Get")
My Code Is *start of it*
Код:
COMMAND:alogin(playerid, params[])
{
if(!params[0]) return SendClientMessage(playerid, red, "Command Syntax /alogin [password]");
if(Logged[playerid] == 1) return SendClientMessage(playerid, red, "You Are Already Registered And Logged In!");
GetPlayerIp(playerid, pIP, sizeof(pIP));
GetPlayerName(playerid, pname, sizeof(pname));
format(file, sizeof(file), USERFILES_PATH, pname);
if(!dini_Exists(file)) return SendClientMessage(playerid, red, "This Account Is Not Registered /aregister to register!");
/* 100 */ if(params[0] == dini_Get(file, "Password"))
{
Re: Small Error, Need Help -
Joe Staff - 06.12.2010
You're assuming he players password is an integer, when it is actually a string.
To compare strings, use strcmp
to obtain a string from dini, use dini's GetString function (I don't really know what it's called because I think dini is inefficient and don't use it)
Re: Small Error, Need Help -
[WF]Demon - 06.12.2010
Wow, im an idiot, thanks i tried that before and musta had something wrong before! Thanks Joe