Need help with drawing icons on the map
#1

Hello people from the SA-MP forum,

I have a question about drawing icons on the minimap. My idea is when a player calls in an UAV Overwatch drone (radar), the players from the other team will show on the minimap as yellow dots for the other team.

The code I use to define the teams:

Код:
new faction[MAX_PLAYERS] = 0;
When a player join team 1, their faction will be 1, if they join team 2, their faction will be 2.
This is what I'm trying to use to make it only draw enemy players on the minimap and not friendlies.

The only problem that I am facing is that I don't really know how to get all the player id's from the enemy players and get their x,y and z to draw the icon on the map.

I currently wrote this but I don't know how to make it work the way I described above.

Код:
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x,y,z);	
SetPlayerMapIcon(playerid, 1, x, y, z, 56, 0, MAPICON_GLOBAL );
Of course, this only makes a dot on the map for the player himself. Not all the players on the enemy team that are currently connected.

Any help with be highly appreciated.
Reply
#2

pawn Код:
for(new i=0; i != MAX_PLAYERS; i++)
    if( IsPlayerConnected(i) && faction[playerid] == faction[i] )
        SetPlayerMapIcon(i, 1, x, y, z, 56, 0, MAPICON_GLOBAL );
Reply
#3

Quote:
Originally Posted by Jefff
Посмотреть сообщение
pawn Код:
for(new i=0; i != MAX_PLAYERS; i++)
    if( IsPlayerConnected(i) && faction[playerid] == faction[i] )
        SetPlayerMapIcon(i, 1, x, y, z, 56, 0, MAPICON_GLOBAL );
How do I get the positions of the players (x,y,z) to draw the icon on ?
Reply
#4

*BUMP*
Sorry but my problem isn't solved yet.
Reply
#5

I dont understand, you want for every player mapicon for second team?
Reply
#6

Quote:
Originally Posted by Jefff
Посмотреть сообщение
I dont understand, you want for every player mapicon for second team?
Yes, for example when a player from team 1 calls in the uav, all the players from team 2 appear on the minimap for all the player on team 1. I use a timer to update this every single second.
Reply
#7

Anyone know a way to do this, please?!
Reply
#8

Final bump, please help?!
Reply
#9

So its just the players you want shown on the map for a specific person/team?

https://sampwiki.blast.hk/wiki/SetPlayerMarkerForPlayer
Reply
#10

Quote:
Originally Posted by DobbysGamertag
Посмотреть сообщение
So its just the players you want shown on the map for a specific person/team?

https://sampwiki.blast.hk/wiki/SetPlayerMarkerForPlayer
No I use SetPlayerMapIcon to draw the icons. When team 1 calls in a uav, All players from team 2 will be drawn in the minimap for all players on team 1.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)