22.05.2009, 20:09
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.
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.
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;
}
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.

