Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define MAX_CHARS_PER_LINE 128
- #define FINAL_DOTS
- stock SendSplitMsg(const player, const color, const message[])
- {
- if(!IsPlayerConnected(player))
- return INVALID_PLAYER_ID;
- new numLines = strlen(message) / MAX_CHARS_PER_LINE;
- if(strlen(message) % MAX_CHARS_PER_LINE)
- numLines++;
- for(new index = 0; index < numLines; ++index)
- {
- new line[MAX_CHARS_PER_LINE + 5 + 5];
- strmid(line, message, (index * MAX_CHARS_PER_LINE), (index * MAX_CHARS_PER_LINE) + MAX_CHARS_PER_LINE);
- #if defined FINAL_DOTS
- if(numLines > 1)
- {
- if(!index)
- {
- strins(line, " ...", strlen(line));
- }
- else if((index + 1) < numLines)
- {
- strins(line, " ...", strlen(line));
- strins(line, "... ", 0);
- }
- else
- {
- strins(line, "... ", 0);
- }
- }
- #endif
- SendClientMessage(player, color, line);
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement