05.10.2011, 23:49
Ae galera blz? to querendo fazer comque apareзa so 1 picku no mapa tipo existem 2 casas uma do lado da outra ai aparece a mapicon da casa que ta mais perto como faz? ja tentei fazer de uma prop aki mais n deu
native CreateDynamicMapIcon(Float:x, Float:y, Float:z, type, color, worldid = -1, interiorid = -1, playerid = -1, Float:distance = 100.0);
native DestroyDynamicMapIcon(iconid);
native IsValidDynamicMapIcon(iconid);
native DestroyAllDynamicMapIcons();
native CountDynamicMapIcons();
forward MapIconStreamer();
public MapIconStreamer()
{
for(new i; i<MAX_HOUSES; 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;
}
}
DestroyDynamicMapIcon(HouseMapIcon[ i ]);
if(hInfo[CP][TemDono] == 1)
{
HouseMapIcon[ i ] = CreateDynamicMapIcon(hInfo[ CP ][ iconx ],hInfo[ CP ][ icony ],hInfo[ CP ][ iconz ],32,1,-1,0,-1,80.0);
}
else
{
HouseMapIcon[ i ] = CreateDynamicMapIcon(hInfo[ CP ][ iconx ],hInfo[ CP ][ icony ],hInfo[ CP ][ iconz ],31,1,-1,0,-1,80.0);
}
}
}
}