Show cops on radar (only for other cops)
#9

Quote:
Originally Posted by ApolloScripter
View Post
Hello binnyl, I don't know how exactly SetPlayerMarkerForPlayer works, but I have a similar system, but I used SetPlayerMapIcon to put an icon for all players of the same clan.

The difference is that SetPlayerMapIcon makes it possible to change the constant style to appear on every radar, or just in your field of view.

The problem is that for each Map Icon will need to get the position of the player, but if you are interested follow the steps below and put them in your code, which maybe will work perfectly.

pawn Code:
new iconMapPlayerCount[MAX_PLAYERS]; //Set the variable to Map Icon Count

forward TeamRadar(playerid); public TeamRadar(playerid)
{
    if(IsACop(playerid))
    {
        foreach(new i : Player)
        {
            if(IsACop(i))
            {
                if(IsPlayerConnected(i))
                {
                    new Float:tg_x, tg_y, tg_z; //Set variables to target coordinates
                    GetPlayerPos(i, Float:tg_x, Float:tg_y, Float:tg_z); //Get target pos
                    SetPlayerMapIcon(playerid, iconMapPlayerCount[playerid], Float:tg_x, Float:tg_y, Float:tg_z, 0, 0x59f060FF, MAPICON_GLOBAL); //Add a icon to the target position
                    iconMapPlayerCount[playerid]++; //Increment the player count icon id
                }
                else
                {
                    RemovePlayerMapIcon(playerid, iconMapPlayerCount[playerid]); //Remove the icon if the target disconnect
                }
            }
        }

        iconMapPlayerCount[playerid] = 0; //Set the count to 0
    }
}
I didn't have time to test the operation, but if you use it and some error occurs, just call me.
EDIT NOTE: The problem with this Icon is that only 100 can be used.
I'm already uses SetPlayerMapIcon for a lot of stuff
Even had to use a streammer to don't get to the 100

SetPlayerMarkerForPlayer was made for it
Idk what happen if i'm missing something or if it is bugged already

Anyways, ty to your try, i rep you
Reply


Messages In This Thread
Show cops on radar (only for other cops) - by binnyl - 20.11.2019, 02:58
Re: Show cops on radar (only for other cops) - by binnyl - 22.11.2019, 02:30
Re: Show cops on radar (only for other cops) - by Hitek - 22.11.2019, 07:53
Re: Show cops on radar (only for other cops) - by Gforcez - 22.11.2019, 08:27
Re: Show cops on radar (only for other cops) - by binnyl - 22.11.2019, 15:40
Re: Show cops on radar (only for other cops) - by binnyl - 29.11.2019, 23:24
Re: Show cops on radar (only for other cops) - by binnyl - 30.11.2019, 21:14
Re: Show cops on radar (only for other cops) - by ApolloScripter - 30.11.2019, 23:23
Re: Show cops on radar (only for other cops) - by binnyl - 02.12.2019, 03:54
Re: Show cops on radar (only for other cops) - by 4D1L - 02.12.2019, 20:39

Forum Jump:


Users browsing this thread: 2 Guest(s)