Graffiti system - Object doesn't update other player
#1

Hi!

I've a graffiti system with streamer, but when I click on save icon after moving, it doesn't update other players, it stays the location where I created it.

What's the problem?

This is the save and close:
Код:
if(response == EDIT_RESPONSE_FINAL || response == EDIT_RESPONSE_CANCEL)
{
	if(pGraff[playerid][pgSpraying] > 0)
	{
		new g = pGraff[playerid][pgSpraying];
		MoveDynamicObject(objectid, x, y, z, 10.0, rx, ry, rz);
		Graff[g][X] = x;
		Graff[g][Y] = y;
		Graff[g][Z] = z;
		Graff[g][RotX] = rx;
		Graff[g][RotY] = ry;
		Graff[g][RotZ] = rz;
		pGraff[playerid][pgSpraying] = 0;
	}
}
Reply
#2

https://sampwiki.blast.hk/wiki/OnPlayerEditObject
Take a look at the example.
Reply
#3

But I think, MoveDynamicObject must be working...
Reply
#4

Set the position if you want to work don't move the object and expect results.
Reply
#5

Now:

Код:
public OnPlayerEditDynamicObject(playerid, objectid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz)
{
	if(response == EDIT_RESPONSE_UPDATE)
	{
		if(pGraff[playerid][pgSpraying] > 0)
	    {
			MoveDynamicObject(objectid, x, y, z, 10.0, rx, ry, rz);
		}
	}
	if(response == EDIT_RESPONSE_FINAL || response == EDIT_RESPONSE_CANCEL)
	{
		if(pGraff[playerid][pgSpraying] > 0)
	    {
	    	new g = pGraff[playerid][pgSpraying];
			SetDynamicObjectPos(objectid, x, y, z);
			SetDynamicObjectRot(objectid, rx, ry, rz);
	        Graff[g][X] = x;
	        Graff[g][Y] = y;
	        Graff[g][Z] = z;
	        Graff[g][RotX] = rx;
	        Graff[g][RotY] = ry;
	        Graff[g][RotZ] = rz;
	        pGraff[playerid][pgSpraying] = 0;
	    }
	}
}
It works! The fault was in gamemode with another object moving function.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)