15.04.2015, 17:22
(
Последний раз редактировалось Nero_3D; 16.04.2015 в 17:50.
)
Way to complicated
You could also use the "split" function or sscanf with p<\n> (if that works) although this /\ is probably the fastest version
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;
}