Array Index Out of Bounds
#1

Yes, I still post here.

Well, I tried to make a system, but I get a error with hashing the rank array, shown below.

Код:
(685) : error 032: array index out of bounds (variable "rank")
(686) : error 032: array index out of bounds (variable "rank")
That's the error I am getting, and this is the code I'm using that is giving the error.

Код:
rank[24] = udb_hash(rank[24]); // Line 685
PlayerInfo[playerid][pRank] = rank[24]; // Line 686
Oh, and please don't mention to me about using Whirlpool, I know it's safer, but since this is just a private server for testing with friends, safety isn't my biggest concern.
I know this is probably a very easy fix, but I can't see it lol.
Reply
#2

If I'm not mistaken udb_hash returns an integer and you try to set the 24th index of rank array. If rank has size of 24, then the max valid bound is 23.

So if you want to store something to array and then use it in udb_hash and the result onto pRank:
pawn Код:
PlayerInfo[playerid][pRank] = udb_hash(rank);
If it's something else you want to do, please explain and show how you declared rank as well.
Reply
#3

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
If I'm not mistaken udb_hash returns an integer and you try to set the 24th index of rank array. If rank has size of 24, then the max valid bound is 23.

So if you want to store something to array and then use it in udb_hash and the result onto pRank:
pawn Код:
PlayerInfo[playerid][pRank] = udb_hash(rank);
If it's something else you want to do, please explain and show how you declared rank as well.
Thanks alot, Konstantinos, worked like a charm, cheers.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)