[Help-SOLVED]DestroyObject or DestroyPlayerObject -
TyreXel - 29.11.2009
Hello, I have a little problem with my filterscript, it has some objects in it (40) and I tried when I say on the rcon
unloadfs name the objects to unload(dissapear) but nothing happens
Here is the filterscript code:
pawn Код:
#include <a_samp>
enum player_info
{
objlist[MAX_OBJECTS],
objliston,
}
new Player[MAX_PLAYERS][player_info];
public OnFilterScriptInit()
{
CreateObject(3472, 1546.9180908203, -1686.9438476563, 12.921438217163, 0, 0, 0);
CreateObject(3472, 1547.4383544922, -1663.3696289063, 12.921457290649, 0, 0, 0);
CreateObject(3472, 1523.6510009766, -1678.3605957031, 12.546875, 0, 0, 0);
CreateObject(3472, 1523.654296875, -1657.5338134766, 12.539175033569, 0, 0, 0);
CreateObject(3472, 1523.1976318359, -1633.7961425781, 12.546875, 0, 0, 0);
CreateObject(3472, 1523.5611572266, -1616.9370117188, 12.546875, 0, 0, 0);
CreateObject(3472, 1523.9549560547, -1696.4797363281, 12.546875, 0, 0, 0);
CreateObject(3472, 1523.0546875, -1713.0906982422, 12.546875953674, 0, 0, 0);
CreateObject(3472, 1527.4517822266, -1747.6828613281, 13.046875, 0, 0, 0);
CreateObject(3472, 1547.7509765625, -1748.5711669922, 13.046875, 0, 0, 0);
CreateObject(3472, 1442.4230957031, -1748.6198730469, 13.046875, 0, 0, 0);
CreateObject(3472, 1424.0775146484, -1747.5388183594, 13.046875, 0, 0, 0);
CreateObject(3472, 1405.4566650391, -1756.0563964844, 13.046875, 0, 0, 0);
CreateObject(3472, 1554.1979980469, -1757.0728759766, 13.046875, 0, 0, 0);
CreateObject(3472, 1435.8881835938, -1711.1943359375, 12.546875, 0, 0, 0);
CreateObject(3472, 1435.4837646484, -1690.5928955078, 12.546875, 0, 0, 0);
CreateObject(3472, 1435.6318359375, -1665.8930664063, 12.53956413269, 0, 0, 0);
CreateObject(3472, 1435.5684814453, -1646.1037597656, 12.546875, 0, 0, 0);
CreateObject(3472, 1435.2373046875, -1627.5736083984, 12.546875, 0, 0, 0);
CreateObject(3472, 1436.5178222656, -1603.6163330078, 12.546875, 0, 0, 0);
CreateObject(3472, 1304.7664794922, -1823.1142578125, 12.546875, 0, 0, 0);
CreateObject(3472, 1305.2521972656, -1793.2946777344, 12.546875, 0, 0, 0);
CreateObject(3472, 1304.7613525391, -1767.0673828125, 12.546875, 0, 0, 0);
CreateObject(3472, 1305.0612792969, -1740.4675292969, 12.546875, 0, 0, 0);
CreateObject(3472, 1304.2348632813, -1716.8028564453, 12.546875, 0, 0, 0);
CreateObject(3472, 1305.1383056641, -1689.5628662109, 12.546875, 0, 0, 0);
CreateObject(3472, 1305.0135498047, -1653.2133789063, 14.008493423462, 0, 0, 0);
CreateObject(3472, 1304.7302246094, -1632.0662841797, 14.008493423462, 0, 0, 0);
CreateObject(3472, 1304.5596923828, -1595.6875, 14.008493423462, 0, 0, 0);
CreateObject(3472, 1304.7220458984, -1573.7099609375, 14.008493423462, 0, 0, 0);
CreateObject(3472, 1306.83203125, -1549.1309814453, 12.546875, 0, 0, 0);
CreateObject(3472, 1311.8204345703, -1530.4575195313, 12.546875, 0, 0, 0);
CreateObject(3472, 1323.8781738281, -1508.3793945313, 12.546875, 0, 0, 0);
CreateObject(3472, 1334.9455566406, -1489.2376708984, 12.546875, 0, 0, 0);
CreateObject(3472, 1343.3264160156, -1465.6706542969, 12.539081573486, 0, 0, 0);
CreateObject(3472, 1348.7760009766, -1432.8411865234, 12.546875, 0, 0, 0);
CreateObject(3472, 1435.5250244141, -1026.2412109375, 22.828126907349, 0, 0, 0);
CreateObject(3472, 1451.3140869141, -1025.7727050781, 22.828125, 0, 0, 0);
CreateObject(3472, 1472.1564941406, -1026.7434082031, 22.829742431641, 0, 0, 0);
CreateObject(3472, 1493.36328125, -1027.0809326172, 22.808099746704, 0, 0, 0);
return 1;
}
public OnFilterScriptExit()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
for(new o = 0; o < Player[i][objliston]; o++)
{
DestroyPlayerObject(i,Player[i][objlist][o]);
}
}
}
If someone knows how I can resolve this problem, please post here. Thx people !
Re: [Help]DestroyObject or DestroyPlayerObject -
Nero_3D - 29.11.2009
You create normal objects and then try to destroy playerobjects :S
you main problem was that you didnt saved the ids of your objects, so it just deleted always the object 0
pawn Код:
#include <a_samp>
new First_Object;
new Last_Object;
public OnFilterScriptInit()
{
First_Object = CreateObject(3472, 1546.9180908203, -1686.9438476563, 12.921438217163, 0, 0, 0);
CreateObject(3472, 1547.4383544922, -1663.3696289063, 12.921457290649, 0, 0, 0);
CreateObject(3472, 1523.6510009766, -1678.3605957031, 12.546875, 0, 0, 0);
CreateObject(3472, 1523.654296875, -1657.5338134766, 12.539175033569, 0, 0, 0);
CreateObject(3472, 1523.1976318359, -1633.7961425781, 12.546875, 0, 0, 0);
CreateObject(3472, 1523.5611572266, -1616.9370117188, 12.546875, 0, 0, 0);
CreateObject(3472, 1523.9549560547, -1696.4797363281, 12.546875, 0, 0, 0);
CreateObject(3472, 1523.0546875, -1713.0906982422, 12.546875953674, 0, 0, 0);
CreateObject(3472, 1527.4517822266, -1747.6828613281, 13.046875, 0, 0, 0);
CreateObject(3472, 1547.7509765625, -1748.5711669922, 13.046875, 0, 0, 0);
CreateObject(3472, 1442.4230957031, -1748.6198730469, 13.046875, 0, 0, 0);
CreateObject(3472, 1424.0775146484, -1747.5388183594, 13.046875, 0, 0, 0);
CreateObject(3472, 1405.4566650391, -1756.0563964844, 13.046875, 0, 0, 0);
CreateObject(3472, 1554.1979980469, -1757.0728759766, 13.046875, 0, 0, 0);
CreateObject(3472, 1435.8881835938, -1711.1943359375, 12.546875, 0, 0, 0);
CreateObject(3472, 1435.4837646484, -1690.5928955078, 12.546875, 0, 0, 0);
CreateObject(3472, 1435.6318359375, -1665.8930664063, 12.53956413269, 0, 0, 0);
CreateObject(3472, 1435.5684814453, -1646.1037597656, 12.546875, 0, 0, 0);
CreateObject(3472, 1435.2373046875, -1627.5736083984, 12.546875, 0, 0, 0);
CreateObject(3472, 1436.5178222656, -1603.6163330078, 12.546875, 0, 0, 0);
CreateObject(3472, 1304.7664794922, -1823.1142578125, 12.546875, 0, 0, 0);
CreateObject(3472, 1305.2521972656, -1793.2946777344, 12.546875, 0, 0, 0);
CreateObject(3472, 1304.7613525391, -1767.0673828125, 12.546875, 0, 0, 0);
CreateObject(3472, 1305.0612792969, -1740.4675292969, 12.546875, 0, 0, 0);
CreateObject(3472, 1304.2348632813, -1716.8028564453, 12.546875, 0, 0, 0);
CreateObject(3472, 1305.1383056641, -1689.5628662109, 12.546875, 0, 0, 0);
CreateObject(3472, 1305.0135498047, -1653.2133789063, 14.008493423462, 0, 0, 0);
CreateObject(3472, 1304.7302246094, -1632.0662841797, 14.008493423462, 0, 0, 0);
CreateObject(3472, 1304.5596923828, -1595.6875, 14.008493423462, 0, 0, 0);
CreateObject(3472, 1304.7220458984, -1573.7099609375, 14.008493423462, 0, 0, 0);
CreateObject(3472, 1306.83203125, -1549.1309814453, 12.546875, 0, 0, 0);
CreateObject(3472, 1311.8204345703, -1530.4575195313, 12.546875, 0, 0, 0);
CreateObject(3472, 1323.8781738281, -1508.3793945313, 12.546875, 0, 0, 0);
CreateObject(3472, 1334.9455566406, -1489.2376708984, 12.546875, 0, 0, 0);
CreateObject(3472, 1343.3264160156, -1465.6706542969, 12.539081573486, 0, 0, 0);
CreateObject(3472, 1348.7760009766, -1432.8411865234, 12.546875, 0, 0, 0);
CreateObject(3472, 1435.5250244141, -1026.2412109375, 22.828126907349, 0, 0, 0);
CreateObject(3472, 1451.3140869141, -1025.7727050781, 22.828125, 0, 0, 0);
CreateObject(3472, 1472.1564941406, -1026.7434082031, 22.829742431641, 0, 0, 0);
Last_Object = CreateObject(3472, 1493.36328125, -1027.0809326172, 22.808099746704, 0, 0, 0);
}
public OnFilterScriptExit()
while(First_Object <= Last_Object)
DestroyObject(First_Object++);
public OnGameModeInit() OnFilterScriptInit();
public OnGameModeExit() OnFilterScriptExit();
Re: [Help]DestroyObject or DestroyPlayerObject -
TyreXel - 29.11.2009
Thx man !!!!! Problem solved !
Thx again