Need little help. +Rep to helper.
#1

I want when player choose class (team) he can see only he's team in the map (markers) and names (name tags).

Edit because my bad english: When a player selects a team, he can only see his teammates on the map, and only the names of his teammates.

my code:

PHP код:
public OnPlayerRequestClass(playerid,classid)
{
switch(
classid)
{
case 
0:
{
SetPlayerTeam(playerid,******);
SetPlayerColor(playerid,******");
SetPlayerPos(playerid, ******);
SetPlayerCameraPos(playerid, ******);
SetPlayerCameraLookAt(playerid, ******);
SendClientMessage(playerid,0x2641FE00,"
******");
SendClientMessage(playerid,0x2641FE00,"
******");
SendClientMessage(playerid,0x2641FE00,"
******");
SendClientMessage(playerid,0x2641FE00,"
******");
return 1;                      
}
case 1:
{
SetPlayerTeam(playerid,******);
SetPlayerColor(playerid,******"
);
SetPlayerPos(playerid, ******);
SetPlayerCameraPos(playerid, ******);
SetPlayerCameraLookAt(playerid, ******);
SendClientMessage(playerid,0x2641FE00,"******");
SendClientMessage(playerid,0x2641FE00,"******");
SendClientMessage(playerid,0x2641FE00,"******");
SendClientMessage(playerid,0x2641FE00,"******");
return 
1;
}
}
return 
1;

Reply
#2

First fix your english, i cant even understand you.
Reply
#3

Quote:
Originally Posted by DonaldDuck
Посмотреть сообщение
First fix your english, i cant even understand you.
Yes I have bad english but try to understand me, I want when player choose team he can see only he's team on the map and when player in team meet enemy he can't see he's nametag only he's freinds (team name tags)
Reply
#4

Quote:
Originally Posted by DonaldDuck
Посмотреть сообщение
First fix your english, i cant even understand you.
When a player selects a team, he can only see his teammates on the map, and only the names of his teammates.
Reply
#5

https://sampwiki.blast.hk/wiki/SetPlayerMarkerForPlayer
https://sampwiki.blast.hk/wiki/ShowPlayerNameTagForPlayer

Quick example:

pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
      if(GetPlayerTeam(i) == GetPlayerTeam(playerid))
      {
             SetPlayerMarkerForPlayer(playerid, i, COLOR);
      }
}
I didn't test the code, but I hope you get the idea.

You can also use the foreach loop, whatever works for you
Reply
#6

Quote:
Originally Posted by TonyII
Посмотреть сообщение
https://sampwiki.blast.hk/wiki/SetPlayerMarkerForPlayer
https://sampwiki.blast.hk/wiki/ShowPlayerNameTagForPlayer

Quick example:

pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
      if(GetPlayerTeam(i) == GetPlayerTeam(playerid))
      {
             SetPlayerMarkerForPlayer(playerid, i, COLOR);
      }
}
I didn't test the code, but I hope you get the idea.

You can also use the foreach loop, whatever works for you
ok, thank you very much!
Reply
#7

Quote:
Originally Posted by TonyII
Посмотреть сообщение
https://sampwiki.blast.hk/wiki/SetPlayerMarkerForPlayer
https://sampwiki.blast.hk/wiki/ShowPlayerNameTagForPlayer

Quick example:

pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
      if(GetPlayerTeam(i) == GetPlayerTeam(playerid))
      {
             SetPlayerMarkerForPlayer(playerid, i, COLOR);
      }
}
I didn't test the code, but I hope you get the idea.

You can also use the foreach loop, whatever works for you
Not work... someone can help me pls !?
Reply
#8

PHP код:
public OnPlayerSpawn(playerid)
{
    for(new 
0MAX_PLAYERSi++)
    {
        if(
GetPlayerTeam(i) != GetPlayerTeam(playerid) && != playerid)
        {
                
ShowPlayerNameTagForPlayer(playeridifalse);
                
SetPlayerMarkerForPlayer(playeridi,  GetPlayerColor(i) & 0xFFFFFF00);
        }
    }

Reply
#9

Quote:
Originally Posted by XeonMaster
Посмотреть сообщение
PHP код:
public OnPlayerSpawn(playerid)
{
    for(new 
0MAX_PLAYERSi++)
    {
        if(
GetPlayerTeam(i) != GetPlayerTeam(playerid) && != playerid)
        {
                
ShowPlayerNameTagForPlayer(playeridifalse);
                
SetPlayerMarkerForPlayer(playeridi,  GetPlayerColor(i) & 0xFFFFFF00);
        }
    }

How to do it to two teams? and the color set the team by the color?
Reply
#10

Invert it. Have everyone invisible by default and only make the people on the team visible.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)