SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 14/04/2014, 04:54 PM   #1
EpicDutchie
Little Clucker
 
Join Date: Apr 2014
Location: The Netherlands
Posts: 20
Reputation: 1
Default Need help with drawing icons on the map [still need help]

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:

Code:
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.

Code:
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.

Last edited by EpicDutchie; 16/04/2014 at 08:29 AM.
EpicDutchie is offline   Reply With Quote
Old 14/04/2014, 04:59 PM   #2
Jefff
Banned
 
Join Date: Dec 2007
Posts: 2,594
Reputation: 326
Default Re: Need help with drawing icons on the map

pawn Code:
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 );
Jefff is offline   Reply With Quote
Old 14/04/2014, 05:04 PM   #3
EpicDutchie
Little Clucker
 
Join Date: Apr 2014
Location: The Netherlands
Posts: 20
Reputation: 1
Default Re: Need help with drawing icons on the map

Quote:
Originally Posted by Jefff View Post
pawn Code:
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 ?
EpicDutchie is offline   Reply With Quote
Old 14/04/2014, 07:42 PM   #4
EpicDutchie
Little Clucker
 
Join Date: Apr 2014
Location: The Netherlands
Posts: 20
Reputation: 1
Default Re: Need help with drawing icons on the map

*BUMP*
Sorry but my problem isn't solved yet.
EpicDutchie is offline   Reply With Quote
Old 14/04/2014, 08:30 PM   #5
Jefff
Banned
 
Join Date: Dec 2007
Posts: 2,594
Reputation: 326
Default Re: Need help with drawing icons on the map

I dont understand, you want for every player mapicon for second team?
Jefff is offline   Reply With Quote
Old 15/04/2014, 06:39 AM   #6
EpicDutchie
Little Clucker
 
Join Date: Apr 2014
Location: The Netherlands
Posts: 20
Reputation: 1
Default Re: Need help with drawing icons on the map

Quote:
Originally Posted by Jefff View Post
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.
EpicDutchie is offline   Reply With Quote
Old 15/04/2014, 03:05 PM   #7
EpicDutchie
Little Clucker
 
Join Date: Apr 2014
Location: The Netherlands
Posts: 20
Reputation: 1
Default Re: Need help with drawing icons on the map

Anyone know a way to do this, please?!
EpicDutchie is offline   Reply With Quote
Old 16/04/2014, 08:28 AM   #8
EpicDutchie
Little Clucker
 
Join Date: Apr 2014
Location: The Netherlands
Posts: 20
Reputation: 1
Default Re: Need help with drawing icons on the map

Final bump, please help?!
EpicDutchie is offline   Reply With Quote
Old 16/04/2014, 08:31 AM   #9
DobbysGamertag
Gangsta
 
DobbysGamertag's Avatar
 
Join Date: Jan 2013
Location: England
Posts: 803
Reputation: 100
Default Re: Need help with drawing icons on the map

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

http://wiki.sa-mp.com/wiki/SetPlayerMarkerForPlayer
DobbysGamertag is offline   Reply With Quote
Old 16/04/2014, 08:51 AM   #10
EpicDutchie
Little Clucker
 
Join Date: Apr 2014
Location: The Netherlands
Posts: 20
Reputation: 1
Default Re: Need help with drawing icons on the map

Quote:
Originally Posted by DobbysGamertag View Post
So its just the players you want shown on the map for a specific person/team?

http://wiki.sa-mp.com/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.
EpicDutchie is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Minimap drawing... CoaPsyFactor Scripting Help 5 02/10/2011 08:50 PM
Drawing A Box.. Deji Help Archive 5 23/01/2011 10:15 PM
Drawing Objects? - Have to get out of car. campkz Help Archive 1 07/04/2010 03:42 PM
Help with drawing text veskosid Help Archive 1 21/04/2009 11:56 PM


All times are GMT. The time now is 09:51 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.