SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 27/02/2016, 03:37 PM   #1
Correlli
Godfather
 
Correlli's Avatar
 
Join Date: May 2009
Location: Slovenia
Posts: 7,168
Reputation: 361
Default Dynamic circles (TextDraw, Object, 3D Label, Pickup, Map icon)

General:

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

Pictures and Videos:

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

Object circles:


3D Label circles:


Pickup circles:


Map icon circles:




Credits and Required files:

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



Functions and Callbacks:

TextDraw circles:
Code:
// 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:
Code:
// 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:
Code:
// 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:
Code:
// 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:
Code:
// 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:


Last edited by Correlli; 05/05/2017 at 06:37 PM.
Correlli is offline   Reply With Quote
Old 27/02/2016, 06:27 PM   #2
Correlli
Godfather
 
Correlli's Avatar
 
Join Date: May 2009
Location: Slovenia
Posts: 7,168
Reputation: 361
Default Re: Dynamic circles (TextDraw, Object, 3D Label, Pickup, Map icon)

Speedometer (textdraw circles).
[ame]http://www.*******.com/watch?v=p-DuCr2bAqg[/ame]
Correlli is offline   Reply With Quote
Old 27/02/2016, 06:29 PM   #3
Stuntff
Big Clucker
 
Join Date: Feb 2016
Posts: 83
Reputation: 21
Default Re: Dynamic circles (TextDraw, Object, 3D Label, Pickup, Map icon)

del please
Stuntff is offline   Reply With Quote
Old 27/02/2016, 06:31 PM   #4
Correlli
Godfather
 
Correlli's Avatar
 
Join Date: May 2009
Location: Slovenia
Posts: 7,168
Reputation: 361
Default Re: Dynamic circles (TextDraw, Object, 3D Label, Pickup, Map icon)

Quote:
Originally Posted by Stuntff View Post
del please
Excuse me?
Correlli is offline   Reply With Quote
Old 27/02/2016, 06:45 PM   #5
Stuntff
Big Clucker
 
Join Date: Feb 2016
Posts: 83
Reputation: 21
Default Re: Dynamic circles (TextDraw, Object, 3D Label, Pickup, Map icon)

Quote:
Originally Posted by Correlli View Post
Excuse me?
Can you give me cmd that used in the video? I have for some reason does not create a circle ..
Stuntff is offline   Reply With Quote
Old 27/02/2016, 07:18 PM   #6
PT
Godfather
 
PT's Avatar
 
Join Date: Nov 2012
Location: Portugal
Posts: 7,194
Reputation: 775
Default Re: Dynamic circles (TextDraw, Object, 3D Label, Pickup, Map icon)

You should post the exemple codes too you used on video.

I like this include nice job my friend!
__________________
"Quem caiu e se levantou honrado era e honrado ficou..."


CVU vai voltar e.e


http://steamcommunity.com/id/pt_player/
PT is offline   Reply With Quote
Old 27/02/2016, 07:42 PM   #7
HydraHumza
Gangsta
 
HydraHumza's Avatar
 
Join Date: Oct 2014
Posts: 651
Reputation: 130
Default Re: Dynamic circles (TextDraw, Object, 3D Label, Pickup, Map icon)

Not Bad + REP
__________________
Quote:
Originally Posted by Kalcor View Post
The fact is, I am right. And if you think I'm wrong, you are wrong.
HydraHumza is offline   Reply With Quote
Old 27/02/2016, 07:49 PM   #8
illuminati2
Big Clucker
 
Join Date: Feb 2016
Posts: 78
Reputation: 21
Default Re: Dynamic circles (TextDraw, Object, 3D Label, Pickup, Map icon)

That's great. Good Work!
__________________
illuminati2 is offline   Reply With Quote
Old 27/02/2016, 07:56 PM   #9
ZaBraNjeNi
Huge Clucker
 
ZaBraNjeNi's Avatar
 
Join Date: Apr 2014
Location: Serbia, Valjevo
Posts: 276
Reputation: 35
Default Re: Dynamic circles (TextDraw, Object, 3D Label, Pickup, Map icon)

Thank you for this!
Very, very useful.
__________________
Game Hosting

INSTANT ACTIVATION | San Andreas Multiplayer, Counter Strike 1.6, Minecraft

I need to eat, donate a one REP to me!

ZaBraNjeNi is offline   Reply With Quote
Old 27/02/2016, 08:15 PM   #10
Chilli9434
Huge Clucker
 
Chilli9434's Avatar
 
Join Date: May 2014
Location: United Kingdom
Posts: 367
Reputation: 103
Default Re: Dynamic circles (TextDraw, Object, 3D Label, Pickup, Map icon)

Wow nice work!
__________________

Web Developer
Forums | Discord
Chilli9434 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to add pickup icon? BlazeGaming Scripting Help 3 28/12/2014 11:07 AM
Dynamic Pickup/Label Help Joshy_Elite Scripting Help 2 28/03/2013 11:05 PM
dynamic map icon Tanush123 Scripting Help 5 03/01/2012 08:50 PM
Pickup Icon help JD Help Archive 1 09/12/2010 09:51 PM


All times are GMT. The time now is 09:01 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.