06.10.2016, 11:09
Hello everyone!
I'm making a bridge collapse and repair system upon bombing. I have stored the coordinates and stuff in the enumerator arrays, planning to move them in the database after I successfully make it working. But my problem here right now is, the bridge has 2 objects and both has their own coordinates for fixed and damaged ones.
As you can see the single bridge has two IDs in this one.
This works when I loop through the bridge IDs and set the objects' position defined in the array like
I am trying to include both objects and their coordinates in one bridge ID so that I could just use bridge ID 0 and both the objects would change their position, but I am out of idea on how to do it.
Sorry for the poor explanation but I hope you can understand what I mean.
I'm making a bridge collapse and repair system upon bombing. I have stored the coordinates and stuff in the enumerator arrays, planning to move them in the database after I successfully make it working. But my problem here right now is, the bridge has 2 objects and both has their own coordinates for fixed and damaged ones.
PHP код:
#define MAX_BRIDGES 2
enum E_BRIDGE_DATA {
b_ID,
Float:b_Fixed_X,
Float:b_Fixed_Y,
Float:b_Fixed_Z,
Float:b_Fixed_RX,
Float:b_Fixed_RY,
Float:b_Fixed_RZ,
Float:b_Damaged_X,
Float:b_Damaged_Y,
Float:b_Damaged_Z,
Float:b_Damaged_RX,
Float:b_Damaged_RY,
Float:b_Damaged_RZ,
b_Objects[2]
}
new g_Bridge[MAX_BRIDGES][E_BRIDGE_DATA] = {
{16610, -1024.41089, 2710.71362, 48.40410, 359.98541, 0.0, -173.35580, -1024.41089, 2710.71362, 43.02410, 359.98541, 5.0, -173.35580},
{16037, -1143.70422, 2696.85327, 48.73220, 359.98541, 0.0, -173.37590, -1143.70422, 2696.85327, 43.45050, 359.98541, -5.0, -173.37590}
};
This works when I loop through the bridge IDs and set the objects' position defined in the array like
PHP код:
for (new i = 0; i < MAX_BRIDGES; i++) {
SetDynamicObjectPos(g_Bridge[i][b_Objects][i],
g_Bridge[i][b_Damaged_X],
g_Bridge[i][b_Damaged_Y],
g_Bridge[i][b_Damaged_Z]);
SetDynamicObjectRot(g_Bridge[i][b_Objects][i],
g_Bridge[i][b_Damaged_RX],
g_Bridge[i][b_Damaged_RY],
g_Bridge[i][b_Damaged_RZ]);
}
Sorry for the poor explanation but I hope you can understand what I mean.