EditDynamicObject BUG?
#1

I have furniture system. It was all working few weeks ago. Now, when I edit ANY dynamic object, of course the moving and resizing tool shows, but when I try to move the object it goes crazy. For example, I call the edit function and click on move (X line for example) and objects starts to move so fast and so far. I thought it's mouse bug, but few friends tried it and they got the same bug. I didn't change anything in my script. Can someone help me, it's hard to explain.
Reply
#2

Can you show me your script please?
Reply
#3

Код:
CMD:furnituretest(playerid, params[])
{
	new alonjegkuc = PI[playerid][Kuca];
	new alonjegkuc2 = PI[playerid][Firma];
	new jelblizuicegu = 0;
	new Float:crbnamX, Float:crbnamY, Float:crbnamZ;
	GetPlayerPos(playerid, crbnamX, crbnamY, crbnamZ);
	new koklnam[MAX_PLAYER_NAME];
	ImeIgraca(playerid, koklnam);
	NamjestajaSpawnano++;
	new namajidko = NamjestajaSpawnano;
	NamjestajObjekt[namajidko] = CreateDynamicObject(PI[playerid][NSlot1], crbnamX+2, crbnamY+2, crbnamZ, 0.00000000, 0.00000000, 0.00000000, Kuce[alonjegkuc][VW], Kuce[alonjegkuc][Enterijer]);
	NamjestajInfo[namajidko][NamVlasnik] = PI[playerid][IDLicne];
	NamjestajInfo[namajidko][NamModel] = PI[playerid][NSlot1];
	NamjestajInfo[namajidko][NamX] = crbnamX+2;
	NamjestajInfo[namajidko][NamY] = crbnamY+2;
	NamjestajInfo[namajidko][NamZ] = crbnamZ;
	NamjestajInfo[namajidko][NamRX] = 0.0;
	NamjestajInfo[namajidko][NamRY] = 0.0;
	NamjestajInfo[namajidko][NamRZ] = 0.0;
	NamjestajInfo[namajidko][NamVW] = Kuce[alonjegkuc][VW];
	NamjestajInfo[namajidko][NamInt] = Kuce[alonjegkuc][Enterijer];
	NamjestajInfo[namajidko][NamYN] = 0;
	PI[playerid][NSlot1] = 0;
	new asdnapsprejevi[512], asdsdfoigetidsp[512];
	format(asdsdfoigetidsp, sizeof(asdsdfoigetidsp), "SELECT MAX(ID) FROM `Namjestaj`");
	mysql_query(asdsdfoigetidsp);
	mysql_store_result();
	new asdnovispidd = mysql_fetch_int() + 1;
	mysql_free_result();
	NamjestajInfo[namajidko][NamID] = asdnovispidd;
	format(asdnapsprejevi, sizeof(asdnapsprejevi), "INSERT INTO `Namjestaj` (`ID`,`Vlasnik`,`Model`,`X`,`Y`,`Z`,`VW`,`Enterijer`) VALUES ('%d','%d','%d','%f','%f','%f','%d','%d')",
	asdnovispidd, NamjestajInfo[namajidko][NamVlasnik], NamjestajInfo[namajidko][NamModel], NamjestajInfo[namajidko][NamX], NamjestajInfo[namajidko][NamY], NamjestajInfo[namajidko][NamZ], NamjestajInfo[namajidko][NamVW], NamjestajInfo[namajidko][NamInt]);
	mysql_query(asdnapsprejevi);
	new dajmunamspre[256];
	format(dajmunamspre, sizeof(dajmunamspre), "UPDATE `Igraci` SET `NSlot1` = '0' WHERE `ime` = '%s'", koklnam);
	mysql_query(dajmunamspre, THREAD_OSTALO);
	if(HiFiModel(namajidko))
	{
		HouseSphere[namajidko] = CreateDynamicSphere(NamjestajInfo[namajidko][NamX], NamjestajInfo[namajidko][NamY], NamjestajInfo[namajidko][NamZ], 15.0, NamjestajInfo[namajidko][NamVW], NamjestajInfo[namajidko][NamInt]);
		HouseVolume[namajidko] = 15;
	}
	SCM(playerid, BELA, "{FFFFFF}Postavio si namjestaj u kucu, sada ga premjestaj!");
	EditDynamicObject(playerid, NamjestajObjekt[namajidko]);
	return 1;
}

public OnPlayerEditDynamicObject(playerid, objectid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz)
{
	MoveDynamicObject(objectid, x, y, z, 10.0, rx, ry, rz);
	new daljenam = -1;
	for(new brnamj; brnamj < MAX_NAMJESTAJA; brnamj++)
	{
		if(NamjestajObjekt[brnamj] == objectid) daljenam = brnamj;
	}
	if(daljenam != -1)
	{
	    NamjestajInfo[daljenam][NamX] = x;
	    NamjestajInfo[daljenam][NamY] = y;
	    NamjestajInfo[daljenam][NamZ] = z;
	    NamjestajInfo[daljenam][NamRX] = rx;
	    NamjestajInfo[daljenam][NamRY] = ry;
	    NamjestajInfo[daljenam][NamRZ] = rz;
	    new asdnamjekui[512];
	    format(asdnamjekui, sizeof(asdnamjekui), "UPDATE `Namjestaj` SET `X` = '%f', `Y` = '%f', `Z` = '%f', `RX` = '%f', `RY` = '%f', `RZ` = '%f' WHERE `ID` = '%d'",
		NamjestajInfo[daljenam][NamX], NamjestajInfo[daljenam][NamY], NamjestajInfo[daljenam][NamZ], NamjestajInfo[daljenam][NamRX], NamjestajInfo[daljenam][NamRY], NamjestajInfo[daljenam][NamRZ], NamjestajInfo[daljenam][NamID]);
		mysql_query(asdnamjekui);
	}
}
Reply
#4

pawn Код:
MoveDynamicObject(objectid, x, y, z, 10.0, rx, ry, rz);
try to change 10.0 to something less, maybe 2.0 or something and see if it works
Reply
#5

Always use Streamer_Update whenever you create a new streamed entity in the vicinity of any player.

Also please research auto_increment in MySQL.
Reply
#6

You don't get me sir.

MoveDynamicObject in callback is called when I release the moving/rotating button on moving/rotating tool.

My issue is different. It's bugged when I'm still in moving the object. It should go slowly but It's fast as fck
Reply
#7

Using MoveDynamicObject is not a good idea here. I understand it'd be awesome if other could see the editing live, but it's just not going to work like you want.

It's NOT a bug.
Reply
#8

Quote:
Originally Posted by Vince
Посмотреть сообщение
Always use Streamer_Update whenever you create a new streamed entity in the vicinity of any player.

Also please research auto_increment in MySQL.
Excuse me, but when to call Streamer_Update function for player?
Reply
#9

Quote:
Originally Posted by Crayder
Посмотреть сообщение
Using MoveDynamicObject is not a good idea here. I understand it'd be awesome if other could see the editing live, but it's just not going to work like you want.

It's NOT a bug.
I have seen in Cod5 and servers like that a live preview of object editing, is it possible to be done using MoveDynamicObject or any other function?
Reply
#10

But it all worked few weeks ago. Also this "BUG" is still there in non-streamed objects (CreateObject - EditObject)
Reply
#11

Quote:
Originally Posted by Eth
Посмотреть сообщение
I have seen in Cod5 and servers like that a live preview of object editing, is it possible to be done using MoveDynamicObject or any other function?
It can be done, but it will never been smooth and it will never be 'live'. It will also never be as easy as moving an object. It'll require lot's of speed calculations and everything in between. This includes the trigonometry, vector calculations, object management (using dynamic objects wouldn't be best in this situation, use temporary global objects), and everything else.
Reply
#12

Fixed. Thank you all very much.

If someone has this issue this is how I fixed the problem...

Instead of calling the move and save function constantly I used response to check if editing is done.

Код:
public OnPlayerEditObject(playerid, playerobject, objectid, response, Float:fX, Float:fY, Float:fZ, Float:fRotX, Float:fRotY, Float:fRotZ)
{
	if(response == EDIT_RESPONSE_FINAL)
	{
		MoveObject...
                Save...
	}
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)