07.05.2011, 22:59
(
Последний раз редактировалось pmkrz; 25.08.2015 в 14:53.
Причина: Download fixing!
)
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);
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;
}
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:
- x-Min, y-Min, x-Max and y-Max all equal to 0
- x-Min and x-Max both equal to 0
- y-Min and y-Max both equal to 0
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..
- © PLAYMAKER 2011