SA-MP Forums Archive
Need little help. +Rep to helper. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Need little help. +Rep to helper. (/showthread.php?tid=638017)



Need little help. +Rep to helper. - CheckItOut - 25.07.2017

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;




Re: Need little help. +Rep to helper. - DonaldDuck - 25.07.2017

First fix your english, i cant even understand you.


Re: Need little help. +Rep to helper. - CheckItOut - 25.07.2017

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)


Re: Need little help. +Rep to helper. - CheckItOut - 25.07.2017

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.


Re: Need little help. +Rep to helper. - TonyII - 25.07.2017

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


Re: Need little help. +Rep to helper. - CheckItOut - 25.07.2017

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!


Re: Need little help. +Rep to helper. - CheckItOut - 25.07.2017

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 !?


Re: Need little help. +Rep to helper. - Xeon™ - 25.07.2017

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




Re: Need little help. +Rep to helper. - CheckItOut - 25.07.2017

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?


Re: Need little help. +Rep to helper. - Vince - 25.07.2017

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