OnPlayerText
#1

How to do that if the text is larger than player X, continue text in new line? is it possible?

sorry my bad english.
Reply
#2

Show "OnPlayerText"

I think you are asking about how to make it so players can write longer sentences in the chat...yes?
Reply
#3

No, I want to make for example the text of player is greater than 64 characters keep the rest on a new line, not to be all in one line.
Reply
#4

That's automatical. SA-MP breaks the line when needed.
Reply
#5

It's not automatic.. I don't actualy know how to do it but i know it's not automaticly, as i saw servers where if you write half line, it'll pass to the second one, while if i make a small string, text wont just show up, and if i make it big, it'll be gone in the screen, and bigger screens can see everything, small ones not.
Reply
#6

Quote:
Originally Posted by ricardo178
View Post
It's not automatic.. I don't actualy know how to do it but i know it's not automaticly, as i saw servers where if you write half line, it'll pass to the second one, while if i make a small string, text wont just show up, and if i make it big, it'll be gone in the screen, and bigger screens can see everything, small ones not.
Yes, I know, thanks for confirming, but unfortunately I do not know where to start :P
Reply
#7

use strmid, tried to make small code and tested it and worked.

pawn Code:
public OnPlayerText(playerid, text[])
{
    new pname[MAX_PLAYER_NAME], msg[256], partone[70], parttwo[70];
    GetPlayerName(playerid, pname, sizeof(pname));
   
    if(strlen(text) >= 64)
    {
        strmid(partone, text, 0, 64);
        strmid(parttwo, text, 64, strlen(text));
        format(msg, sizeof(msg), "%s[%i]:{FFFFFF} %s", pname, playerid, partone);
        SendClientMessageToAll(GetPlayerColor(playerid), msg);
        SendClientMessageToAll(-1, parttwo);
    }
    else
    {
        format(msg, sizeof(msg), "%s[%i]:{FFFFFF} %s", pname, playerid, text);
        SendClientMessageToAll(GetPlayerColor(playerid), msg);
    }
    return 0;
}
Reply
#8

thank you guy! ^^

-
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)