A problem with the EditAttachedObject
#1

Alright then, the problem: when I finish editing the object, I see the edit, but my friend does not see.

The codes:
Код HTML:
	if (strcmp("/objectmove", cmdtext, true, 10) == 0)
	{
		if(yess[playerid] != 1)
		{
			SetPlayerAttachedObject(playerid, myobject, 19141,  2, 0.11, 0.0,  0.0,  0.0,   0.0,   0.0);
			EditAttachedObject(playerid, myobject);
			yess[playerid] = 1;
			return 1;
		}
		else if(yess[playerid] != 0)
		{
			RemovePlayerAttachedObject(playerid, myobject);
			yess[playerid] = 0;
			return 1;
		}
		return 1;
	}
and the of the public OnPlayerEditAttachedObject
Код HTML:
public OnPlayerEditAttachedObject(playerid, response, index, modelid, boneid, Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ, Float:fRotX, Float:fRotY, Float:fRotZ, Float:fScaleX, Float:fScaleY, Float:fScaleZ)
{
    if(response)
    {
        SendClientMessage(playerid, 0xFFFFFFFF, "Eden omo ?... looooo");
        ao[playerid][index][ao_x] = fOffsetX;
        ao[playerid][index][ao_y] = fOffsetY;
        ao[playerid][index][ao_z] = fOffsetZ;
        ao[playerid][index][ao_rx] = fRotX;
        ao[playerid][index][ao_ry] = fRotY;
        ao[playerid][index][ao_rz] = fRotZ;
        ao[playerid][index][ao_sx] = fScaleX;
        ao[playerid][index][ao_sy] = fScaleY;
        ao[playerid][index][ao_sz] = fScaleZ;
        SetPlayerObjectPos(playerid, index, fOffsetX, fOffsetY, fOffsetZ);
        SetPlayerObjectRot(playerid, index, fRotX, fRotY, fRotZ);
    }
    else
    {
        SendClientMessage(playerid, 0xFFFFFFFF, "Attached object edition not saved.");
        new i = index;
        SetPlayerAttachedObject(playerid, index, modelid, boneid, ao[playerid][i][ao_x], ao[playerid][i][ao_y], ao[playerid][i][ao_z], ao[playerid][i][ao_rx], ao[playerid][i][ao_ry], ao[playerid][i][ao_rz], ao[playerid][i][ao_sx], ao[playerid][i][ao_sy], ao[playerid][i][ao_sz]);
    }
    return 1;
}
thanks for any help
Reply
#2

Something with MoveObject?

Or, try RemovePlayerAttachedObject, then re-create the object with the new co-ordinates?

That could help.
Reply
#3

Why are you using SetPlayerObjectPos/Rot in the callback? Those functions are for use on normal objects, not attached objects. You have to re-apply SetPlayerAttachedObject.
Reply
#4

Well can you change the SetPlayerObjacr Pos\Rot for me ? because I don't understand this fucnction. thank for the help
Reply
#5

can someone share the code pleas i have the same problem
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)