Text wrap fault. Something I am missing?
#1

Hey ahh, I have obviously done something wrong with this.

pawn Код:
public OnPlayerText(playerid, text[])
{
    new chat[200];
    new chat2[100];
        if(Rararararar) <- Ignore this
        else format(chat,sizeof(chat), "%s says: %s", GetPlayerNameEx(playerid), text);
        {
        ProximityMessage(playerid, 15, chat, LOCAL_1, LOCAL_2, LOCAL_3, LOCAL_4, LOCAL_5);
        strmid(chat2,text,100,200);
        ProximityMessage(playerid, 15, chat2, LOCAL_1, LOCAL_2, LOCAL_3, LOCAL_4, LOCAL_5);
I have tried
pawn Код:
strmid(chat2,chat,100,200);
Result. (Creepy echo)
Reply
#2

Change 100 to 128.
Reply
#3

Hmm.... Not 100% how that will help fix my problem by the string not being sent

At the moment the last few words on something you type is getting repeated on the second line.

I want the string 'chat' to be separated into 2 strings, 'chat and 'chat2'. 'chat' displayed on the first line with the name in it and from about 100 characters into when the player has input I want it to be cut off and then sent on the second like

For example(using the text from the picture above.)
"Dean Porter says: Testign chat because i think that it is f**ked and it isn't gonna work but we'll"
"soon see, it should be interesting haha lol"

This being the string called 'chat'
"Dean Porter says: Testign chat because i think that it is f**ked and it isn't gonna work but we'll"

and this being the string called 'chat2'
"soon see, it should be interesting haha lol"

If you get what I am trying to say.

This is what I have at the moment:
pawn Код:
public OnPlayerText(playerid, text[])
{
    if( <----- Ignore this
    else format(chat,sizeof(chat), "%s says: %s", GetPlayerNameEx(playerid), text);
    ProximityMessage(playerid, 15, chat, LOCAL_1, LOCAL_2, LOCAL_3, LOCAL_4, LOCAL_5);
    strmid(chat2,chat,128,200);
    ProximityMessage(playerid, 15, chat2, LOCAL_1, LOCAL_2, LOCAL_3, LOCAL_4, LOCAL_5);
}
Cheers in advance.
Reply
#4

pawn Код:
strmid(chat2,chat,128,200);
chat[128] = '\0';
Reply
#5

Like so?
pawn Код:
public OnPlayerText(playerid, text[])
{
    if( <----- Ignore this
    else format(chat,sizeof(chat), "%s says: %s", GetPlayerNameEx(playerid), text);
    ProximityMessage(playerid, 15, chat, LOCAL_1, LOCAL_2, LOCAL_3, LOCAL_4, LOCAL_5);
    strmid(chat2,chat,128,200);
    chat[128] = '\0';
    ProximityMessage(playerid, 15, chat2, LOCAL_1, LOCAL_2, LOCAL_3, LOCAL_4, LOCAL_5);
}
If so, would you mind briefly describing what this is doing?
Cheers mate. Greatly appreciated if you could.

[EDIT]
I just tested this and the same error is occuring, instead of placing half of the string in the second chat it repeats the last 10-20 characters. from what was displayed in chat 1

Sorry, hope it's not too confusing.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)