[HELP] Hide Name - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] Hide Name (
/showthread.php?tid=197703)
[HELP] Hide Name - Larsey123IsMe - 10.12.2010
How to hide and show a player name in TAB
like: /hideme - Then my name dont show up in the TAB list.
and /showme - To get my name back on the TAB list
PS. Yes, i have searched for 30 mins now, but ill dont find antyhing
Re: [HELP] Hide Name -
Hal - 10.12.2010
You cannot hide names from the tab list.
Re: [HELP] Hide Name -
Retardedwolf - 10.12.2010
You could someone's name to black and you wouldn't really see it
Re: [HELP] Hide Name -
case 1337: - 10.12.2010
Maybe store their name in a file or a variable, then when you type /showme again your name would be set back to your old name, like the code below me, but logging would reset the variable, so here, try this:
pawn Код:
#include <a_samp>
new Name[MAX_PLAYERS];
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[256];
new idx;
cmd = strtok(cmdtext, idx);
if(strcmp(cmd, "/hideme", true) == 0) {
new randstring[4], PlayerName, pName[MAX_PLAYER_NAME];
new randnumber = 127 + random(71762);
PlayerName = GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
Name[playerid] = PlayerName;
format(randstring, sizeof(randstring), "Unknown_%d",randnumber);
SetPlayerName(playerid, randstring);
SendClientMessage(playerid, 0xFFFFFFAA, "You hid yourself.");
SetPlayerColor(playerid, 0x00000000);
return true;
}
if(strcmp(cmd, "/showme", true) == 0) {
SetPlayerName(playerid, Name[playerid]);
SendClientMessage(playerid, 0xFFFFFFAA, "You revealed yourself.");
SetPlayerColor(playerid, 0xFFFFFFAA);
return true;
}
return 0;
}
strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' ')) {
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1))) {
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}
Re: [HELP] Hide Name -
Steven82 - 10.12.2010
Quote:
Originally Posted by Retardedwolf
You could someone's name to black and you wouldn't really see it
|
Wouldn't work, when someone clicks on the name, it's highlights.