28.02.2015, 22:28
Код:
public OnPlayerEditDynamicObject(playerid, objectid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz) { printf("Debug: playerid: %i, objectid: %i, response: %i, X: %f, Y: %f, Z: %f, rX: %f, rY: %f, rZ: %f", playerid, objectid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz); if(oEdit[playerid] == 1) { idx = oEditID[playerid]; if(response == EDIT_RESPONSE_UPDATE) { SetDynamicObjectPos(objectid, x, y, z); SetDynamicObjectRot(objectid, rx, ry, rz); } else if(response == EDIT_RESPONSE_CANCEL) { SetDynamicObjectPos(objectid, oPos[playerid][0], oPos[playerid][1], oPos[playerid][2]); SetDynamicObjectRot(objectid, oRot[playerid][0], oRot[playerid][1], oRot[playerid][2]); oPos[playerid][0] = 0; oPos[playerid][1] = 0; oPos[playerid][2] = 0; oRot[playerid][0] = 0; oRot[playerid][1] = 0; oRot[playerid][2] = 0; oEdit[playerid] = 0; oEditID[playerid] = 0; format(string, sizeof(string), " Cancelled Edit Object ID %d.", idx); SendClientMessage(playerid, COLOR_WHITE, string); } else if(response == EDIT_RESPONSE_FINAL) { SetDynamicObjectPos(objectid, x, y, z); SetDynamicObjectRot(objectid, rx, ry, rz); if(oEdit[playerid] == 1) { ObjectInfo[idx][oX] = x; ObjectInfo[idx][oY] = y; ObjectInfo[idx][oZ] = z; ObjectInfo[idx][oRX] = rx; ObjectInfo[idx][oRY] = ry; ObjectInfo[idx][oRZ] = rz; oEdit[playerid] = 0; oEditID[playerid] = 0; format(string, sizeof(string), "Finished Edit Object ID %d.", idx); SendClientMessage(playerid, COLOR_WHITE, string); SaveObj(); } } } return 1; }