multilines.inc 912 B

123456789101112131415161718192021222324252627282930313233343536
  1. /* Multi text lines include
  2. Version: 1.0
  3. Date: 2010-03-18
  4. Credits: KuHS
  5. What it do?
  6. It transfers string's text into two lines.
  7. What it used for?
  8. It's used for RolePlay servers. Basically most RP servers have /me /do /b commands.
  9. This function can transfer typed command text into multiple lines.
  10. */
  11. #include <a_samp>
  12. forward SendClientMessageA(playerid,color,text[]);
  13. public SendClientMessageA(playerid,color,text[])
  14. {
  15. new safetxt[256];
  16. format(safetxt,sizeof(safetxt),"%s",text);
  17. if(strlen(safetxt) <= 100) { SendClientMessage(playerid,color,text); }
  18. else {
  19. new line1[128],
  20. line2[160];
  21. strmid(line1,safetxt,0,100);
  22. strmid(line2,safetxt,100,256);
  23. format(line1, sizeof(line1), "%s...", line1);
  24. format(line2, sizeof(line2), "...%s", line2);
  25. SendClientMessage(playerid,color,line1);
  26. SendClientMessage(playerid,color,line2);
  27. }
  28. }