Bug with editObject & Streamer
#1

Hey,

I do a simple command to spawn a ladder and edit him.
Problem is, when you finish object's editing, you see him on her new position but other players see him on old position, before editing.

Code :

Код:
if(strcmp(subsubcmd,"poser",true) == 0)
{
	if(EchelleType[playerid] == 0)
		{ShowMessageBox(playerid,"~r~Vous n'avez pas sorti d'echelle !","~b~Erreur"); return 1;}
	new Float:OX, Float:OY, Float:OZ, Float:ORX, Float:ORY, Float:ORZ, Float:OA, Object;
	GetPlayerPos(playerid, OX, OY, OZ);
	GetPlayerFacingAngle(playerid, OA);
	SendClientMessage(playerid, -1, "Utilisez la touche SPRINT pour bouger la camйra");
	Object = CreateDynamicObject(EchelleType[playerid], OX+2, OY, OZ, ORX, ORY, ORZ,-1,-1,-1,100.0);
	Streamer_UpdateEx(playerid,OX+2, OY, OZ,GetPlayerVirtualWorld(playerid),GetPlayerInterior(playerid));
	EditDynamicObject(playerid,Object);
	EchelleHolding[playerid] = false;
	RemovePlayerAttachedObject(playerid, 8);
	return 1;
}
Код:
public OnPlayerEditDynamicObject(playerid, objectid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz)//Pour les objets streamйs comme les tags
{
    new Float:oldX, Float:oldY, Float:oldZ,
		Float:oldRotX, Float:oldRotY, Float:oldRotZ;
	GetObjectPos(objectid, oldX, oldY, oldZ);
	GetObjectRot(objectid, oldRotX, oldRotY, oldRotZ);
    if(response == EDIT_RESPONSE_FINAL)
	{
        if(EchelleHolding[playerid] == 1 || EchelleType[playerid] != 0)
	    {
	 		CreateEchelle(x,y,z,rx,ry,rz, EchelleType[playerid]);
			DestroyObject(objectid);
			EchelleType[playerid] = 0;
		}
	}
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)