EditObject spawn at different place after save and load
#1

At first it works fine but when i save the map.when i load it back it does not spawn at the same place

Код:
CMD:eo(playerid,params[])
{
   new i;
   if(sscanf(params,"d",i)) return SendClientMessage(playerid,X11_YELLOW,"stynx correct usage /eo [objectid]");
   if(cmodelid[playerid][i] <= 0 || i >= maxobject) return SendClientMessage(playerid,X11_YELLOW,"+error ! invalid objectid");
   else
   {
         new x = cobject[playerid][i];
   	 new Float:xx,Float:yy,Float:zz;
   	 new Float:rxx,Float:ryy,Float:rzz;
	 GetDynamicObjectPos(x,xx,yy,zz);
	 GetDynamicObjectRot(x,rxx,ryy,rzz);
	 EditDynamicObject(playerid,x);
	 SendClientMessage(playerid,X11_YELLOW,"Hold spacebar to rotate your camera");
   }
   return 1;
}
Код:
public OnPlayerEditDynamicObject(playerid, objectid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz)
{
   	new Float:oldX, Float:oldY, Float:oldZ,
 	Float:oldRotX, Float:oldRotY, Float:oldRotZ;

	GetDynamicObjectPos(objectid, oldX, oldY, oldZ);
 	GetDynamicObjectRot(objectid, oldRotX, oldRotY, oldRotZ);

	if(response == EDIT_RESPONSE_FINAL)
	{
		SetDynamicObjectPos(objectid, x, y, z);
		SetDynamicObjectRot(objectid, rx, ry, rz);
	}

	if(response == EDIT_RESPONSE_CANCEL)
	{
		SetDynamicObjectPos(objectid, oldX, oldY, oldZ);
		SetDynamicObjectRot(objectid, oldRotX, oldRotY, oldRotZ);
	}

	return 1;
}
Reply


Forum Jump:


Users browsing this thread: