Minimap Mapicons
#1

need help.. i have a little problem with my icons and i dont know how to edit it.. on my minimap when im far away the icon is not showing up when im very near it only shows up:

1st image


2nd image


Код HTML:
CMD:mused(playerid, params[])
{
	new string[128];
	if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
	if(PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid, COLOR_GREY, "You are not an authorized to use this command.");
//    if(!aDuty[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You are not on admin duty.");
	SendClientMessage(playerid, COLOR_ORANGE, "[Used MapIcons]:");
	for(new idx=0; idx<MAX_MAPICONS; idx++)
	{
	    if(MapIconInfo[idx][mpType])
	    {
			format(string, sizeof(string), "ID: %d | Pickup: %d", idx, MapIconInfo[idx][mpType]);
			SendClientMessage(playerid, COLOR_ORANGE, string);
	    }
	}
	return 1;
}

CMD:medit(playerid, params[])
{
	new string[128], idx;
	if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
	if(PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
//    if(!aDuty[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You are not on admin duty.");
 	if(sscanf(params, "s[128]", params))
	{
		SendClientMessage(playerid, COLOR_WHITE, "USAGE: /medit [option] [mapiconid]");
		SendClientMessage(playerid, COLOR_GREY, "OPTIONS: Position | Icon");
		return 1;
	}
	if(!strcmp(params, "position", true, 8))
	{
	    if(sscanf(params, "s[128]i", params, idx)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /medit position [mapiconid]");
        if(MapIconInfo[idx][mpType] == 0) return SendClientMessage(playerid, COLOR_GREY, "Invalid mapicon id.");
        GetPlayerPos(playerid, MapIconInfo[idx][mpX], MapIconInfo[idx][mpY], MapIconInfo[idx][mpZ]);
        DestroyDynamicMapIcon(MapIconInfo[idx][mpID]);
		MapIconInfo[idx][mpID] = CreateDynamicMapIcon(MapIconInfo[idx][mpX], MapIconInfo[idx][mpY], MapIconInfo[idx][mpZ], MapIconInfo[idx][mpType], 0 ,0);
	    format(string, sizeof(string), " You have set mapicon ID %d's position to your coordinates.", idx);
	    SendClientMessage(playerid, COLOR_WHITE, string);
	}
	if(!strcmp(params, "icon", true, 4))
	{
	    new pickup;
	    if(sscanf(params, "s[128]ii", params, idx, pickup)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /medit icon [mapiconid] [iconid]");
        if(pickup == 0 || pickup == 1) return SendClientMessage(playerid, COLOR_GREY, "Invalid mapicon type.");
        if(MapIconInfo[idx][mpType] == 0) return SendClientMessage(playerid, COLOR_GREY, "Invalid mapicon id.");
        MapIconInfo[idx][mpType] = pickup;
        DestroyDynamicMapIcon(MapIconInfo[idx][mpID]);
		MapIconInfo[idx][mpID] = CreateDynamicMapIcon(MapIconInfo[idx][mpX], MapIconInfo[idx][mpY], MapIconInfo[idx][mpZ], MapIconInfo[idx][mpType], 0 ,0);
	    format(string, sizeof(string), " You have set mapicon ID %d's icon to %d.", idx, pickup);
	    SendClientMessage(playerid, COLOR_WHITE, string);
	}
	return 1;
}

CMD:gotomapicon(playerid, params[])
{
    new idx, string[128];
	if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
	if(PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
//    if(!aDuty[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You are not on admin duty.");
	if(sscanf(params, "i", idx)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /gotomapicon [mapiconid]");
	if(!MapIconInfo[idx][mpType]) return SendClientMessage(playerid, COLOR_GREY, "Invalid mapicon id.");
	SetPlayerInterior(playerid, 0);
	SetPlayerVirtualWorld(playerid, 0);
	SetPlayerPos(playerid, MapIconInfo[idx][mpX], MapIconInfo[idx][mpY], MapIconInfo[idx][mpZ]);
	format(string, sizeof(string), " You have teleported to mapicon ID %d.", idx);
	SendClientMessage(playerid, COLOR_WHITE, string);
	return 1;
}

CMD:deletemapicon(playerid, params[])
{
	new idx, string[128];
	if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
	if(PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
//    if(!aDuty[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You are not on admin duty.");
	if(sscanf(params, "i", idx)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /deletemapicon [mapiconid]");
	if(!MapIconInfo[idx][mpType]) return SendClientMessage(playerid, COLOR_GREY, "Invalid mapicon id.");
    MapIconInfo[idx][mpType] = 0;
    MapIconInfo[idx][mpX] = 0;
	MapIconInfo[idx][mpY] = 0;
	MapIconInfo[idx][mpZ] = 0;
	DestroyDynamicMapIcon(MapIconInfo[idx][mpID]);
    format(string, sizeof(string), "{FF0000}[Admin Warn]{FF6347} %s has deleted mapicon ID %d.", RPN(playerid), idx);
    SendAdminMessage(COLOR_DARKRED, 1, string);
	Log("logs/mapicons.log", string);
	return 1;
}

CMD:createmapicon(playerid, params[])
{
	new string[128], type;
   	if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
	if(PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
//    if(!aDuty[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You are not on admin duty.");
	if(sscanf(params, "i", type)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /createmapicon [icon]");
	if(type == 0 || type == 1) return SendClientMessage(playerid, COLOR_GREY, "Invalid mapicon type.");
	for(new idx=0; idx<MAX_MAPICONS; idx++)
	{
	    if(!MapIconInfo[idx][mpType])
	    {
		    MapIconInfo[idx][mpType] = type;
		    GetPlayerPos(playerid, MapIconInfo[idx][mpX], MapIconInfo[idx][mpY], MapIconInfo[idx][mpZ]);
		    MapIconInfo[idx][mpID] = CreateDynamicMapIcon(MapIconInfo[idx][mpX], MapIconInfo[idx][mpY], MapIconInfo[idx][mpZ], MapIconInfo[idx][mpType], 0 ,0);
			format(string, sizeof(string), "{FF0000}[Admin Warn]{FF6347} %s has created mapicon ID %d.", RPN(playerid), idx);
		    SendAdminMessage(COLOR_DARKRED, 1, string);
			Log("logs/mapicons.log", string);
			idx = MAX_DOORS;
		}
	}
	return 1;
}
Reply


Messages In This Thread
Minimap Mapicons - by LMagnifico - 18.12.2013, 08:47
Re: Minimap Mapicons - by WhiteAngels - 18.12.2013, 09:19
Re: Minimap Mapicons - by WhiteAngels - 18.12.2013, 09:24
Re : Minimap Mapicons - by [HRD]Mar1 - 18.12.2013, 09:24
Re: Minimap Mapicons - by LMagnifico - 18.12.2013, 10:15
Re : Minimap Mapicons - by [HRD]Mar1 - 18.12.2013, 11:30
Re: Minimap Mapicons - by LMagnifico - 19.12.2013, 07:14
Re: Minimap Mapicons - by WhiteAngels - 20.12.2013, 06:26
Re: Minimap Mapicons - by LMagnifico - 20.12.2013, 09:24

Forum Jump:


Users browsing this thread: 1 Guest(s)