Help with 2 errors
#1

I am getting these 2 error.,

Can anyone figure it out and help me ?

Код:
C:\Documents and Settings\User\Desktop\xx\xxx.pwn(824) : error 017: undefined symbol "SLOTS"
C:\Documents and Settings\User\Desktop\xx\xxx.pwn(824) : error 009: invalid array size (negative, zero or out of bounds)
Код:
new SavePlayerPos[SLOTS][SavePlayerPosEnum];
Reply
#2

at the top of it write

new SLOTS;
Reply
#3

Quote:
Originally Posted by XtremeR
Посмотреть сообщение
at the top of it write

new SLOTS;
Still having them

Код:
C:\Documents and Settings\User\Desktop\xx\xxx.pwn(825) : error 008: must be a constant expression; assumed zero
C:\Documents and Settings\User\Desktop\New Folder\xx\xxx.pwn(825) : error 009: invalid array size (negative, zero or out of bounds)
This is the part
Код:
forward UpdateSpeed(playerid);
enum SavePlayerPosEnum {
Float:LastX,
Float:LastY,
Float:LastZ
}

public UpdateSpeed(playerid)
{
	new Float:x,Float:y,Float:z;
	new Float:distance,value;
	for(new i=0; i<SLOTS; i++)
	{
		if(IsPlayerConnected(i))
		{
			GetPlayerPos(i, x, y, z);
			distance = floatsqroot(floatpower(floatabs(floatsub(x,SavePlayerPos[i][LastX])),2)+floatpower(floatabs(floatsub(y,SavePlayerPos[i][LastY])),2)+floatpower(floatabs(floatsub(z,SavePlayerPos[i][LastZ])),2));
    		// Distance: meters in the last second
			value = floatround(distance * 3600);
			if(UpdateSeconds > 1)
			{
				value = floatround(value / UpdateSeconds);
			}
			distance1[i] = floatround(value/1600);

			SavePlayerPos[i][LastX] = x;
			SavePlayerPos[i][LastY] = y;
			SavePlayerPos[i][LastZ] = z;
Reply
#4

Quote:
Originally Posted by XtremeR
Посмотреть сообщение
at the top of it write

new SLOTS;
No.

pawn Код:
// At the top, under '#include (s)'
#define SLOTS 50 // Change it to your slots you want!
pawn Код:
enum SavePlayerPosEnum
{
    Float:LastX,
    Float:LastY,
    Float:LastZ
};
new
    SavePlayerPos[SLOTS][SavePlayerPosEnum]
;
Reply
#5

Quote:
Originally Posted by Dwane
Посмотреть сообщение
No.

pawn Код:
// At the top, under '#include (s)'
#define SLOTS 50 // Change it to your slots you want!
pawn Код:
enum SavePlayerPosEnum
{
    Float:LastX,
    Float:LastY,
    Float:LastZ
};
new
    SavePlayerPos[SLOTS][SavePlayerPosEnum]
;
Got another 2 errors.

Код:
C:\Documents and Settings\User\Desktop\xx\xxx.pwn(827) : error 017: undefined symbol "SavePlayerPosEnum"
C:\Documents and Settings\User\Desktop\xx\xxx.pwn(827) : error 009: invalid array size (negative, zero or out of bounds)
Reply
#6

Show lines 826-828.
Reply
#7

Quote:
Originally Posted by Dwane
Посмотреть сообщение
Show lines 826-828.
Код:
new SavePlayerPos[SLOTS][SavePlayerPosEnum];

new restarting; //This one isnt concerning this thing :o..
Reply
#8

Do you have this
pawn Код:
enum SavePlayerPosEnum
{
    Float:LastX,
    Float:LastY,
    Float:LastZ
};
before that line?
pawn Код:
new SavePlayerPos[SLOTS][SavePlayerPosEnum];
If you have the enum after the variable, it will keep giving you error.
Reply
#9

Quote:
Originally Posted by Dwane
Посмотреть сообщение
Do you have this
pawn Код:
enum SavePlayerPosEnum
{
    Float:LastX,
    Float:LastY,
    Float:LastZ
};
before that line?
pawn Код:
new SavePlayerPos[SLOTS][SavePlayerPosEnum];
If you have the enum after the variable, it will keep giving you error.
Fixed all right , thanks foh explainin Appriciated ur help
Reply
#10

Hey Help please i got this Error too

C:\Documents and Settings\User\Desktop\xx\xxx.pwn(827) : error 017: undefined symbol "SavePlayerPosEnum"
C:\Documents and Settings\User\Desktop\xx\xxx.pwn(827) : error 009: invalid array size (negative, zero or out of bounds)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)