// ***** Special MapIcons by ONEhelsING
#include <a_players>
#pragma tabsize 0

#define MAX_MAPICONS 32

new MapIcon[MAX_PLAYERS][MAX_MAPICONS];

/*
native AddMapIcon(playerid, Float:x, Float:y, Float:z, iconid, color);
native DistroyMapIcon(playerid, iconid);
native DistroyMapIcons(playerid);
*/

stock AddMapIcon(playerid, Float:x, Float:y, Float:z, iconid, color)
{ 
    for(new m = 0; m < MAX_MAPICONS; m++)
	{
	if(MapIcon[playerid][m] == 0)
	   {
           SetPlayerMapIcon(playerid,m,x,y,z,iconid,color);    
	   MapIcon[playerid][m] = 1;
           return m;
	   }
	}
   return MAX_MAPICONS;
}

stock DistroyMapIcon(playerid, iconid)
{
    if(MapIcon[playerid][iconid] == 1)
	{
	RemovePlayerMapIcon(playerid,iconid);
	MapIcon[playerid][iconid] = 0;
	}    
   return 1;
}

stock DistroyMapIcons(playerid)
{     
     for(new m = 0; m < MAX_MAPICONS; m++)
	{
	   if(MapIcon[playerid][m] == 1)
		{
    	   	RemovePlayerMapIcon(playerid,m);
		MapIcon[playerid][m] = 0;
		}	   
	}    
    return 1;
}
