function LoadObjects()
{
local a = 1, b = MAX_OBJECTS, text;
while ( a < b )
{
text = ReadIniString( "data/Objects.ini", "Objects", a.tostring() );
if(text)
{
// ID=ModelID PositionX PositionY PositionZ AngleX AngleY AngleZ
local text2, modelid, posx, posy, posz, anglex, angley, anglez;
text2 = split( text, " " );
modelid = text2[0].tointeger();
posx = text2[1].tofloat();
posy = text2[2].tofloat();
posz = text2[3].tofloat();
anglex = text2[4].tofloat();
angley = text2[5].tofloat();
anglez = text2[6].tofloat();
local object;
object = CreateObject( modelid, Vector(posx,posy,posz ) );
object.Angle = Vector( anglex, angley, anglez );
}
a ++;
}
}
I don't know why, but this function isnt working correctly. And server script returns error: 'self' isn't instance of Object.