22.10.2012, 19:08
Код:
new Float:treePos[8][3]={ {661.91,1289.53,10.71}, {640.08,1289.37,10.71}, {685.15,1257.14,10.71}, {695.25,1231.59,10.14}, {661.87,1190.05,10.71}, {639.62,1190.14,9.93}, {571.27,1256.64,10.71}, {554.25,1242.15,10.71} };
Код:
new Float:treePos[8][3]={ {0661.9100,1289.5300,0010.7100}, {0640.0800,1289.3700,0010.7100}, {0685.1500,1257.1400,0010.7100}, {0695.2500,1231.5900,0010.1400}, {0661.8700,1190.0500,0010.7100}, {0639.6200,1190.1400,0009.9300}, {0571.2700,1256.6400,0010.7100}, {0554.2500,1242.1500,0010.7100} };
the variable treeExists[] is redundant imo, if you create an object, it will never return 0 (as object id), so any created obejct will write the returned id into treeObj[], therefore you can simply check for the object existance like
Код:
if(IsValidObject(treeObj[t]))

hm.. i think the code can be optimized furthermore, but youll face that later (like hashing back object ids in another array, like a two-sided pointer from 1 array to another and vice versa)