04.05.2014, 02:02
Hello
how do i make this OnPlayerEditDynamicObject unsync?, Players cannot see its moving/rotating while editing, position will be change if you finish editing
how do i make this OnPlayerEditDynamicObject unsync?, Players cannot see its moving/rotating while editing, position will be change if you finish editing
Код:
public OnPlayerEditDynamicObject(playerid, objectid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz) { new string[128], idx = gEditID[playerid]; if(response == EDIT_RESPONSE_UPDATE) { SetDynamicObjectPos(objectid, x, y, z); SetDynamicObjectRot(objectid, rx, ry, rz); } else if(response == EDIT_RESPONSE_CANCEL) { SetDynamicObjectPos(objectid, gPos[playerid][0], gPos[playerid][1], gPos[playerid][2]); SetDynamicObjectRot(objectid, gRot[playerid][0], gRot[playerid][1], gRot[playerid][2]); gPos[playerid][0] = 0; gPos[playerid][1] = 0; gPos[playerid][2] = 0; gRot[playerid][0] = 0; gRot[playerid][1] = 0; gRot[playerid][2] = 0; format(string, sizeof(string), " You have canceled editing gate 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(gEdit[playerid] == 1) { GateInfo[idx][gCX] = x; GateInfo[idx][gCY] = y; GateInfo[idx][gCZ] = z; GateInfo[idx][gCRX] = rx; GateInfo[idx][gCRY] = ry; GateInfo[idx][gCRZ] = rz; // if(IsValidDynamic3DTextLabel(GateInfo[idx][gText])) DestroyDynamic3DTextLabel(GateInfo[idx][gText]); format(string, sizeof(string), "Gate ID: %d", idx); // GateInfo[idx][gText] = CreateDynamic3DTextLabel(string, COLOR_WHITE, GateInfo[idx][gCX], GateInfo[idx][gCY], GateInfo[idx][gCZ], 10); gEdit[playerid] = 0; gEditID[playerid] = 0; format(string, sizeof(string), " You have finished editing gate ID %d's closing position.", idx); SendClientMessage(playerid, COLOR_WHITE, string); GateInfo[idx][gStatus] = 0; } else if(gEdit[playerid] == 2) { GateInfo[idx][gOX] = x; GateInfo[idx][gOY] = y; GateInfo[idx][gOZ] = z; GateInfo[idx][gORX] = rx; GateInfo[idx][gORY] = ry; GateInfo[idx][gORZ] = rz; gEdit[playerid] = 0; gEditID[playerid] = 0; format(string, sizeof(string), " You have finished editing gate ID %d's opening position.", idx); SendClientMessage(playerid, COLOR_WHITE, string); GateInfo[idx][gStatus] = 1; } } return 1; }