07.10.2011, 13:52
Anyone know how to put only one of the houses icon to appear on the map?
Look at the code I tried to do but are not showing up
Look at the code I tried to do but are not showing up
pawn Code:
forward MapIconStreamer();
public MapIconStreamer()
{
for(new i; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
new Float:SmallestDistance = 99999.9;
new CP, Float:OldDistance;
for(new propid; propid<MAX_HOUSES; propid++)
{
OldDistance = GetDistanceToProperty(i, propid);
if(OldDistance < SmallestDistance)
{
SmallestDistance = OldDistance;
CP = propid;
}
}
RemovePlayerMapIcon(i, 31);
if(hInfo[CP][TemDono] == 1)
{
SetPlayerMapIcon(i, 31, hInfo[ CP ][ iconx ],hInfo[ CP ][ icony ],hInfo[ CP ][ iconz ], 32, 0);
}
else
{
SetPlayerMapIcon(i, 31, hInfo[ CP ][ iconx ],hInfo[ CP ][ icony ],hInfo[ CP ][ iconz ], 31, 0);
}
}
}
}