How To make ID Show on Chat
#1

How do you make an id show beside the person whos talking to you ?.
Reply
#2

i dont knnow how to explain it
Quote:

if(strcmp(cmd, "/ooc", true) == 0 || strcmp(cmd, "/o", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " You havent logged in yet !");
return 1;
}
if ((noooc) && PlayerInfo[playerid][pAdmin] < 1)
{
SendClientMessage(playerid, COLOR_GRAD2, " The OOC channel has been disabled by an Admin !");
return 1;
}
if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, " You can't speak, you have been silenced !");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/o)oc [ooc chat]");
return 1;
}
format(string, sizeof(string), "%s[ID:%d]: %s ", sendername,playerid,result);
OOCOff(COLOR_LIGHTBLUE,string);
printf("%s", string);
}
return 1;
}

its OOC chat

if u add this format(string, sizeof(string), "%s[ID:%d]: %s ", sendername,playerid,result);

it would be like Name,[ID] : and what he/she writed
Reply
#3

Thanks , but i meant like on normal chat, so they don't use a command to talk
Reply
#4

pawn Код:
public OnPlayerText(playerid, text[])
{
  new playername[MAX_PLAYER_NAME];
  GetPlayerName(playerid,playername,sizeof(playername));
  new string[128];
  format(string,sizeof(string),"[%d] %s",playerid,text);
  SendPlayerMessageToAll(playerid, string);
  return 0;
}
Reply


Forum Jump:


Users browsing this thread: