28.05.2013, 06:57
Create a map loader it's not too hard
pawn Код:
new gMapObjects[MAX_OBJECTS] = { INVALID_OBJECT_ID, ... };
stock AddObject(modelid, ox, oy, oz, rx, ry, rz, distance)
{
for(new i = 0; i < MAX_OBJECTS; i++)
{
if(gMapObjects[i] == INVALID_OBJECT_ID)
{
gMapObjects[i] = CreateObject(modelid, ox, oy, oz, rx, ry, rz, distance);
return i;
}
}
return INVALID_OBJECT_ID;
}
stock DeleteObject(index)
{
if(gMapObjects[index] != INVALID_OBJECT_ID)
{
DestroyObject(gMapObjects[index]);
gMapObjects[index] = INVALID_OBJECT_ID;
return 1;
}
return 0;
}
stock DeleteAllObjects()
{
new count;
for(new i = 0; i < MAX_OBJECTS; i++)
{
if(gMapObjects[i] != INVALID_OBJECT_ID)
{
DestroyObject(gMapObjects[i]);
gMapObjects[i] = INVALID_OBJECT_ID;
count++;
}
}
if(count) return 1;
return 0;
}