[Include] DynamicMaps (In Game) v0.1
#1


This include allows you create GTA San Andreas maps (made of 4 object-parts), attach to them differrent points, marks, etc. and edit them (move, change object index, change size, set position on the map pointing to world coordinates x,y).
To make it more clear, i made a video:

[ame]http://www.youtube.com/watch?v=ht4K7YmKAyI[/ame]

I. Functions
DynamicMap:CreateDynamicMap(Float:_center_x, Float:_center_y, Float:_center_z, Float:_rotation_z, _vw = -1, _i = -1)
Creates a DynamicMap formed from 4 GTA objects, having the center - the first 3 paramaters.
Parameters:
Float:_center_x, Float:_center_y, Float:_center_z - center coordinates of the map

Float:_rotation_z - R-Z rotation of the whole map
_vw - virutal world of the map (by default -1 - all virtual worlds)
_i - map interior (by default -1 - all interiors)

Returns:
DynamicMap:mapid, if the map was successfully created.
INVALID_MAP_ID, failed to created (mapid exceeds MAX_MAPS)
Note: You have to use all virtual worlds or all interiors in order to have points in different virtual worlds or interiors attached to the same map.
DestroyDynamicMap(DynamicMap:mapid)
Destroys a DynamicMap and all the points attached to it.
Parameters:
DynamicMap:mapid - the id of the map to destroy.

Returns:
0 - failed, map is not created.
1- successfully destroyed.
Point:CreatePointForDynamicMap(DynamicMap:mapid, point_object, Float:_point_size=0.0, Float:p_realC_x = 0.0, Float:p_realC_y = 0.0, _vw = -1, _i = -1)
Creates and attaches a point to the dynamicmap having the specified object index, point size (distance from map), interior and virtual world, accroding to the world coordinates x, y.
Parameters:
DynamicMap:mapid - the id of the map the point will be attached to.
point_object - object index of the point (use defined object indexes).
_point_size - the distance between map and center of the point (use defined sizes).
Float:p_realC_x = 0.0, Float:p_realC_y = 0.0 - real coordinates the point will represent on map (by defaul center of the map).
_vw = -1, _i = -1 - virtual world and interior (by default - map interior and virtual world).
Returns:
INVALID_POINT_ID - failed to create point (pointid exceeds MAX_POINTS)
Point:pointid - successfully created.
DestroyPoint(Point:_pointid)
Destroys a point.
Parameters:
Point:_pointid - the id of the point to destroy.

Returns:
0 - failed, point is not created.
1- successfully destroyed.
SetPointSize(Point:_pointid, Float:_pt_size)
Changes the distance between point and map(size) to _pt_size. Works on moving points.
Parameters:
Point:_pointid - the id of the point.
Float:_pt_size - new size of the point (use defined sizes).

Returns:
0 - failed, point is not created.
1- size changed.
2- size changed while point was moving.
SetPointObject(Point:_pointid, pointobject)
Changes the object index of the point. If the point is moving, it will stop on it's current position.
Parameters:
Point:_pointid - the id of the point.
pointobject - the new object index.

Returns:
0 - failed, point is not created.
1 - object index changed.
AssignPointToPos(Point:_pointid, Float:real_x, Float:real_y)
Assigns the point position on map to real_x and real_y parameters.
Parameters:
Point:_pointid - the id of the point.
Float:real_x, Float:real_y - real x and real y world coordinates.

Returns:
0 - failed, point is not created.
1 - successfully.
MovePointForPos(Point:_pointid, Float:real_mx, Float:real_my, Float:movespeed = 0.1)
Smoothly mooves the point (with the specified movespeed) from it's current position, to the map position pointing to the real mx and my world coordinates.
Parameters:
Point:_pointid - the id of the point.
Float:real_mx, Float:real_my - real x and real y world coordinates.
Float:movespeed = 0.1 - movespeed (by default 0.1).
Returns:
0 - failed, point is not created.
1 - successfully.
GetDynamicMapCoords(Float:x,Float:y, DynamicMap:mapid, &Float:on_map_x,&Float:on_map_y,&Float:on_map_z , Float:_point_size)
Gets a point coordinates on the specified map according to real x, real y and point size, and stores them in Float:on_map_x, Float:on_map_y, Float:on_map_z.
Parameters:
Float:x,Float:y - real x and y world coordinates.
DynamicMap:mapid - the id of the map.
&Float:on_map_x,&Float:on_map_y,&Float:on_map_z - the variables to store point coordinates in.
_point_size - the distance between coordinates and map.
Returns:
The function doesn't return a value.
v 0.2:

GetDynamicMapPointRealCoords(DynamicMap:_mapid, Float:on_map_x, Float:on_map_y, Float:on_map_z, &Float:real_x, &Float:real_y)
This function gets the real coordinates which the specified coordinates point to on a certain dynamic map and passes them to variables on_map_x, on_map_y.

Parameters:
DynamicMap:_mapid - id of the map
Float:on_map_x, Float:on_map_y, Float:on_map_z - varibales which store the map coordinates.
&Float:on_map_x,&Float:on_map_y,&Float:on_map_z - variables to which the function will return the real coordinates.
Returns:
The function doesn't return a value.
II. Defined constants
Point object indexes:
PHP код:
POINT_WHITE
POINT_GREEN
POINT_RED
POINT_ORANGE
POINT_YELLOW 
Point sizes:
PHP код:
TINY_POINT,
SMALL_POINT,
MEDIUM_POINT,
BIG_POINT,
HUGE_POINT 
III. Notes
  • Include requires Streamer Plugin.
  • You have to include DynamicMaps after a_samp and streamer.
  • You can manualy define MAX_MAPS and MAX_POINTS before including DynamicMaps to save memory.
IV.Download
Pastebin - CLICK

Reply


Messages In This Thread
DynamicMaps (In Game) v0.2 - by SmileySmile - 04.07.2014, 09:52
Re: DynamicMaps (In Game) v0.1 - by Pottus - 04.07.2014, 10:40
Re: DynamicMaps (In Game) v0.1 - by SmileySmile - 04.07.2014, 11:27
Re: DynamicMaps (In Game) v0.1 - by Ins1d3 - 04.07.2014, 18:15
Re: DynamicMaps (In Game) v0.1 - by SmileySmile - 22.07.2014, 10:11
AW: DynamicMaps (In Game) v0.1 - by NaS - 26.07.2014, 14:48
Re: DynamicMaps (In Game) v0.1 - by iFarbod - 26.07.2014, 15:10
Re: DynamicMaps (In Game) v0.1 - by SmileySmile - 11.08.2014, 22:04
Re: DynamicMaps (In Game) v0.1 - by Hwang - 11.08.2014, 22:23
Re: DynamicMaps (In Game) v0.1 - by JacobEdwards - 11.08.2014, 22:48
Re: DynamicMaps (In Game) v0.1 - by SmileySmile - 12.08.2014, 04:41
Re: DynamicMaps (In Game) v0.1 - by JacobEdwards - 12.08.2014, 04:47
Re: DynamicMaps (In Game) v0.1 - by SmileySmile - 19.08.2015, 11:42

Forum Jump:


Users browsing this thread: 1 Guest(s)