[HELP] Showing Id On OnPlayerText
#1

Sorry guys, I am sick and i have a bad headache... I've been trying to find out how to show the player's id on chat... I've searched up everyway but couldn't find anything really...Sorry.. Can someone show me an example.. it would be greatly appreiciated thanks... and you'll put less pain on my headache.
Reply
#2

pawn Код:
public OnPlayerText(playerid, text[])
{
  new str[9];
  format(str, 9, "(%d) ", playerid);
  strins(text, str, 0);  
  return 1;
}
1234 posts :P.
Reply
#3

Dangit ^^^^^ He Beat me 2 it -_-
Reply
#4

Quote:
Originally Posted by AnimeOtaku
Dangit ^^^^^ He Beat me 2 it -_-
Dude, all your posts are just posts saying that people got there before you, don't spam.
Reply
#5

I registered Today and im Scripting and the same time, I dont look at peoples posts i just post replies, I posted the answer and then edited it, So yeah :^)
Reply
#6

Quote:
Originally Posted by AnimeOtaku
I registered Today and im Scripting and the same time, I dont look at peoples posts i just post replies, I posted the answer and then edited it, So yeah :^)
Then from now on don't do it..
Reply
#7

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/whatsmyid", cmdtext, true, 10) == 0)
    {
        new str[256];
        format(str, sizeof(str), "Your ID is: %d ", playerid);
        SendClientMessage(playerid, 0xFFFFFFAA, str);
        return 1;
    }
    return 0;
}
Reply
#8

Still Doesn't Work!!! ?!?
Reply
#9

Quote:
Originally Posted by ◄=[•
WIll[•]=► ]
Still Doesn't Work!!! ?!?
Try this

pawn Код:
public OnPlayerText(playerid, text[])
{
  format(text, sizeof(text), "%s(%d): %s",GetPlayerNameEx(playerid), playerid, text);
  SendClientMessageToAll(0xFFFFFFAA, text);
  return 0; // Don't remove or change this.
}
Код:
stock GetPlayerNameEx(playerid)
{
  new string[MAX_PLAYER_NAME];
  GetPlayerName(playerid,string,24);
  return string;
}
Reply
#10

Or this.

pawn Код:
public OnPlayerText(playerid, text[]) // or what it is
{
   new string[128], pName[MAX_PLAYER_NAME];
   GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
   format(string, sizeof(string), "[%i]%s: %s", playerid, pName, text);
   SendClientMessageToAll(0xFFFFFF, string);
   return 1;
}
Something like that would work
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)