Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. //On top of your script:
  2. #define MAX_CHARS_PER_LINE 80
  3. #define FINAL_DOTS
  4.  
  5. //somewhere outside functions:
  6. stock sendLongMessage( playerid , color , message[] )
  7. {
  8. new len = strlen(message),
  9. _iL = len / MAX_CHARS_PER_LINE;
  10.  
  11. if( ( len % MAX_CHARS_PER_LINE ) ) _iL++;
  12. new _Line[MAX_CHARS_PER_LINE + 5];
  13.  
  14. new _:_i@Index;
  15. while( _i@Index < _iL )
  16. {
  17. if( _i@Index == 0 )
  18. strmid( _Line, message, ( _i@Index * MAX_CHARS_PER_LINE ), ( _i@Index * MAX_CHARS_PER_LINE ) + MAX_CHARS_PER_LINE );
  19. else
  20. strmid( _Line, message, ( _i@Index * MAX_CHARS_PER_LINE ), ( _i@Index * MAX_CHARS_PER_LINE ) + MAX_CHARS_PER_LINE );
  21.  
  22. #if defined FINAL_DOTS
  23. if( _iL > 1 )
  24. {
  25. if( _i@Index == 0 )
  26. {
  27. format( _Line, sizeof _Line, "%s ...", _Line );
  28. }
  29. else if( _i@Index > 0 && ( _i@Index + 1 ) < _iL )
  30. {
  31. format( _Line, sizeof _Line, "... %s ...", _Line );
  32. }
  33. else
  34. {
  35. format( _Line, sizeof _Line, "... %s", _Line );
  36. }
  37. }
  38. #endif
  39. ////////////
  40. SendClientMessage( playerid, color, _Line );
  41. ///////////
  42. _i@Index++;
  43. }
  44. return 1;
  45. }
  46. //Credits to Miki
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement