SA-MP Forums Archive
Array index out of bounds - 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: Array index out of bounds (/showthread.php?tid=455817)



Array index out of bounds - Zex Tan - 03.08.2013

I got this error after following the MySQL script sample.

Код:
E:\San Andreas Multiplayer Server Files (Classified)\Castaway Island Roleplay\gamemodes\CI-RP.pwn(4210 -- 4214) : error 032: array index out of bounds (variable "PlayerInfo")
E:\San Andreas Multiplayer Server Files (Classified)\Castaway Island Roleplay\gamemodes\CI-RP.pwn(4219) : error 032: array index out of bounds (variable "PlayerInfo")
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
The lines at the "PlayerInfo" part.

pawn Код:
- Code Removed -
Any solution for this ? Also, guide me please ^^


Re: Array index out of bounds - Konstantinos - 03.08.2013

Is the Pos in the enum with an array of 4?


Re: Array index out of bounds - Ayumi - 03.08.2013

What did you exactly "follow"?

Also do you even have your MySQL database set up correctly? Does your script successfully connect to your MySQL server?

A link would be much graceful if provided so that we can help, as it looks like you followed a very undetailed tutorial.


Re: Array index out of bounds - Zex Tan - 03.08.2013

Quote:
Originally Posted by _Zeus
Посмотреть сообщение
Is the Pos in the enum with an array of 4?
Nope, Dwayne.


Re: Array index out of bounds - Konstantinos - 03.08.2013

Quote:
Originally Posted by Zex Tan
Посмотреть сообщение
Nope, Dwayne.
Inside the enum, you need to have an array of 4 (0-3) for the X, Y, Z, Angle.

pawn Код:
// ENUM
Pos[4]



Re: Array index out of bounds - Zex Tan - 03.08.2013

Quote:
Originally Posted by _Zeus
Посмотреть сообщение
Inside the enum, you need to have an array of 4 (0-3) for the X, Y, Z, Angle.

pawn Код:
// ENUM
Pos[4]
It works fine, but I found out that it didn't save into the MySQL database.

Код:
[22:15:49] [ERROR] CMySQLQuery::Execute[OnAccountCheck(d)] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM `users` WHERE `Name` = 'Steven Colt' LIMIT 1' at line 1
The line is around here

pawn Код:
- Code Removed -



Re: Array index out of bounds - sleepysnowflake - 03.08.2013

so you're telling me you're creating a RP with that knowledge? good luck.


Re: Array index out of bounds - Konstantinos - 03.08.2013

pawn Код:
SELECT ID, Password,
You have an extra commas before AFTER.


Re: Array index out of bounds - Zex Tan - 03.08.2013

Quote:
Originally Posted by _Zeus
Посмотреть сообщение
pawn Код:
SELECT ID, Password,
You have an extra commas before AFTER.
Alright, thank you. FIXED