DestroyObject when /rcon unloadfs MAP ?
#1

Hey guys

I have little stunting map, so if I load it "/rcon loadfs MAP" it create the objects
But when I unload it, the object still created !

This is it:

pawn Код:
public OnFilterScriptInit()
{
    SendClientMessageToAll(LIGHTGREEN, "Stunting Map Loaded.");
    CreateObject(11539, -706.177063, 1637.122314, 84.878685, 0.0000, 0.0000, 146.2500);
    CreateObject(7474, -736.698425, 1763.900757, 2.589478, 0.0000, 0.0000, 1.7189);
        //Like this line, but a lot :p
    return 0;
}

public OnFilterScriptExit()
{
    SendClientMessageToAll(RED, "Stunting Map Disabled.");
    return 0;//1
}
Then, I have an other MAP, it doesn't works !!

Please I need your idea !
Best regards ~
Reply
#2

DestroyObject on exit?
Reply
#3

pawn Код:
new Object[2]; //2 stands for the number of objects on your server

public OnFilterScriptInit()
{
    SendClientMessageToAll(LIGHTGREEN, "Stunting Map Loaded.");
    Object[0] = CreateObject(11539, -706.177063, 1637.122314, 84.878685, 0.0000, 0.0000, 146.2500);
    Object[1] = CreateObject(7474, -736.698425, 1763.900757, 2.589478, 0.0000, 0.0000, 1.7189);
        //Like this line, but a lot :p
    return 0;
}

public OnFilterScriptExit()
{
    SendClientMessageToAll(RED, "Stunting Map Disabled.");
    DestroyObject(Object[0]);
    DestroyObject(Object[1]);

    return 0;//1
}
Reply
#4

@ iMonk3y
Thank you very much
Reply
#5

A easier and cleaner method is this. No need to change every line and assing them an array.
pawn Код:
//OnFilterScriptExit
{
for(new i = 0; i < MAX_OBJECTS; i++) { DestroyObject(i); } // Change MAX_OBJECTS as needed.
}
Reply
#6

Admantis, that'll destroy EVERY objects, from gamemode/other filterscripts too
However if he uses an 'Object[]' you can use that string to delete objects

pawn Код:
for(new i = 0; i < sizeof(Object); i++)
    DestroyObject(Object[i]);
I think that that'll work. I'm not sure, but I think it'll work :P 95% sure 'bout that.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)