[Include] CustomMarkers.inc - New types of player markers
#1

CustomMarkers.inc
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.
  • Easy to use, simple functions
  • More than 60 different icons
  • Replaces the standard markers
  • Doesn't interfere with gamemode markers




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
  • Make sure you put the steamer and y_timers in the includes
  • Put CustomMarkers.inc in your includes folder
  • Write #include <CustomMarkers> on top of your script

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

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

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.
Reply
#4

Amazing, that's what I need.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)