Name Tag Question. - 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)
+--- Thread: Name Tag Question. (
/showthread.php?tid=534125)
Name Tag Question. -
Sting. - 28.08.2014
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?
Re: Name Tag Question. -
Rudy_ - 28.08.2014
Ofc it's possible... i've seen it
Re: Name Tag Question. -
JordanDoughty - 28.08.2014
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
Re: Name Tag Question. -
MicroD - 28.08.2014
https://sampwiki.blast.hk/wiki/SetPlayerName
Re: Name Tag Question. -
tyler12 - 28.08.2014
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;
}
Re: Name Tag Question. -
Sting. - 28.08.2014
@tyler I didn't need the code but thanks. You deserve Rep. So thanks. Its possible.