DestroyObject doesn't work
#1

I have added the maps to the FS:

Код:


#include <a_samp>

#define FILTERSCRIPT

new tmpobjid;

public OnFilterScriptInit()
{
	print("////////////////////////////////////////////");
	print("Red County Roleplay Map by Intagaming loaded");
 	print("////////////////////////////////////////////");
	tmpobjid = CreateObject(19379,498.914,500.245,1879.925,0.000,90.000,0.000,300.000);
	SetObjectMaterial(tmpobjid, 0, 14832, "lee_stripclub", "Strip_wood_floor", 0);
	tmpobjid = CreateObject(19379,498.909,509.861,1879.925,0.000,90.000,0.000,300.000);
	SetObjectMaterial(tmpobjid, 0, 14832, "lee_stripclub", "Strip_wood_floor", 0);
	tmpobjid = CreateObject(19451,504.223,509.883,1881.759,0.000,0.000,0.000,300.000);
	SetObjectMaterial(tmpobjid, 0, 8130, "vgsschurch", "vgschapelwall01_64", 0);
	return 1;
}

public OnFilterScriptExit()
{
	DestroyObject(tmpobjid);
	print("All maps has been deleted.");
	return 1;
}
But when i unload the FS, the objects doesn't disappear. How to fix this ?
Reply
#2

Make it like
PHP код:
new tmpobjid[***]; 
and replace the CreateObject with CreateDynamicObject

After it
PHP код:
DestroyDynamicObject(tmpobjid[i]); 
. I think it good them the createobject
Reply
#3

Код:
#define FILTERSCRIPT
Remove this shit
Reply
#4

Quote:
Originally Posted by Kaliber
Посмотреть сообщение
Код:
#define FILTERSCRIPT
Remove this shit
I don't think, it really need to delete
Reply
#5

Just create an array because you are trying to assign multiple values to one variable which is causing problems in removing
Reply
#6

Thanks guys, i have added array and it work great. Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)