error 032
#1

I tried to create login/register system and i got this errors:

C:\Users\Nerijus\Desktop\Serveris\gamemodes\999.pw n(104): error 032: array index out of bounds (variable "PlayerInfo")
C:\Users\Nerijus\Desktop\Serveris\gamemodes\999.pw n(105): error 032: array index out of bounds (variable "PlayerInfo")
C:\Users\Nerijus\Desktop\Serveris\gamemodes\999.pw n(106): error 032: array index out of bounds (variable "PlayerInfo")
C:\Users\Nerijus\Desktop\Serveris\gamemodes\999.pw n(107): error 032: array index out of bounds (variable "PlayerInfo")
C:\Users\Nerijus\Desktop\Serveris\gamemodes\999.pw n(108 ) : error 032: array index out of bounds (variable "PlayerInfo")
C:\Users\Nerijus\Desktop\Serveris\gamemodes\999.pw n(109): error 032: array index out of bounds (variable "PlayerInfo")
C:\Users\Nerijus\Desktop\Serveris\gamemodes\999.pw n(110): error 032: array index out of bounds (variable "PlayerInfo")
C:\Users\Nerijus\Desktop\Serveris\gamemodes\999.pw n(111): error 032: array index out of bounds (variable "PlayerInfo")
C:\Users\Nerijus\Desktop\Serveris\gamemodes\999.pw n(112): error 032: array index out of bounds (variable "PlayerInfo")
C:\Users\Nerijus\Desktop\Serveris\gamemodes\999.pw n(113): error 032: array index out of bounds (variable "PlayerInfo")
C:\Users\Nerijus\Desktop\Serveris\gamemodes\999.pw n(114): error 032: array index out of bounds (variable "PlayerInfo")
C:\Users\Nerijus\Desktop\Serveris\gamemodes\999.pw n(115): error 032: array index out of bounds (variable "PlayerInfo")
C:\Users\Nerijus\Desktop\Serveris\gamemodes\999.pw n(116): error 032: array index out of bounds (variable "PlayerInfo")

104 - 116 lines

104 dini_IntSet(Accounts, "XP", PlayerInfo[MAX_PLAYERS][XP]);
105 dini_IntSet(Accounts, "Skinas", PlayerInfo[MAX_PLAYERS][Skinas]);
106 dini_IntSet(Accounts, "Pinigai", PlayerInfo[MAX_PLAYERS][Pinigai]);
107 dini_IntSet(Accounts, "Administratorius", PlayerInfo[MAX_PLAYERS][Administratorius]);
108 dini_IntSet(Accounts, "AdminLevel", PlayerInfo[MAX_PLAYERS][AdminLevel]);
109 dini_IntSet(Accounts, "Gyvybe", PlayerInfo[MAX_PLAYERS][Heath]);
110 dini_IntSet(Accounts, "Sarvai", PlayerInfo[MAX_PLAYERS][Armour]);
111 dini_IntSet(Accounts, "PozicijaX", PlayerInfo[MAX_PLAYERS][pX]);
112 dini_IntSet(Accounts, "PozicijaY", PlayerInfo[MAX_PLAYERS][pY]);
113 dini_IntSet(Accounts, "PozicijaZ", PlayerInfo[MAX_PLAYERS][pZ]);
114 dini_IntSet(Accounts, "Ginklai", PlayerInfo[MAX_PLAYERS][Ginklai]);
115 dini_IntSet(Accounts, "VIP", PlayerInfo[MAX_PLAYERS][VIP]);
116 dini_IntSet(Accounts, "VIPLevel", PlayerInfo[MAX_PLAYERS][VIPLevel]);
Reply
#2

You are meant to use playerid as index not MAX_PLAYERS which is out of bounds as the error informs you.
Reply
#3

so i must MAX_PLAYERS change to playerid?
Reply
#4

In these lines you received the error, the ID of the player must be used instead. Depending on where the code is actually located, there will be a way to determinate the ID of the player.

Let's say the code is located in OnPlayerDisconnect which uses playerid as a way to indicate the player who disconnected therefore you need to use playerid, yes.
Reply
#5

Quote:
Originally Posted by Calisthenics
Посмотреть сообщение
In these lines you received the error, the ID of the player must be used instead. Depending on where the code is actually located, there will be a way to determinate the ID of the player.

Let's say the code is located in OnPlayerDisconnect which uses playerid as a way to indicate the player who disconnected therefore you need to use playerid, yes.
I changed and I got anothers errors:
C:\Users\Nerijus\Desktop\Serveris\gamemodes\999.pw n(109) : warning 213: tag mismatch
C:\Users\Nerijus\Desktop\Serveris\gamemodes\999.pw n(110) : warning 213: tag mismatch
C:\Users\Nerijus\Desktop\Serveris\gamemodes\999.pw n(111) : warning 213: tag mismatch
C:\Users\Nerijus\Desktop\Serveris\gamemodes\999.pw n(112) : warning 213: tag mismatch
C:\Users\Nerijus\Desktop\Serveris\gamemodes\999.pw n(113) : warning 213: tag mismatch

code 96-117 lines:
https://pastebin.com/Lqg0LcVr
Reply
#6

Because position and health/armor are floating-point numbers.

pawn Код:
dini_IntSet(Accounts, "Gyvybe", PlayerInfo[playerid][Health]);
dini_IntSet(Accounts, "Sarvai", PlayerInfo[playerid][Armour]);
dini_IntSet(Accounts, "PozicijaX", PlayerInfo[playerid][pX]);
dini_IntSet(Accounts, "PozicijaY", PlayerInfo[playerid][pY]);
dini_IntSet(Accounts, "PozicijaZ", PlayerInfo[playerid][pZ]);
In the lines above, change dini_IntSet to dini_FloatSet
Reply
#7

great, now i have some new lines and new warning

How to GetPlayerWeapon and write 3 argument(ammo)?

C:\Users\Nerijus\Desktop\Serveris\gamemodes\999.pw n(152) : warning 202: number of arguments does not match definition

code 140-154 lines:
https://pastebin.com/LYLiHYd2
Reply
#8

GetPlayerWeapon returns the current weapon the player is holding.
GetPlayerAmmo returns the current ammo of the weapon the player is holding.

You need to save the ammo as well and after loading:
pawn Код:
GivePlayerWeapon(playerid, PlayerInfo[playerid][Ginklai], PlayerInfo[playerid][ammo_here]);
Reply
#9

Quote:
Originally Posted by Calisthenics
Посмотреть сообщение
GetPlayerWeapon returns the current weapon the player is holding.
GetPlayerAmmo returns the current ammo of the weapon the player is holding.

You need to save the ammo as well and after loading:
pawn Код:
GivePlayerWeapon(playerid, PlayerInfo[playerid][Ginklai], PlayerInfo[playerid][ammo_here]);
Thanks!
Now I have this:
https://imgur.com/a/PYW1Qca
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)