Is it possible to make this?
#1

Hey i wanted to ask if tis possible to make this, like:

if you dont know that player it will show his name, otherwise it wont display player name with ShowPlayerNameTagForPlayer, but instead it will show his id with attach3dtextlabel... And if its possible, could you please get me on the right way of doing this? Like, the arrays combination or everything else...

Thanks in advice!
Reply
#2

OnPlayerStreamIn you would need to use ShowPlayerNameTagForPlayer, as you said
You need to use an array for saving "does the player know eachother"?
you could do that at OnPlayerConnect by looping trough all players, and then setting the variable on true or false:

at top:
Код:
new bool:DoesPlayerKnowPlayer[MAX_PLAYERS][MAX_PLAYERS];
for example: DoesPlayerKnowPlayer[1][20] would mean that playerid 1 knows playerid 20 if it returns True
if it returns False they don't know eachother

so at onplayerconnect you would have:

Код:
public OnPlayerConnect(playerid, ...)
{
    for(new i; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(TheyOnowEachOther)
            {
                DoesPlayerKnowPlayer[playerid][i] = true; //setting for the player himself
                DoesPlayerKnowPlayer[i][playerid] = true; //and also for the other player
            }
            else
            {
                DoesPlayerKnowPlayer[playerid][i] = false;
                DoesPlayerKnowPlayer[i][playerid] = false;
            }
        }
    }
}
Reply
#3

Quote:
Originally Posted by ғαιιοцт
Посмотреть сообщение
OnPlayerStreamIn you would need to use ShowPlayerNameTagForPlayer, as you said
You need to use an array for saving "does the player know eachother"?
you could do that at OnPlayerConnect by looping trough all players, and then setting the variable on true or false:

at top:
Код:
new bool:DoesPlayerKnowPlayer[MAX_PLAYERS][MAX_PLAYERS];
for example: DoesPlayerKnowPlayer[1][20] would mean that playerid 1 knows playerid 20 if it returns True
if it returns False they don't know eachother

so at onplayerconnect you would have:

Код:
public OnPlayerConnect(playerid, ...)
{
    for(new i; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(TheyOnowEachOther)
            {
                DoesPlayerKnowPlayer[playerid][i] = true; //setting for the player himself
                DoesPlayerKnowPlayer[i][playerid] = true; //and also for the other player
            }
            else
            {
                DoesPlayerKnowPlayer[playerid][i] = false;
                DoesPlayerKnowPlayer[i][playerid] = false;
            }
        }
    }
}
Thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)