chat help - 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)
+--- Thread: chat help (
/showthread.php?tid=632531)
chat help -
silverms - 15.04.2017
hey I have this code here
PHP код:
if (PlayerIgnored[i][playerid] == 0) SendPlayerMessageToPlayer(i, playerid, text);
this send the player message when he type like this Silver:balabla but I need it to send it like this Silver[id]:ballala and idk how to do it can anyone help me?
Re: chat help -
DarkSkull - 15.04.2017
PHP код:
new string[128], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string),"%s[%i]: %s", name, playerid, text);
if (PlayerIgnored[i][playerid] == 0) SendPlayerMessageToPlayer(i, playerid, string);
Re: chat help -
silverms - 15.04.2017
now it sends it like Silver:Silver[id]:bala;
Re: chat help -
DarkSkull - 15.04.2017
That's because You have a custom function to send the message. Can you show the SendPlayerMessageToPlayer Function?
Re: chat help -
silverms - 15.04.2017
I don't have custom
function
Re: chat help -
silverms - 15.04.2017
i made this but it doesn't getplayercolor correctly
PHP код:
new ptext[256], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(ptext, sizeof(ptext), "{%d}%s[%d]:{FFFFFF} %s",GetPlayerColor(playerid), pname, playerid, text);
if (PlayerIgnored[i][playerid] == 0) SendClientMessage(i ,COLOR_WHITE,ptext);
Re: chat help -
DarkSkull - 15.04.2017
For the first part:
PHP код:
new string[128], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string),"%s[%i]: %s", name, playerid, text);
if (PlayerIgnored[i][playerid] == 0) SendClientMessage(i, COLOR_WHITE, string);
For the get player colour:
PHP код:
new ptext[256], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(ptext, sizeof(ptext), "{%06x}%s[%d]:{FFFFFF} %s", GetPlayerColor(playerid) >>> 8, pname, playerid, text);
if (PlayerIgnored[i][playerid] == 0) SendClientMessage(i ,COLOR_WHITE,ptext);
Re: chat help -
silverms - 15.04.2017
thanks +rep