Getting coordinates in an area?
#1

Say I have a square/rectangle area, and I want to get evenly-spaced coordinates in that area like this:

Код:
--------------------------
|.  .  .  .  .  .  .  .  |
|.  .  .  .  .  .  .  .  |
|.  .  .  .  .  .  .  .  |
|.  .  .  .  .  .  .  .  |
|.  .  .  .  .  .  .  .  |
|.  .  .  .  .  .  .  .  |
--------------------------
The dots are the coordinates I need to get. Is there a way of doing this with code, or do I have to just walk to every single spot and use /rs or /s?
Reply
#2

You can use offsetting to your advantage. For instance,

Say we have an object. We can then take a offset such as -0.5, and add it to the y coordinate of an object.

Example:
pawn Код:
new Float: x, Float: y, Float: z;
GetObjectPos(main_object, x, y, z);

new Float: offset = 0.5;
ObjectCoordinates[0] = x-offset;
If the x of the object is 1000, then it'd be 999.95. I actually made an object offset include a few months ago:
https://sampforum.blast.hk/showthread.php?tid=541980

That may be worth checking out.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)