#define INVALID_ICON_ID -1 new Slot[MAX_PLAYERS][MAX_CHECKPOINTS]; new SlotUsed[MAX_PLAYERS][32]; new IconCount[MAX_PLAYERS]; forward MapIconUpdate(); public MapIconUpdate() { new s;//new string[256]; //new Float:X,Float:Y,Float:Z; for(new i; i < GetMaxPlayers(); i++) { if(IsPlayerConnected(i) && PlayerInfo[i][pSpawn] == 1) { for(new j = 0; j < sizeof(HouseInfo); j++)//sizeof(HouseInfo) Current_House_ID { if (HouseData[j][h_RobWaitTime] > 0) { HouseData[j][h_RobWaitTime] --; } if (HouseData[j][h_InviteTime] > 0) { HouseData[j][h_InviteTime] --; if (HouseData[j][h_InviteTime] == 1) { HouseData[j][h_InviteID] = -1; HouseData[j][h_InviteRequestID] = -1; } } if (j > 0 && HouseInfo[j][h_cpmarker] > 0) { if (IsPlayerInRangeOfPoint(i, 100.0, HouseInfo[j][h_cpx], HouseInfo[j][h_cpy], HouseInfo[j][h_cpz]) && GetPlayerVirtualWorld(i) == 0) { if(Slot[i][j] == INVALID_ICON_ID) { s = GetFreeSlot(i); if(IconCount[i] < 99 && s != INVALID_ICON_ID) { if (HouseData[j][h_OwnerID] > -1 && HouseInfo[j][h_cptype] == CP_TYPE_HOUSE) { if (HouseData[j][h_OwnerID] == i) { HouseInfo[j][h_cpmarker] = 35; }else{ if (HouseData[j][h_Rent] > 0) { HouseInfo[j][h_cpmarker] = 32; } } } SetPlayerMapIcon(i,s,HouseInfo[j][h_cpx], HouseInfo[j][h_cpy], HouseInfo[j][h_cpz],HouseInfo[j][h_cpmarker],0, MAPICON_GLOBAL); SlotUsed[i][s]=true; Slot[i][j] = s; IconCount[i] ++; } } }else{ if(Slot[i][j] != INVALID_ICON_ID) { RemovePlayerMapIcon(i,Slot[i][j]); SlotUsed[i][Slot[i][j]] = false; Slot[i][j] = INVALID_ICON_ID; IconCount[i]--; } } } } } } return 1; }
So you want the map icons to more or less only show up when your near them rather than have them all show up all the time?
If this is what you were asking, use MAPICON_LOCAL rather than MAPICON_GLOBAL Ref: https://sampwiki.blast.hk/wiki/MapIconStyle |
enum hInfo { Float:h_cpx, Float:h_cpy, Float:h_cpz, h_cpsize, h_cptype, h_cpbustype, h_cpmarker, Float:h_cp_radius, Float:h_entry_x, Float:h_entry_y, Float:h_entry_z, Float:h_entry_a, h_entry_i, h_entry_w, Float:h_exit_x, Float:h_exit_y, Float:h_exit_z, Float:h_exit_a, {1836.483886, -1682.518554, 13.346036, 2, CP_TYPE_ENTRY, BUS_TYPE_DANCE_CLUB,48, 30.0 ,493.406616, -22.114572, 1000.679687, 1.596820 ,17,306 ,1832.933105, -1682.631103, 13.494419, 93.031532, "Dance Club" ,"Idlewood"}, {2507.419921, 1242.627441, 10.820312, 2, CP_TYPE_ENTRY, BUS_TYPE_DANCE_CLUB,48, 30.0 ,493.406616, -22.114572, 1000.679687, 1.596820 ,17,307 ,2507.592773, 1245.780151, 10.820312, 0.075785, "Dance Club" ,"The Camel Toe"}, {-2551.242187, 193.735366, 6.223016, 2, CP_TYPE_ENTRY, BUS_TYPE_DANCE_CLUB,48, 30.0 ,493.406616, -22.114572, 1000.679687, 1.596820 ,17,308 ,-2554.641601, 192.610519, 6.133381, 108.901412, "Dance Club" ,"Ocean Flats"}, .... continues