My GM crashes
#1

So I've been making a furniture system, but when I have to load them, it crashes, this is the line where the crashdetect says that it crash... I don't know what's the problem...

Код:
id = CreateDynamicObject(HouseFurnitures[ FurnitureData[FurnitureID] ][ModelID], FurnitureData[furnitureX], FurnitureData[furnitureY], FurnitureData[furnitureZ], FurnitureData[furnitureRX], FurnitureData[furnitureRY], FurnitureData[furnitureRZ], cache_get_field_content_int(loaded, "furnitureVW"), cache_get_field_content_int(loaded, "furnitureInt"));
Pawno complies it without errors and mysql have no errors. I have tried printing the information that loads the callback, but all the information is OK...
Reply
#2

Код:
FurnitureData[furnitureX], 
FurnitureData[furnitureY], 
FurnitureData[furnitureZ], 
FurnitureData[furnitureRX],
FurnitureData[furnitureRY], 
FurnitureData[furnitureRZ]
Is this meant to be like that?
Reply
#3

Quote:
Originally Posted by Arthur Kane
Посмотреть сообщение
Код:
FurnitureData[furnitureX], 
FurnitureData[furnitureY], 
FurnitureData[furnitureZ], 
FurnitureData[furnitureRX],
FurnitureData[furnitureRY], 
FurnitureData[furnitureRZ]
Is this meant to be like that?
Yes, thats it
Reply
#4

Show your code for FurnitureData.
Reply
#5

Код:
enum    fInfo
{
	SQLID,
	HouseSQLID,
	FurnitureID,
	Float: furnitureX,
	Float: furnitureY,
	Float: furnitureZ,
	Float: furnitureRX,
	Float: furnitureRY,
	Float: furnitureRZ
}

new FurnitureData[fInfo]
There is no problem with this, I think...
Reply
#6

https://sampforum.blast.hk/showthread.php?tid=318212

How's FurnitureData going to be indexed? You need to make a two dimensional array.

An example:

PHP код:
#define MAX_FURNITURE (1000)
enum    fInfo
{
    
SQLID,
    
HouseSQLID,
    
FurnitureID,
    
FloatfurnitureX,
    
FloatfurnitureY,
    
FloatfurnitureZ,
    
FloatfurnitureRX,
    
FloatfurnitureRY,
    
FloatfurnitureRZ
}
new 
FurnitureData[MAX_FURNITURE][fInfo]; 
Reply
#7

pawn Код:
HouseFurnitures[ FurnitureData[FurnitureID] ]
This is 100% the cause. I guess you get "Accessing array index out of bounds on index" either -1 or some large number. You have to check first what the value holds:
pawn Код:
printf("%d", FurnitureData[FurnitureID]);
If it's negative, really big, or your defined invalid value for "FurnitureID", you need to add a surrounding if clause, or change the code in some other way
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)