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;
}
#define function%0(%1) forward%0(%1); public%0(%1)

function LoadGlobalObjects()
{
new rows, fields;
cache_get_data(rows, fields);
for(new i = 0; i < rows; i ++)
{
if(cache_get_field_content_int(i, "PlayerObjectStatus") == 4)
{
RemoveObjectFromDatabase(cache_get_field_content_int(i, "PID"), true);
continue;
}
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;
}
|
So you don't have to do "forward function();" and then "public function()". Add this on top of your gamemode:
pawn Код:
![]() pawn Код:
|