SA-MP Forums Archive
ID next to players name - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: ID next to players name (/showthread.php?tid=100428)



ID next to players name - MB@ - 04.10.2009

how can i make that it shows the id next to player names

example:

Someone[1] : hello


I looked all over for this but i cant find it.


Re: ID next to players name - Jamesy - 04.10.2009

If you want the id next to the name you cant have the name as a seperate color.
pawn Код:
public OnPlayerText(playerid, text[])
{
  new name[MAX_PLAYER_NAME];
  new string[144];
  GetPlayerName(playerid, name, sizeof(name));
  format(string, sizeof(string), "%s[%d] : %s", name, playerid, text);
  SendClientMessageToAll(string);
  return 0;
}



Re: ID next to players name - MB@ - 04.10.2009

Uum it wont work

Код:
public OnPlayerText(playerid, text[])
{
  new name[MAX_PLAYER_NAME];
  new string[144];
  GetPlayerName(playerid, name, sizeof(name));
  format(string, sizeof(string), "%s[%d] : %s", name, playerid, text);
  SendClientMessageToAll(string);
  return 0;
}
Код:
C:\Documents and Settings\Administrator\Desktop\Samp-server\gamemodes\Stunt-World.pwn(146) : error 035: argument type mismatch (argument 1)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.



Re: ID next to players name - dice7 - 04.10.2009

pawn Код:
new textstring[2][MAX_PLAYER_NAME];
GetPlayerName(playerid,textstring[0],sizeof(textstring[]));
GetPlayerName(playerid,textstring[1],sizeof(textstring[]));
format(textstring[0],sizeof(textstring[]),"[%d]%s",playerid,textstring[0]);
SetPlayerName(playerid,textstring[0]);
SendPlayerMessageToAll(playerid,text);
SetPlayerName(playerid,textstring[1]);