SA-MP Forums Archive
[Include] CustomMarkers.inc - New types of player markers - 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] CustomMarkers.inc - New types of player markers (/showthread.php?tid=629550)



CustomMarkers.inc - New types of player markers - PeanutButter - 28.02.2017

CustomMarkers.inc
https://www.youtube.com/watch?v=5njDiNt6ugM


About

This include allows you to have a wide variety of marker types for players, replacing the confusing SetPlayerMarkerForPlayer() function. There are over 60 different map icons that you can use as player markers, instead of the standard little colored triangles. These Custom Markers don't interfere with the gamemode's markers, which will allow you to use markers in filterscrips without worrying about interfering with the gamemode. I couldn't find any include like this, so I made it myself. This is the first time I release an include, so let me know what could be better.




Functions

SetPlayerCustomMarkerForAll(playerid, type, color, worldid, interiorid, Float:streamdistance, areaid)

Code:
Info:

Sets a marker for a player that can be seen by everyone in the server.


Parameters:

- playerid
= The playerid that should get a marker on the radar

- type
= The type of marker to display, see https://sampwiki.blast.hk/wiki/MapIcons

- color (OPTIONAL: Use -1 as default)
= The color of the icon, as an integer or hex in RGBA color format, only works if type = 0

- worldid (OPTIONAL: Use -1 as default)
= The ID of the virtual world in which to marker should be displayed

- interiorid (OPTIONAL: Use -1 as default)
= The ID of the interior in which to marker should be displayed

- streamdistance (OPTIONAL)
= The max distance, as a float, at which the markers can be seen by other players

- areaid (OPTIONAL) - Does not work in V1.0 yet
= The area, from the streamer include, in which the player markers should be shown

SetPlayerCustomMarker(playerid, playerarray[], arraycount, type, color, worldid, interiorid, Float:streamdistance, areaid)

Code:
Info:

Sets a marker for a player that can be seen by everyone in playerarray[]


Parameters:

- playerid
= The playerid that should get a marker on the radar

- playerarray[]
= The array storing the players that should see the playerid's marker on the map

- arraycount
= Amount of players in the playerarray

- type
= The type of marker to display, see https://sampwiki.blast.hk/wiki/MapIcons

- color (OPTIONAL: Use -1 as default)
= The color of the icon, as an integer or hex in RGBA color format, only works if type = 0

- worldid (OPTIONAL: Use -1 as default)
= The ID of the virtual world in which to marker should be displayed

- interiorid (OPTIONAL: Use -1 as default)
= The ID of the interior in which to marker should be displayed

- streamdistance (OPTIONAL)
= The max distance, as a float, at which the markers can be seen by other players

- areaid (OPTIONAL) - Does not work in V1.0 yet
= The area, from the streamer include, in which the player markers should be shown

DestroyPlayerCustomMarker(playerid)

Code:
Info:

Deletes a player's marker


Parameters:

-playerid
= The ID of the player to delete the marker for

Installing

Requirements
Click here - You need the Steamer plugin
Click here - You need the y_timers include from the YSI library

Download
Click here - Download the CustomMarkers.inc from GitHub

Install
PS: There is a problem with the area parameter in SetPlayerCustomMarker(ForAll), I need help with that part.


Re: CustomMarkers.inc - New types of player markers - Private200 - 28.02.2017

Edit; just saw the video. Some great work over there, but what is up with the function?


Re: CustomMarkers.inc - New types of player markers - PeanutButter - 28.02.2017

Quote:
Originally Posted by Private200
View Post
Edit; just saw the video. Some great work over there, but what is up with the function?
I can't get the areaid in the function to work correctly. It should only show the markers to the players in the given area. The problem is that when I add the areaid to the function, even the players in the area can't see the marker.


Re: CustomMarkers.inc - New types of player markers - BlackbirdXd - 28.02.2017

Amazing, that's what I need.