#1

I need a system to my TDM server, i have 2 teams and i use gTeam (My teams are Policias and Terroristas)
I want to each team only can see on the map his team players
Example:
Player of Policias team can only see the other Policias
Please help me with this
Reply
#2

Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && GetPlayerTeam(i) == GetPlayerTeam(playerid))
{
SetPlayerMarkerForPlayer(playerid, i, 0xFF0000FF); //select color
}
}
Place in any callback which you would like to start.
Reply
#3

In wich callback? Can you write example please...
Can you edit it to me to gTeam (Team 1: Policias, team 2: Terroristas)
Because i want to each team have one color, Azul (Blue) for Policias and Rojo (Red) for Terroristas.
Код:
static gTeam[MAX_PLAYERS];
#define Policias 1
#define Terroristas 2

#define RojoMarcado     0xFF0000FF //Colour for Terroristas
#define AzulMarcado     0x0000FFFF //Colour for Policias
Reply
#4

You could use something like:
pawn Код:
OnPlayerSpawn(playerid)
{
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(gTeam[playerid] == 1) //Police team
        {
            SetPlayerMarkerForPlayer(playerid, i, COLOR_RED);
        }
        else SetPlayerMarkerForPlayer(playerid, i, COLOR_BLUE);
    }
    return 1;
}
Note that you'll have to define COLOR_RED and COLOR_BLUE to actually work.
Reply
#5

And if someone new join the server? This will update showing new players?
Reply
#6

BUMP
Reply
#7

This will not update marker for the player until he spawn again.
Reply
#8

Quote:
Originally Posted by Dayrion
Посмотреть сообщение
This will not update marker for the player until he spawn again.
Any mode to do it?
Reply
#9

Quote:
Originally Posted by karoliko
Посмотреть сообщение
Any mode to do it?
You can try to set a timer and include the function in this timer. Something like that.
Reply
#10

Can you do the code, i don't know... :3
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)