[Include] Dynamic circles (TextDraw, Object, 3D Label, Pickup, Map icon)
#1

General:

These includes allow you to create various circles and use them for anything you like.

Pictures and Videos:

TextDraw circles:
[ame]http://www.youtube.com/watch?v=R33tp3hN3lE[/ame]

Object circles:


3D Label circles:


Pickup circles:


Map icon circles:




Credits and Required files:

- Incognito for streamer plugin,
- ****** for foreach/iterator include.



Functions and Callbacks:

TextDraw circles:
Код:
// c_textdraw.inc

// Definitions.
#define TD_CIRCLE_TIMER_INTERVAL (100) // Timer interval in miliseconds for auto-timer.

// Callbacks.
forward OnPlayerCircleFinish(playerid); // Called when the color movement of the textdraw circle is at the end (last slot).

// Functions.
TD_CreateCircle(playerid, text[], color, Float:x_pos, Float:y_pos, Float:radius, Float:diff);
TD_DestroyCircle(playerid, bool:loop = false);
TD_IsCircleCreated(playerid); // Returns the number of textdraws created for the player circle.
TD_ActivateCircle(playerid, color, speed); // Default auto-timer interval is 100 miliseconds (the bigger the "speed" parameter is, the slower is color movement of the textdraw circle (watch the video). If you set the "color" parameter to "-1", it will generate random colors (again - watch the video).
TD_StopCircle(playerid); // Will reset (stop) the color movement of the textdraw circle.
TD_ResumeCircle(playerid); // Will resume the color movement of the textdraw circle if the circle was paused.
TD_PauseCircle(playerid); // Will pause the color movement of the textdraw circle.
TD_SetCircleSlotColor(playerid, slot, color); // Use "TD_IsCircleCreated" function to make sure not to cross the maximum slot.
Object circles:
Код:
// c_object.inc

// Definitions.
#define MAX_OBJECT_CIRCLES (20)

// Functions.
Object_CreateCircle(model, Float:x_pos, Float:y_pos, Float:z_pos, Float:x_rot, Float:y_rot, Float:z_rot, Float:radius, Float:diff, world = -1, interior = -1, Float:d_stream = 200.0, Float:d_draw = 0.0); // Returns dynamic circle ID.
Object_DestroyCircle(c_id);
Object_SetCircleTexture(c_id, m_index, txd_model, txd_name[], texture_name[], m_color = 0);
Object_SetCircleObjectTexture(c_id, slot, m_index, txd_model, txd_name[], texture_name[], m_color = 0);
Object_SetCircleModel(c_id, model, Float:radius, Float:diff);
Object_GetCircleModel(c_id);
Float:Object_GetCircleRadius(c_id);
Float:Object_GetCircleDiff(c_id);
Object_SetCirclePos(c_id, Float:x_pos, Float:y_pos, Float:z_pos);
Object_GetCirclePos(c_id, &Float:x_pos, &Float:y_pos, &Float:z_pos);
Object_SetCircleRot(c_id, Float:x_rot, Float:y_rot, Float:z_rot);
Object_GetCircleRot(c_id, &Float:x_rot, &Float:y_rot, &Float:z_rot);
Object_SetCircleStreamDistance(c_id, Float:d_stream);
Float:Object_GetCircleStreamDistance(c_id);
Object_SetCircleDrawDistance(c_id, Float:d_draw);
Float:Object_GetCircleDrawDistance(c_id);
Object_SetCircleWorld(c_id, world);
Object_GetCircleWorld(c_id);
Object_SetCircleInterior(c_id, interior);
Object_GetCircleInterior(c_id);
Object_GetCircleCount(c_id);
3D Label circles:
Код:
// c_label.inc

// Definitions.
#define MAX_LABEL_CIRCLES (20)
#define MAX_LABEL_STRING (6)

// Functions.
Label_CreateCircle(text[], color, Float:x_pos, Float:y_pos, Float:z_pos, Float:radius, Float:diff, testlos = 0, world = -1, interior = -1, Float:d_stream = 50.0, Float:d_draw = 0.0); // Returns dynamic circle ID.
Label_DestroyCircle(c_id);
Label_SetCircleRadius(c_id, Float:radius);
Float:Label_GetCircleRadius(c_id);
Label_SetCircleDiff(c_id, Float:diff);
Float:Label_GetCircleDiff(c_id);
Label_SetCirclePos(c_id, Float:x_pos, Float:y_pos, Float:z_pos);
Label_GetCirclePos(c_id, &Float:x_pos, &Float:y_pos, &Float:z_pos);
Label_SetCircleStreamDistance(c_id, Float:d_stream);
Float:Label_GetCircleStreamDistance(c_id);
Label_SetCircleDrawDistance(c_id, Float:d_draw);
Float:Label_GetCircleDrawDistance(c_id);
Label_SetCircleWorld(c_id, world);
Label_GetCircleWorld(c_id);
Label_SetCircleInterior(c_id, interior);
Label_GetCircleInterior(c_id);
Label_SetCircleTestLOS(c_id, testlos);
Label_GetCircleTestLOS(c_id);
Label_GetCircleCount(c_id);
Pickup circles:
Код:
// c_pickup.inc

// Definitions.
#define MAX_PICKUP_CIRCLES (20)

// Functions.
Pickup_CreateCircle(model, type, Float:x_pos, Float:y_pos, Float:z_pos, Float:radius, Float:diff, world = -1, interior = -1, Float:d_stream = 200.0); // Returns dynamic circle ID.
Pickup_DestroyCircle(c_id);
Pickup_SetCircleModel(c_id, model, Float:radius, Float:diff);
Pickup_GetCircleModel(c_id);
Float:Pickup_GetCircleRadius(c_id);
Float:Pickup_GetCircleDiff(c_id);
Pickup_SetCircleType(c_id, type);
Pickup_GetCircleType(c_id);
Pickup_SetCirclePos(c_id, Float:x_pos, Float:y_pos, Float:z_pos);
Pickup_GetCirclePos(c_id, &Float:x_pos, &Float:y_pos, &Float:z_pos);
Pickup_SetCircleStreamDistance(c_id, Float:d_stream);
Float:Pickup_GetCircleStreamDistance(c_id);
Pickup_SetCircleWorld(c_id, world);
Pickup_GetCircleWorld(c_id);
Pickup_SetCircleInterior(c_id, interior);
Pickup_GetCircleInterior(c_id);
Pickup_GetCircleCount(c_id);
Map icon circles:
Код:
// c_mapicon.inc

// Definitions.
#define MAX_MAPICON_CIRCLES (20)

// Functions.
MapIcon_CreateCircle(Float:x_pos, Float:y_pos, Float:z_pos, type, color, Float:radius, Float:diff, world = -1, interior = -1, Float:d_stream = 150.0, style = MAPICON_LOCAL); // Returns dynamic circle ID.
MapIcon_DestroyCircle(c_id);
MapIcon_SetCircleType(c_id, type, Float:radius, Float:diff);
MapIcon_GetCircleType(c_id);
Float:MapIcon_GetCircleRadius(c_id);
Float:MapIcon_GetCircleDiff(c_id);
MapIcon_SetCirclePos(c_id, Float:x_pos, Float:y_pos, Float:z_pos);
MapIcon_GetCirclePos(c_id, &Float:x_pos, &Float:y_pos, &Float:z_pos);
MapIcon_SetCircleStreamDistance(c_id, Float:d_stream);
Float:MapIcon_GetCircleStreamDistance(c_id);
MapIcon_SetCircleWorld(c_id, world);
MapIcon_GetCircleWorld(c_id);
MapIcon_SetCircleInterior(c_id, interior);
MapIcon_GetCircleInterior(c_id);
MapIcon_SetCircleStyle(c_id, style);
MapIcon_GetCircleStyle(c_id);
MapIcon_GetCircleCount(c_id);

"radius" and "diff" parameters:

If you don't know what radius is, then check the Wikipedia page. The "diff" parameter is a "step". 360 degrees represents the full circle, that means you'll have 360/diff items for your circle. The "diff" of 2.0 will give 180 items (example: objects).
Minimum "diff" for the textdraw circles is 1.40625, because textdraws are created on player-level, which means there can be maximum 256 player-textdraws created (360/256 = 1.40625). The functions will correct the "diff" parameter if you try to enter smaller "diff" than the minimum (1.40625). The minimum "diff" parameter for other circles is 1.0, there is also correcting feature in functions making sure the "diff" parameter won't be smaller than 1.0 for non-textdraw circles.



Download:

Reply


Messages In This Thread
Dynamic circles (TextDraw, Object, 3D Label, Pickup, Map icon) - by Correlli - 27.02.2016, 15:37
Re: Dynamic circles (TextDraw, Object, 3D Label, Pickup, Map icon) - by Correlli - 27.02.2016, 18:27
Re: Dynamic circles (TextDraw, Object, 3D Label, Pickup, Map icon) - by Stuntff - 27.02.2016, 18:29
Re: Dynamic circles (TextDraw, Object, 3D Label, Pickup, Map icon) - by Correlli - 27.02.2016, 18:31
Re: Dynamic circles (TextDraw, Object, 3D Label, Pickup, Map icon) - by Stuntff - 27.02.2016, 18:45
Re: Dynamic circles (TextDraw, Object, 3D Label, Pickup, Map icon) - by PT - 27.02.2016, 19:18
Re: Dynamic circles (TextDraw, Object, 3D Label, Pickup, Map icon) - by HydraHumza - 27.02.2016, 19:42
Re: Dynamic circles (TextDraw, Object, 3D Label, Pickup, Map icon) - by illuminati2 - 27.02.2016, 19:49
Re: Dynamic circles (TextDraw, Object, 3D Label, Pickup, Map icon) - by ZaBraNjeNi - 27.02.2016, 19:56
Re: Dynamic circles (TextDraw, Object, 3D Label, Pickup, Map icon) - by Chilli9434 - 27.02.2016, 20:15
Respuesta: Dynamic circles (TextDraw, Object, 3D Label, Pickup, Map icon) - by Whyd - 27.02.2016, 20:27
Re: Dynamic circles (TextDraw, Object, 3D Label, Pickup, Map icon) - by Varkoll_ - 27.02.2016, 20:32
Re: Dynamic circles (TextDraw, Object, 3D Label, Pickup, Map icon) - by ZaBraNjeNi - 27.02.2016, 20:53
Re: Dynamic circles (TextDraw, Object, 3D Label, Pickup, Map icon) - by Levu - 27.02.2016, 21:26
Re: Dynamic circles (TextDraw, Object, 3D Label, Pickup, Map icon) - by Correlli - 27.02.2016, 23:52
Re: Dynamic circles (TextDraw, Object, 3D Label, Pickup, Map icon) - by rootcause - 28.02.2016, 01:47
Re: Dynamic circles (TextDraw, Object, 3D Label, Pickup, Map icon) - by X3nZ - 28.02.2016, 02:02
Respuesta: Dynamic circles (TextDraw, Object, 3D Label, Pickup, Map icon) - by Z0MBERTH - 28.02.2016, 02:53
Re: Dynamic circles (TextDraw, Object, 3D Label, Pickup, Map icon) - by SickAttack - 28.02.2016, 02:56
Re: Dynamic circles (TextDraw, Object, 3D Label, Pickup, Map icon) - by Amunra - 28.02.2016, 05:00
Re: Dynamic circles (TextDraw, Object, 3D Label, Pickup, Map icon) - by Correlli - 28.02.2016, 10:21
Re: Dynamic circles (TextDraw, Object, 3D Label, Pickup, Map icon) - by Varkoll_ - 28.02.2016, 10:21
Re: Dynamic circles (TextDraw, Object, 3D Label, Pickup, Map icon) - by JustMe.77 - 28.02.2016, 10:25
Re: Dynamic circles (TextDraw, Object, 3D Label, Pickup, Map icon) - by DrMrMuma - 28.02.2016, 10:30
Re: Dynamic circles (TextDraw, Object, 3D Label, Pickup, Map icon) - by Correlli - 28.02.2016, 10:42
Re: Dynamic circles (TextDraw, Object, 3D Label, Pickup, Map icon) - by Unrea1 - 28.02.2016, 10:52
Re: Dynamic circles (TextDraw, Object, 3D Label, Pickup, Map icon) - by SpikY_ - 28.02.2016, 11:16
Re: Dynamic circles (TextDraw, Object, 3D Label, Pickup, Map icon) - by Unrea1 - 28.02.2016, 11:19
Re: Dynamic circles (TextDraw, Object, 3D Label, Pickup, Map icon) - by Correlli - 28.02.2016, 11:22
Re: Dynamic circles (TextDraw, Object, 3D Label, Pickup, Map icon) - by Greggu - 01.03.2016, 09:34

Forum Jump:


Users browsing this thread: 7 Guest(s)