[HELP] Adding ID's INTO CHAT!! PLEASE HELP
#1

How could i add the player's id into the chat?? So that it appears [id][player]:Text <----But stays with their teamcolor
Reply
#2

same easy as to get ot the hell ;P
pawn Код:
public OnPlayerText(playerid,text[]){
        new String[256];
        format(String, 256, "(%d): %s", playerid, text);
        SendPlayerMessageToAll(playerid,String);
        return 0;// return 0 !!!! otherwise you get a double chat message
}
Reply
#3

is there a way to get it coloured?
Reply
#4

like how would i make it be able to set their team colours with it?
Reply
#5

What's wrong with http://forum.sa-mp.com/index.php?top...8596#msg928596 ?
Reply
#6

Quote:
Originally Posted by [HiC
He wants the ID as part of the name, so it's coloured.

You can change their name under OnPlayerText**, use SendPlayerMessageToAll to send their text from their new name, change their name back, return 0 for the original text.

** Check if their name is over 15 characters, make sure it's not. The highest player ID is is 499, "[499]" is 5 characters, and the maximum name is 20 characters. You wouldn't be able to change it if their ID was 100-499 and they had a name longer than 15 characters.
Reply
#7

pawn Код:
public OnPlayerText(playerid, text[])
{
new str[160];
new name[32];
GetPlayerName(playerid, name, sizeof(name));
format(str, sizeof(str), "%s(%d): %s", name, playerid, text);
SendClientMessageToAll(0xFFFFFFAA, str); // Replace the 0xFFFFFFAA (White) with some team color checking
return 0;
}
Reply
#8

Quote:
Originally Posted by Gozerr
pawn Код:
public OnPlayerText(playerid, text[])
{
new str[160];
new name[32];
GetPlayerName(playerid, name, sizeof(name));
format(str, sizeof(str), "%s(%d): %s", name, playerid, text);
SendClientMessageToAll(0xFFFFFFAA, str); // Replace the 0xFFFFFFAA (White) with some team color checking
return 0;
}
the playername will also be white, but if it is what he wants.. ok ;p

Quote:
Originally Posted by [HiC
TheKiller ]
pawn Код:
public OnPlayerText(playerid, text[])
{
  new str[9];
  format(str, 9, "(%d) ", playerid);
  strins(text, str, 0);  
  return 1;
}
1234 posts :P.
ye also a good method..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)