[Help] With OnPlayerText
#1

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
Reply
#2


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
Reply
#3

Use the strcat and SendPlayerMessage
Reply
#4

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
Reply
#5

Код:
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
Reply
#6

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


Forum Jump:


Users browsing this thread: 1 Guest(s)