Gang name beside Player name :/
#1

Gang name beside playername
As the title says, I want to know how i can put the Gang names that i've chosen beside a players name and to not confuse you, here's an example.

When you look at the player you will see:

[Mafia*] Stop(1)

and when he types in the chat you will see:

[Mafia*] Stop(1): Hello !
Reply
#2

If you mean changing the players actual name, and not changing their name internally in your script/in chats, you can use the strins function along with SetPlayerName.

Example of usage:
pawn Код:
new playerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);

strins(playerName, "[Mafia] ", 0);
SetPlayerName(playerid, playerName);
Similarly, the Mafia tag can then be removed with the strdel function. Example:
pawn Код:
new playerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);

strdel(playerName, 0, 7);
SetPlayerName(playerid, playerName);
Reply
#3

You shouldn't do that as the max length of a name is 24 characters so if a player's name is kinda long then it won't just fit.
Reply
#4

you can just put the tag on payer name when he chats like below.

PHP код:
public OnPlayerText(playeridtext[])
{
    new
        
pgangtag[] = "Mafia"// ex this var is player tag..
        
string[128 /* maximum message in chat size */ 2*/* embedded colors size*/],
        
playernamew[MAX_PLAYER_NAME]
    ;
    
GetPlayerName(playeridplayernamewsizeof playernamew);
    
format(stringsizeof string,"[%s*] {%06x}%s{FFFFFF}(%d): %s",pgangtagGetPlayerColor(playerid), playernamewplayeridtext);
    
SendClientMessageToAll(0xFF0000AAstring);
    return 
0;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)