SA-MP Forums Archive
DestroyDynamicObject - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: DestroyDynamicObject (/showthread.php?tid=629578)



DestroyDynamicObject - MerryDeer - 28.02.2017

Hi,

If i DestroyDynamicObject

new objectid;

onGameModeInit
objectid = CreateDynamicObject



somewhere:


DestroyDynamicObject( objectid );
and instantly
objectid = CreateDynamicObject

So for ex, when ongamemodeinit object id is 0, when i destroy, and create object id will 0?


Re: DestroyDynamicObject - Dokins - 28.02.2017

I don't understand and I'm not sure anyone else will?

Can you be a little more clear.


Re: DestroyDynamicObject - Toroi - 28.02.2017

Test it yourself.

Код:
public OnGameModeInit()
{
	new fasdas;
	fasdas = CreateDynamicObject(params);
	printf("%d this is the object id",fasdas);
	DestroyDynamicObject(fasdas);
	fasdas = CreateDynamicObject(params);
	printf("%d this is the new object id",fasdas);
	return 1;
}



Re: DestroyDynamicObject - Sew_Sumi - 28.02.2017

Quote:
Originally Posted by Troydere
Посмотреть сообщение
Test it yourself.

Код:
public OnGameModeInit()
{
	new fasdas;
	fasdas = CreateDynamicObject(params);
	printf("%d this is the object id",fasdas);
	DestroyDynamicObject(fasdas);
	fasdas = CreateDynamicObject(params);
	printf("%d this is the new object id",fasdas);
	return 1;
}
Yep, it's not hard if you know how to check variables and such...


Re: DestroyDynamicObject - MerryDeer - 28.02.2017

Yes, but it's always the same, i mean when destroydynamicobject, always function createdynamicobject will be created with ID, in free space?


Re: DestroyDynamicObject - Sew_Sumi - 01.03.2017

Either the ID matches, or it doesn't... Which is it?