[HELP] Hide Name
#1

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
Reply
#2

You cannot hide names from the tab list.
Reply
#3

You could someone's name to black and you wouldn't really see it
Reply
#4

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;
}
Reply
#5

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)