[Include] Arrow.inc Create And Point Arrows At Stuff
#16

Quote:
Originally Posted by Antonio144
View Post
Here's the code for target_z, ie object Y rotation...
Works perfect! Thanks Antonio.

@Pottus: As for the risk of user using random objects, i might just use an "arw:" tag for the vars returned by "CreateArrow" that way the compiler will throw a warning if an objectid is used with an arrow function. I think that would be a better solution, than using large arrays.

EG,
pawn Code:
arw:CreateArrow(...)
Still not sure yet.

UPDATE:
Example/Links have been updated. Arrows can now rotate along the Y-Axis (up/down), so they can point at flying vehicles or top of a building from the bottom etc.

Changes to functions:

Create arrow now uses "target_z" parameter.
pawn Code:
CreateArrow(Float: x, Float: y, Float: z, Float: target_x, Float: target_y, Float: target_z, Float: stream_dist = DEFAULT_ARROW_DRAW_DISTANCE);
PointArrowAtPoint now takes "z" parameter.
pawn Code:
PointArrowAtPoint(arrowid, Float: x, Float: y, Float: z);
Use other rotation functions the same (PointArrowAtPlayer etc), but they will now point directly at the target.

UPDATE 2:
Player arrows added.
pawn Code:
native CreatePlayerArrow(playerid, Float: x, Float: y, Float: z, Float: target_x, Float: target_y, Float: target_z, Float: stream_dist = DEFAULT_ARROW_DRAW_DISTANCE);
native PointPlayerArrowAtPoint(playerid, arrowid, Float: x, Float: y, Float: z);
native DestroyPlayerArrow(playerid, arrowid);
native SetPlayerArrowPos(playerid, arrowid, Float: x, Float: y, Float: z);
native GetPlayerArrowPos(playerid, arrowid, &Float: x, &Float: y, &Float: z);
native GetPlayerArrowRot(playerid, arrowid, &Float: rx, &Float: ry, &Float: rz);
native PointPlayerArrowAtPlayer(playerid, arrowid, playerid);
native PointPlayerArrowAtVehicle(playerid, arrowid, vehicleid);
native PointPlayerArrowAtObject(playerid, arrowid, objectid);
native PointPlayerArrowAtPlayerObject(playerid, arrowid, targetplayerid, targetobjectid);
native SetPlayerArrowColor(playerid, arrowid, argb_color);
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)