How to make a players name go invisible/disappear at a command?
#1

I have no idea how to make it so when a player types /namesoff or /nameson or even /names to toggle names every player's name turns transparent/totally invisible.

I heard that it can only be done upon a gamemode start.. anyone know how to make it so when people type a command they can make names disappear? (Make sure they can turn back on! :P)

Thanks
Reply
#2

Using ShowPlayerNameTagForPlayer(playerid, showplayerid, show) and loops, easy
Reply
#3

Quote:
Originally Posted by yom
Using ShowPlayerNameTagForPlayer(playerid, showplayerid, show) and loops, easy
I'm guessing the show variable is between 1 and 0 yes?

But how would I manage to do it with everyone's id?
Reply
#4

pawn Код:
for(new i=0; i<MAX_PLAYERS; i++)
{
  ShowPlayerNameTagForPlayer(i, showplayerid, show);
}
This will disable/enable all player names (i think.. UNTESTED)
Reply
#5

I think he wanted it for the player who type the command also should playerid stay and the showplayerid must be everyone

Код:
for(new a=0; a<MAX_PLAYERS; a++) { 
ShowPlayerNameTagForPlayer(playerid,a,true/false);
}
Reply
#6

a have question about how to hide playermarker...
is theres a function? :S
Reply
#7

SetPlayerMarkerForPlayer(playerid, showplayerid, color)

Aren't functions names clear enough?
Reply
#8

forget what i said,i finded out how to do..
ShowPlayerMarkers(0) is my answer xD
Reply
#9

Quote:
Originally Posted by Nero_3D
I think he wanted it for the player who type the command also should playerid stay and the showplayerid must be everyone

Код:
for(new a=0; a<MAX_PLAYERS; a++) { 
ShowPlayerNameTagForPlayer(playerid,a,true/false);
}
were do i place this?
Reply
#10

On the place where you want it to execute.
Reply
#11

but how do i do it to a command ? i dont understand the script
Reply
#12

Yeah I'm struggling aswell, I don't understand where it's meant to go.
Reply
#13

Код:
if(strcmp(cmdtext, "/invisible", true) == 0)
{
	for(new a=0; a<MAX_PLAYERS; a++)
	{
		ShowPlayerNameTagForPlayer(playerid,a,false)
	}
	return 1;
}
maybe. no errors but i haven't test yet
Reply
#14

When I put that in, it says 'Invalid function or declaration' in the errors list.

Have you spelled/put something in wrong?
Reply
#15

he forgot the ";" after showplayer...
Код:
if(strcmp(cmdtext, "/invisible", true) == 0)
{
	for(new a=0; a<MAX_PLAYERS; a++)
	{
		ShowPlayerNameTagForPlayer(playerid,a,false);
	}
	return 1;
}
Reply
#16

Quote:
Originally Posted by Nero_3D
he forgot the ";" after showplayer...
Код:
if(strcmp(cmdtext, "/invisible", true) == 0)
{
	for(new a=0; a<MAX_PLAYERS; a++)
	{
		ShowPlayerNameTagForPlayer(playerid,a,false);
	}
	return 1;
}
ops
Reply
#17

Noobish question but will players who connect 2 the server be able to see the invisible player's name tag
I have always ran the loop continuously in the past, to make sure.
Reply
#18

Quote:
Originally Posted by LethaL
Noobish question but will players who connect 2 the server be able to see the invisible player's name tag
I have always ran the loop continuously in the past, to make sure.
Do it under OnPlayerConnect(playerid)
Reply
#19

my question is how to make players visible on the minimap... i tryed with ShowPlayerMark (1) but still cant see marks... help please
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)