Nametag, apply it to everyone inside the vehicle.
#7

Ok, the thing that you're asking for is very challenging for me. Nevertheless, i'll give it a go.
This should hide nametags for all the players in your vehicle for everyone else who is not in your car. If you are in the car when u type that same car as the player you will be able to see the player's nametag. So you need to ask someone outside of the car to tell u if they can see ur nametag.
pawn Код:
if(!strcmp(cmd,"/hide",true))
{
    if(IsPlayerInAnyVehicle(playerid))
    {
      new myvehicleid = GetPlayerVehicleID(playerid);
      for (new i = 0; i < MAX_PLAYERS+1; i++)
        {
            for (new x = 0; x < MAX_PLAYERS+1; x++)
            {
                if(x != i && IsPlayerConnected(x))
                {
                    if(!IsPlayerInVehicle(i, myvehicleid)
                    {
                      if(IsPlayerConnected(x) && IsPlayerConnected(i))
                      {
                        ShowPlayerNameTagForPlayer(x,i,0);
                        // or delete abve line and put this ShowPlayerNameTagForPlayer(i,x,0);
                        }
                    }
                }
            }
        }
        GameTextForPlayer(playerid,"~r~Nametags Hidden", 3000, 1);
        ShowPlayerNameTagForPlayer(playerinfo[i][isadmin]>8,playerid, 1);
        SendClientMessage(playerid,COLOR_GREY,"your nametag is now hidden");
    }
    else SendClientMessage(playerid,COLOR_GREY,"you need to be in a vehicle to use this command!");
    return 1;

}
This is untested. There might be a major flaw in this code, so nobody please start making issues, rather say why it would not work. My logic was lost half way through the code but it's worth a try. I also gave an alternative - please see the comments for ShowPlayerNameTagForPlayer.

Let us know.
Reply


Messages In This Thread
Nametag, apply it to everyone inside the vehicle. - by Hoppa - 22.05.2009, 12:00
Re: Need help with this command. - by Klutty - 22.05.2009, 12:07
Re: Need help with this command. - by Hoppa - 22.05.2009, 12:10
Re: Nametag, apply it to everyone inside the vehicle. - by Hoppa - 22.05.2009, 16:35
Re: Nametag, apply it to everyone inside the vehicle. - by member - 22.05.2009, 17:02
Re: Nametag, apply it to everyone inside the vehicle. - by Hoppa - 22.05.2009, 19:19
Re: Nametag, apply it to everyone inside the vehicle. - by member - 22.05.2009, 20:09
Re: Nametag, apply it to everyone inside the vehicle. - by Hoppa - 23.05.2009, 02:48
Re: Nametag, apply it to everyone inside the vehicle. - by Hoppa - 23.05.2009, 11:05

Forum Jump:


Users browsing this thread: 1 Guest(s)