[HELP] Icon Streaming Problem
#1

Hy, this is the icon streamer i am using:
Код:
#define MAX_ICONS 100

enum iInfo
{
  Float:iX,
  Float:iY,
  Float:iZ,
  iIcon,
  iColor
};

new IconInfo[MAX_ICONS][iInfo];
new IconUsed[MAX_ICONS];
new Icons = 0;
new pTick[MAX_PLAYERS];

stock PlayerToPoint(playerid, Float:Range, Float:X, Float:Y, Float:Z)
{
	if(IsPlayerConnected(playerid))
	{
		new Float:pX, Float:pY, Float:pZ, Float:tX, Float:tY, Float:tZ;
		GetPlayerPos(playerid, pX, pY, pZ);
		tX = (pX-X);tY = (pY-Y);tZ = (pZ-Z);
		if(((tX < Range) && (tX > -Range)) && ((tY < Range) && (tY > -Range)) && ((tZ < Range) && (tZ > -Range)))
		{
			return 1;
		}
	}
	return 0;
}
stock CreateMapIcon(Icon, Color, Float:X, Float:Y, Float:Z)
{
	IconUsed[Icons] = 1;
	IconInfo[Icons][iX] = X;
	IconInfo[Icons][iY] = Y;
	IconInfo[Icons][iZ] = Z;
	IconInfo[Icons][iIcon] = Icon;
	IconInfo[Icons][iColor] = Color;
	return Icons++;
}
stock ChangeMapIcon(IconID, Icon)
{
	IconInfo[IconID][iIcon] = Icon;
}
forward StreamMapIcons(playerid);
public StreamMapIcons(playerid)
{
	if(GetTickCount() - pTick[playerid] > 250)
	{
		for(new i=0; i<MAX_ICONS; i++)
		{
			if(PlayerToPoint(playerid, 250.0, IconInfo[i][iX], IconInfo[i][iY], IconInfo[i][iZ]))
			{
				if(IconUsed[i])
					SetPlayerMapIcon(playerid, i, IconInfo[i][iX], IconInfo[i][iY], IconInfo[i][iZ], IconInfo[i][iIcon], IconInfo[i][iColor]);
			}
			else
			{
				if(IconUsed[i])
					RemovePlayerMapIcon(playerid, i);
			}
		}
		pTick[playerid] = GetTickCount();
	}    
}
I use it to stream icons for houses retrieved from database.
I have a total of 34 houses in the database, and for some reason house no.34 icon never gets streamed.
Can anyone tell me why?
Reply
#2

Fixed.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)