Name Tag??
#2

Say a player enters a vehicle, and his tag should not be shown to all others (and re-shown on exitting the veh.) you have to do this:

Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER) for(new i = 0; i < MAX_PLAYERS; i ++) if(IsPlayerConnected(i) && playerid != i) ShowPlayerNameTagForPlayer(playerid, i, 0);
    if(newstate != PLAYER_STATE_DRIVER && newstate != PLAYER_STATE_PASSENGER) for(new i = 0; i < MAX_PLAYERS; i ++) if(IsPlayerConnected(i) && playerid != i) ShowPlayerNameTagForPlayer(playerid, i, 1);
}
You could add some optimization to the loops above, like checking if the players are streamed in for each other or something, but it's not doing much anyways.

However, if I remember correctly, this gets reset if a player streams out and in again, so you have to repeat this in OnPlayerStreamIn (if the first of the 2 players is in a vehicle). But test it first.
Reply


Messages In This Thread
Name Tag?? - by VenusDarkX - 21.03.2016, 16:35
Re: Name Tag?? - by NaS - 21.03.2016, 16:49
Re: Name Tag?? - by VenusDarkX - 22.03.2016, 03:44

Forum Jump:


Users browsing this thread: 1 Guest(s)