MapAndreas_FindAverageZ -
Ballu Miaa - 18.07.2012
Hello Everyone,
Can any one please explain me the usage of these natives of ManAndreas, with the used code?
pawn Код:
native MapAndreas_FindZ_For2DCoord(Float:X, Float:Y, &Float:Z); // return highest Z point (ground level) for the provided X,Y co-ordinate.
// new
native MapAndreas_FindAverageZ(Float: x, Float:y, &Float:z); // returns a linear approximation of the ground level at the x,y coordinate
I want to use this function to find the ground level according to X,Y,Z. And later on check that Object AGNIV has reached the lowest Ground level(Z). If it has reached , then it will explode.
Can anyone give me a basic design or structure? How to check that object moving object has reached the Lowest Ground level? Please help me.
Thanks
Ballu Miaa
Re: MapAndreas_FindAverageZ -
ViniBorn - 18.07.2012
You can use this with GetObjectPos
Ex:
pawn Код:
new Z, vX, vY, vZ;
MapAndreas_FindAverageZ(1500.0, 200.0, Z);
GetObjectPos(objectid, vX, vY, vZ);
if(Z <= vZ)
CreateExplosion
Re: MapAndreas_FindAverageZ -
Ballu Miaa - 18.07.2012
Quote:
Originally Posted by Viniborn
You can use this with GetObjectPos
|
Thanks for the quick reply Vini! In which callback shall i add the check that Object has reached Lowest Z coordinate?
Re: MapAndreas_FindAverageZ -
ViniBorn - 18.07.2012
Try this idea :
1є step - Get the initial Pos (
X,
Y,
Z)
2є step - Use
X and
Y in MapAndreas_FindAverageZ to find
Z_2
3є step - Move the object from
X,
Y,
Z to
X,
Y,
Z_2
4є step - Use CreateExplosion in OnObjectMoved
Re: MapAndreas_FindAverageZ -
Ballu Miaa - 18.07.2012
Quote:
Originally Posted by Viniborn
3є step - Move the object from X, Y, Z to X, Y, Z_2
4є step - Use CreateExplosion in OnObjectMoved
|
Can you give me a reference code for the third and fourth step? Please
Re: MapAndreas_FindAverageZ -
ViniBorn - 18.07.2012
3є step -
pawn Код:
MoveObject(MyObject, X, Y, Z_2, 5.00);
4є step -
pawn Код:
public OnObjectMoved(objectid)
{
if(objectid == MyObject)
CreateExplosion(X, Y, Z_2, 12, 10.0);
return 1;
}
Re: MapAndreas_FindAverageZ -
Ballu Miaa - 18.07.2012
Quote:
Originally Posted by Viniborn
3є step -
pawn Код:
MoveObject(MyObject, X, Y, Z_2, 5.00);
4є step -
pawn Код:
public OnObjectMoved(objectid) { if(objectid == MyObject) CreateExplosion(X, Y, Z_2, 12, 10.0);
return 1; }
|
Awesome!! Thanks a lot Brother. Cheers to Viniborn. Rep+6 Added!
Btw what is the difference between MapAndreas_FindZ_For2DCoord and MapAndreas_FindAverageZ
Re: MapAndreas_FindAverageZ -
ViniBorn - 18.07.2012
To be honest, I don't know. I never used these functions.
Re: MapAndreas_FindAverageZ -
Ballu Miaa - 18.07.2012
Quote:
Originally Posted by Viniborn
To be honest, I don't know. I never used these functions.
|
Lol bro! :P Same here man. I never used MapAndreas. Anways Thanks again!