Need help with drawing icons on the map [still need help] -
EpicDutchie - 14.04.2014
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.
Re: Need help with drawing icons on the map -
Jefff - 14.04.2014
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 );
Re: Need help with drawing icons on the map -
EpicDutchie - 14.04.2014
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 ?
Re: Need help with drawing icons on the map -
EpicDutchie - 14.04.2014
*BUMP*
Sorry but my problem isn't solved yet.
Re: Need help with drawing icons on the map -
Jefff - 14.04.2014
I dont understand, you want for every player mapicon for second team?
Re: Need help with drawing icons on the map -
EpicDutchie - 15.04.2014
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.
Re: Need help with drawing icons on the map -
EpicDutchie - 15.04.2014
Anyone know a way to do this, please?!
Re: Need help with drawing icons on the map -
EpicDutchie - 16.04.2014
Final bump, please help?!
Re: Need help with drawing icons on the map -
DobbysGamertag - 16.04.2014
So its just the players you want shown on the map for a specific person/team?
https://sampwiki.blast.hk/wiki/SetPlayerMarkerForPlayer
Re: Need help with drawing icons on the map -
EpicDutchie - 16.04.2014
Quote:
Originally Posted by DobbysGamertag
|
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.