SA-MP Forums Archive
OnPlayerEditDynamicObject - 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: OnPlayerEditDynamicObject (/showthread.php?tid=574667)



OnPlayerEditDynamicObject - zaibaslr2 - 19.05.2015

Hello, it was all okay since now, something happened (I didn't touch the code in this part of script), but now I have a problem.
When I create an object and edit it, it appears for 0.1s and then dissapears and EDIT_RESPONSE_CANCEL starts working.
Code:
if(response == EDIT_RESPONSE_CANCEL)
{
	SendMessage(playerid,NEUTRAL,"Statyba atљaukta.","Building cancelled");
	DestroyDynamicObject(BuildObjects[sklypid][i][buildobj]);
	Stato[playerid]=false;
	return 1;
}
This part of code executes after creating an object. How to fix this?


Re: OnPlayerEditDynamicObject - Yashas - 19.05.2015

"This part of code executes after creating an object. How to fix this? " DestroyDynamicObject destroys the object, i.e: the object will disappear.

And you say that that code is executed after creating an object which means you create the object and then destroy it immediately.


Re: OnPlayerEditDynamicObject - zaibaslr2 - 20.05.2015

Quote:
Originally Posted by Yashas
View Post
"This part of code executes after creating an object. How to fix this? " DestroyDynamicObject destroys the object, i.e: the object will disappear.

And you say that that code is executed after creating an object which means you create the object and then destroy it immediately.
Actually, no.
I just fixed my problem: it was with INVALID_TEXTDRAW_ID on OnPlayerClickTextDraw (i think INVALID_TEXTDRAW_ID also calls the OnPlayerEditDynamicObject CANCEL response)