Hide/Show Objects with Command.
#4

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;
}
Reply


Messages In This Thread
Hide/Show Objects with Command. - by ]Rafaellos[ - 28.05.2013, 06:17
Re: Hide/Show Objects with Command. - by Abhishek. - 28.05.2013, 06:23
Re: Hide/Show Objects with Command. - by ]Rafaellos[ - 28.05.2013, 06:54
Re: Hide/Show Objects with Command. - by Pottus - 28.05.2013, 06:57

Forum Jump:


Users browsing this thread: 1 Guest(s)