SA-MP Forums Archive
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] == 0SendPlayerMessageToPlayer(iplayeridtext); 
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(playeridnamesizeof(name));
format(stringsizeof(string),"%s[%i]: %s"nameplayeridtext);
if (
PlayerIgnored[i][playerid] == 0SendPlayerMessageToPlayer(iplayeridstring); 



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(playeridpnamesizeof(pname));
                
format(ptextsizeof(ptext), "{%d}%s[%d]:{FFFFFF} %s",GetPlayerColor(playerid), pnameplayeridtext);
                if (
PlayerIgnored[i][playerid] == 0SendClientMessage(,COLOR_WHITE,ptext); 



Re: chat help - DarkSkull - 15.04.2017

For the first part:
PHP код:
new string[128], name[MAX_PLAYER_NAME];
GetPlayerName(playeridnamesizeof(name));
format(stringsizeof(string),"%s[%i]: %s"nameplayeridtext);
if (
PlayerIgnored[i][playerid] == 0SendClientMessage(iCOLOR_WHITEstring); 
For the get player colour:

PHP код:
new ptext[256], pname[MAX_PLAYER_NAME];
GetPlayerName(playeridpnamesizeof(pname));
format(ptextsizeof(ptext), "{%06x}%s[%d]:{FFFFFF} %s"GetPlayerColor(playerid) >>> 8pnameplayeridtext);
if (
PlayerIgnored[i][playerid] == 0SendClientMessage(,COLOR_WHITE,ptext); 



Re: chat help - silverms - 15.04.2017

thanks +rep