13.09.2011, 00:07
pawn Код:
//Testing
YCMD:wipeall(playerid, params[], help)
{
#pragma unused help
#pragma unused params
new string[24];
for (new i = 0; i != 19000; ++i)
{
RemoveBuildingForPlayer(playerid, i, 0.0, 0.0, 0.0, 6000.0);
format(string, sizeof(string), "Object %i removed", i);
SendClientMessage(playerid, 0xFF6600, string);
}
return 1;
}
Edit: client freezes around 300 object deletions, on my pc, probably just processing. However i did find that using my array with the object ids and basically only looping through the ids in there (Known IDs) it doesnt crash. It freezes but then when loop finishes it unfreezes, then i fall for a while and some objects are still in the game (Possible they aren't in the array) and lastly i crash. Here's the code
pawn Код:
//Testing
YCMD:wipeall(playerid, params[], help)
{
#pragma unused help
#pragma unused params
new string[24];
for (new i = 0; i < sizeof(allObjects); ++i)
{
RemoveBuildingForPlayer(playerid, allObjects[i][id], 0.0, 0.0, 0.0, 6000.0);
format(string, sizeof(string), "Object %i removed", allObjects[i][id]);
SendClientMessage(playerid, 0xFF6600, string);
}
return 1;
}