SA-MP Forums Archive
[Help] With OnPlayerText - 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: [Help] With OnPlayerText (/showthread.php?tid=77207)



[Help] With OnPlayerText - [nl]daplayer - 09.05.2009

Hi people, I feel me like a noob right now asking this, but i want to ask for your help.

How do i add something at the end of the text ex.

"NoZer0: Hi! (2134)"

But then in standard sa-mp colors.
I thinks it's something about changing the text[] parameter in OnPlayerText
I tried a lot of things, like format, strins, strmid, but i think i did something wrong


Re: [Help] With OnPlayerText - Paladin - 09.05.2009


Is this what you mean:

Код:
public OnPlayerText(playerid, text[])
{
new string[128];
new pname[18];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "%s: %s (2134)", pname, text);
SendClientMessageToAll([COLOR_HERE], string);
return 0;
}
The return 0; is very important, without it it will allow you're original text to be said too.

It's not tested, so not sure if it works


Re: [Help] With OnPlayerText - Nubotron - 09.05.2009

Use the strcat and SendPlayerMessage


Re: [Help] With OnPlayerText - [nl]daplayer - 09.05.2009

Quote:
Originally Posted by Paladin
Is this what you mean:

Код:
public OnPlayerText(playerid, text[])
{
new string[128];
new pname[18];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "%s: %s (2134)", pname, text);
SendClientMessageToAll([COLOR_HERE], string);
return 0;
}
The return 0; is very important, without it it will allow you're original text to be said too.

It's not tested, so not sure if it works
I had that before, but then it's so boring because the chat is all the same color.

Quote:
Originally Posted by zozo
Use the strcat and SendPlayerMessage
Trying now :P

Both, thx for the reply on my question


Re: [Help] With OnPlayerText - Bodo4you - 09.05.2009

Код:
it's so boring because the chat is all the same color.
hmm maybe you could make random color dont know if its posible but just giving a suggestion:P


Re: [Help] With OnPlayerText - FUNExtreme - 09.05.2009

pawn Код:
SendPlayerMessageToAll
That function allows you to send a message while the player colour will stay the same in the chat.