SA-MP Forums Archive
[Include] Graphic Functions! v.0.1A - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] Graphic Functions! v.0.1A (/showthread.php?tid=253778)

Pages: 1 2


Graphic Functions! v.0.1A - pmkrz - 07.05.2011

graphfunc v.0.1A

__________________________________________________


Introduction:
Very simple include, where you can easily add some nice graphs (as textdraws) to your server.
While I'm going to write this topic, I'll also be using some parts of a graph example code.

Functions:
pawn Код:
-
    native Graph:GRAPHIC::Create(Float:x, Float:y, Float:x_min, Float:y_min, Float:x_max, Float:y_max);
    native GRAPHIC::XYAxisColor(Graph:_id, _x_color, _y_color);
    native GRAPHIC::UseBackground(Graph:_id, use);
    native GRAPHIC::BackgroundColor(Graph:_id, color);
    native GRAPHIC::GRAPHIC::AddPoint(Graph:_id, Float:x, Float:y, color);
    native GRAPHIC::ShowForPlayer(playerid, Graph:_id);
    native GRAPHIC::HideForPlayer(playerid, Graph:_id);
    native GRAPHIC::ShowForAll(Graph:_id);
    native GRAPHIC::HideForAll(Graph:_id);
    native GRAPHIC::Update(Graph:_id, playerid = INVALID_PLAYER_ID);
    native GRAPHIC::Destroy(Graph:_id);
    native GRAPHIC::OtherXYAxis(oper, playerid, Graph:_id, xAxis, yAxis);
Callbacks:
forward GRAPHIC::Init()

This callback should be use to create each graph, for example:
pawn Код:
new
        Graph:MY_GRAPH;

    public
        GRAPHIC::Init()
    {
        MY_GRAPH = GRAPHIC::Create(200.0, 250.0, -50, -50, 50, 50);
        GRAPHIC::XYAxisColor(MY_GRAPH, 0xFFFFFF55, 0xFFFFFF55);

        GRAPHIC::UseBackground(MY_GRAPH, 1);
        GRAPHIC::BackgroundColor(MY_GRAPH, 0x00000033);

        GRAPHIC::AddPoint(MY_GRAPH, 50,  50, 0x25478588);

        // other graphic creations..               

        return 1;
    }
Restrictions:
There are some sense restrictions when creating a graphic. (at least with this script)
You'll NOT be able to create graphs in this terms: Example with screenshot:
Screenshot here!
Pastebin code here!

Download:
Want to download it? Click here! THANKS TO KAR!!

Request:
When replying in order to report a bug, please keep the following form structure: (including the bbcode: code)
Код:
» bug report:
  • Information here..
_script_version, 0x01A.

- © PLAYMAKER 2011



Re: Graphic Functions! v.0.1A - black_dota - 07.05.2011

So this is boxes, lines, triangles, dots and etc.

Good job, 10/10


Re: Graphic Functions! v.0.1A - Skylar Paul - 07.05.2011

This is absolutely amazing. Nicely done, pmkrz!


Re: Graphic Functions! v.0.1A - MrDeath537 - 07.05.2011

Amazing, good job and thanks for sharing.


Re: Graphic Functions! v.0.1A - pmkrz - 07.05.2011

Thanks a lot, people! ( :

btw.. you can also hide/show the x and y axis with GRAPHIC::OtherXYAxis. Read the documentation inside the source.


Re: Graphic Functions! v.0.1A - RyDeR` - 07.05.2011

I had this idea a while ago, but didn't start yet; but not need for that. Nice work.


Re: Graphic Functions! v.0.1A - Joe Staff - 07.05.2011

So it only creates Graphs? I can't think of a very valid way to use this, but it's nice looking.


Re: Graphic Functions! v.0.1A - Lorenc_ - 08.05.2011

Thats, awesome im thinking of using this for something great coming up, thanks man, much appreciated for the release.


Re: Graphic Functions! v.0.1A - pmkrz - 08.05.2011

Thanks again! ; D


Re: Graphic Functions! v.0.1A - BASITJALIL - 08.05.2011

Nice work


Re: Graphic Functions! v.0.1A - Swiftz - 08.05.2011

Can you post some screens of Graphics, anyway i love this


Re: Graphic Functions! v.0.1A - pmkrz - 08.05.2011

^Did you read the topic ? : s


Re: Graphic Functions! v.0.1A - Trooper[Y] - 08.05.2011

Screenshots ?

Cant imagine it...


Re: Graphic Functions! v.0.1A - Naruto_Emilio - 08.05.2011

You are genius


Re: Graphic Functions! v.0.1A - pmkrz - 08.05.2011

@Swiftz, Trooper[Y]:

Did you read the topic ? <2>

Quote:
Originally Posted by pmkrz
Посмотреть сообщение
Example with screenshot:
Screenshot here!
Pastebin code here!
Thanks to the others! ( :


Re: Graphic Functions! v.0.1A - Donya - 08.05.2011

wow, nice work indeed.


Re: Graphic Functions! v.0.1A - pmkrz - 08.05.2011

Thanks, Donya!


Re: Graphic Functions! v.0.1A - Donya - 08.05.2011

can you post an example of a Triangle?


Re: Graphic Functions! v.0.1A - pmkrz - 08.05.2011

You just need to add points where they need to be (all close to give an idea of lines). Then if you want, hide the background (if enable) and the x/y axis (just to show the triangle)..
But still if you need my help, maybe tomorrow I'll do that, today I'm too busy. _sorry. : (


Re: Graphic Functions! v.0.1A - Bumbis - 08.05.2011

It would be hard to make a smooth circle?