18.06.2014, 22:01
I am not sureof why I am getting the errors and what's causing them. If anyone could help me fix the errors I would be very thankful!
Here are the errors I get.
//---------------------//
inventory.pwn(124) : warning 219: local variable "rows" shadows a variable at a preceding level
inventory.pwn(124) : warning 219: local variable "fields" shadows a variable at a preceding level
inventory.pwn(125) : error 010: invalid function or declaration
inventory.pwn(127) : error 010: invalid function or declaration
inventory.pwn(129) : error 017: undefined symbol "i"
inventory.pwn(129) : error 010: invalid function or declaration
inventory.pwn(129 -- 133) : error 010: invalid function or declaration
inventory.pwn(129 -- 133) : fatal error 107: too many error messages on one line
Код:
forward LoadGlobalObjects(); public LoadGlobalObjects(); new rows, fields; cache_get_data(rows, fields); (125) for(new i = 0; i < rows; i ++) { (127) if(cache_get_field_content_int(i, "PlayerObjectStatus") == 4) { (129) RemoveObjectFromDatabase(cache_get_field_content_int(i, "PID"), true); continue; } (133) GlobalObject[i][PlayerID] = cache_get_field_content_int(i, "PID"); GlobalObject[i][RealID] = cache_get_field_content_int(i, "ID"); new temp[32]; cache_get_field_content(i, "Name", temp); format(GlobalObject[i][O_Name], 32, "%s", temp); GlobalObject[i][Size] = cache_get_field_content_int(i, "H_Size"); GlobalObject[i][TypeID] = cache_get_field_content_int(i, "TypeID"); GlobalObject[i][Carry] = cache_get_field_content_int(i, "Carry"); GlobalObject[i][Display] = cache_get_field_content_int(i, "Display"); GlobalObject[i][Position] = cache_get_field_content_int(i, "Position"); GlobalObject[i][Status] = cache_get_field_content_int(i, "PlayerObjectStatus"); GlobalObject[i][WorldX] = cache_get_field_content_float(i, "WorldX"); GlobalObject[i][WorldY] = cache_get_field_content_float(i, "WorldY"); GlobalObject[i][WorldZ] = cache_get_field_content_float(i, "WorldZ"); GlobalObject[i][GameObject] = CreateDynamicObject(GlobalObject[i][Display], GlobalObject[i][WorldX], GlobalObject[i][WorldY], GlobalObject[i][WorldZ], 0.0, 0.0, 0.0); GlobalObject[i][AreaID] = CreateDynamicRectangle(GlobalObject[i][WorldX]-1, GlobalObject[i][WorldY]-1, GlobalObject[i][WorldX]+1, GlobalObject[i][WorldY]+1); } print("[INVENTORY SUCCESS]: Loaded all the global objects."); return 1; }
//---------------------//
inventory.pwn(124) : warning 219: local variable "rows" shadows a variable at a preceding level
inventory.pwn(124) : warning 219: local variable "fields" shadows a variable at a preceding level
inventory.pwn(125) : error 010: invalid function or declaration
inventory.pwn(127) : error 010: invalid function or declaration
inventory.pwn(129) : error 017: undefined symbol "i"
inventory.pwn(129) : error 010: invalid function or declaration
inventory.pwn(129 -- 133) : error 010: invalid function or declaration
inventory.pwn(129 -- 133) : fatal error 107: too many error messages on one line