18.02.2016, 03:45
How to fix symbol already defined: "OnPlayerEditDynamicObject" , my code :
Код:
public OnPlayerEditDynamicObject(playerid, objectid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz) { new idx = gGateEditID[playerid], string[128]; if(response == EDIT_RESPONSE_UPDATE) { SetDynamicObjectPos(objectid, x, y, z); SetDynamicObjectRot(objectid, rx, ry, rz); } else if(response == EDIT_RESPONSE_CANCEL) { if(gGateEdit[playerid] == 1) { SetDynamicObjectPos(objectid, gGatePos[playerid][0], gGatePos[playerid][1], gGatePos[playerid][2]); SetDynamicObjectRot(objectid, gGateRot[playerid][0], gGateRot[playerid][1], gGateRot[playerid][2]); gGatePos[playerid][0] = 0; gGatePos[playerid][1] = 0; gGatePos[playerid][2] = 0; gGateRot[playerid][0] = 0; gGateRot[playerid][1] = 0; gGateRot[playerid][2] = 0; format(string, sizeof(string), "You have cancelled editing gate ID %d.", idx); SendClientMessage(playerid, 0xFFFFFF00, string); gGateEdit[playerid] = 0; gGateEditID[playerid] = 0; return 1; } else if(gGateEdit[playerid] == 2) { SetDynamicObjectPos(objectid, gGatePos[playerid][0], gGatePos[playerid][1], gGatePos[playerid][2]); SetDynamicObjectRot(objectid, gGateRot[playerid][0], gGateRot[playerid][1], gGateRot[playerid][2]); gGatePos[playerid][0] = 0; gGatePos[playerid][1] = 0; gGatePos[playerid][2] = 0; gGateRot[playerid][0] = 0; gGateRot[playerid][1] = 0; gGateRot[playerid][2] = 0; format(string, sizeof(string), "You have cancelled editing gate ID %d.", idx); SendClientMessage(playerid, 0xFFFFFF00, string); gGateEdit[playerid] = 0; gGateEditID[playerid] = 0; return 1; } } else if(response == EDIT_RESPONSE_FINAL) { SetDynamicObjectPos(objectid, x, y, z); SetDynamicObjectRot(objectid, rx, ry, rz); if(gGateEdit[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; gGateEdit[playerid] = 0; gGateEditID[playerid] = 0; format(string, sizeof(string), "You have finished editing gate ID %d's closing position.", idx); SendClientMessage(playerid, 0xFFFFFF00, string); GateInfo[idx][gStatus] = 0; SaveGates(); return 1; } else if(gGateEdit[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; gGateEdit[playerid] = 0; gGateEditID[playerid] = 0; format(string, sizeof(string), "You have finished editing gate ID %d's opening position.", idx); SendClientMessage(playerid, 0xFFFFFF00, string); GateInfo[idx][gStatus] = 1; SaveGates(); return 1; } } return 1; }