Name Tag Question.
#1

Firstly, I would just like to ask a question. Could you actually change a nametag in game?

For example, I registered under Sting on a server and there's a command, /dance and when I do that... I'm teleported to a location and my in game name says "[DANCING]Sting". Like a name change in game and the account isn't affected and then when I leave, it becomes normal.... (In game still. Not that I left the server. Left the dance floor.) ?

Could it?
Reply
#2

Ofc it's possible... i've seen it
Reply
#3

Quote:
Originally Posted by Sting.
Посмотреть сообщение
Firstly, I would just like to ask a question. Could you actually change a nametag in game?

For example, I registered under Sting on a server and there's a command, /dance and when I do that... I'm teleported to a location and my in game name says "[DANCING]Sting". Like a name change in game and the account isn't affected and then when I leave, it becomes normal.... (In game still. Not that I left the server. Left the dance floor.) ?

Could it?
Does anyone reckon it's possible if you got their name then changed it to [Dancing] %s then back again on the command to leave? Sounds Logical
Reply
#4

https://sampwiki.blast.hk/wiki/SetPlayerName
Reply
#5

pawn Код:
new PlayerOriginalName[MAX_PLAYERS][MAX_PLAYER_NAME];

public OnPlayerConnect(playerid)
{
    GetPlayerName(playerid, PlayerOriginalName[playerid], MAX_PLAYER_NAME);
    return 1;
}

CMD:dancing(playerid, params[])
{
    SetPlayerPos(playerid,12.3,45.6,78.9);
    AppendTagToName(playerid,"DANCING");
    return 1;
}

stock AppendTagToName(playerid,tag) // Append a tag to the players name
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    format(name, sizeof(name), "[%s]%s", tag, name);
    SetPlayerName(playerid, name);
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    // Save your data using PlayerOriginalName[playerid] rather than GetPlayerName (you can just use format(name, sizeof(name), PlayerOriginalName[playerid]); to save changing each variable)
    return 1;
}
Reply
#6

@tyler I didn't need the code but thanks. You deserve Rep. So thanks. Its possible.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)