Send message from string with \n
#5

Quote:
Originally Posted by ATGOggy
Посмотреть сообщение
PHP код:
// CODE 
I didn't test it yet.
Way to complicated
pawn Код:
public OnPlayerText(playerid, text[]) {
    new
        idx
    ;
    if((idx = strfind(text, \"\n", true)) != -1) {
        new
            start = 0
        ;
        do {
            text[idx + start] = EOS;

            SendPlayerMessageToAll(playerid, text[start]);

            start += idx + 2;
        } while((idx = strfind(text[start], \"\n", true)) != -1);

        SendPlayerMessageToAll(playerid, text[start]);
        return false;
    }
    return true;
}
You could also use the "split" function or sscanf with p<\n> (if that works) although this /\ is probably the fastest version
Reply


Messages In This Thread
Send message from string with \n - by Banditukas - 15.04.2015, 13:59
Re: Send message from string with \n - by ATGOggy - 15.04.2015, 14:11
Re: Send message from string with \n - by BroZeus - 15.04.2015, 14:29
Re: Send message from string with \n - by ATGOggy - 15.04.2015, 14:31
AW: Re: Send message from string with \n - by Nero_3D - 15.04.2015, 17:22
Re: Send message from string with \n - by Banditukas - 15.04.2015, 18:01
Re: Send message from string with \n - by Yashas - 15.04.2015, 18:34
Re: Send message from string with \n - by Banditukas - 15.04.2015, 18:42
Re: Send message from string with \n - by Azula - 15.04.2015, 18:51

Forum Jump:


Users browsing this thread: 3 Guest(s)