SA-MP Forums Archive
Problem:array must be indexed - 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: Problem:array must be indexed (/showthread.php?tid=411789)



Problem:array must be indexed - dusk - 30.01.2013

So this is my problem:
pawn Код:
C:\Users\Justas\Desktop\TestServer\gamemodes\test3.pwn(271) : error 033: array must be indexed (variable "password")
And this is the line:
pawn Код:
password = strval(inputtext);
Help would be aprreciated


AW: Problem:array must be indexed - Blackazur - 30.01.2013

Quote:

if(strval(password) >= 0 && strval(password) <= 299)

maybe.


Re: Problem:array must be indexed - Zamaroht - 30.01.2013

Quote:
Originally Posted by dusk
Посмотреть сообщение
So this is my problem:
pawn Код:
C:\Users\Justas\Desktop\TestServer\gamemodes\test3.pwn(271) : error 033: array must be indexed (variable "password")
And this is the line:
pawn Код:
password = strval(inputtext);
Help would be aprreciated
password is an array, and strval returns a single integer number.
What are you exactly trying to do in your code? Show us the part where you declare 'password' (that is, something looking like 'new password[X]')


Re: Problem:array must be indexed - dusk - 30.01.2013

pawn Код:
new password[256];
I want to put inputtext into format


Re: Problem:array must be indexed - tyler12 - 30.01.2013

format(password,sizeof(password),"%s",inputtext);

strval() will just get the numbers out of the string.


Re: Problem:array must be indexed - dusk - 30.01.2013

Thanks i guess...i tried the same and i swear,it didn't work! +Rep tho


AW: Problem:array must be indexed - Kwashiorkor - 30.01.2013

the maximum len of the input is 128. so why is the array 256 characters big?


Re: Problem:array must be indexed - dusk - 30.01.2013

Could anyone tell me: how do i extract a part from a .txt file and compare it with a string?


Re: Problem:array must be indexed - u3ber - 30.01.2013

@dusk - you could use the native file functions, but there are systems designed to make this an easy task...


Re: Problem:array must be indexed - dusk - 30.01.2013

then, how do i extract a piece of information from the file? not all text but only a piece?