Advertisement
Guest User

Untitled

a guest
Feb 24th, 2020
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. removeAccent(c) {
  2. static const ACCENTS[] = "ÀÁÂÃÄÅàáâãäåÒÓÔÕÕÖØòóôõöøÈÉÊËèéêëðÇçÐÌÍÎÏìíîïÙÚÛÜùúûüÑñŠšŸÿýŽž";
  3. static const NON_ACCENTS[] = "AAAAAAaaaaaaOOOOOOOooooooEEEEeeeeeCcDIIIIiiiiUUUUuuuuNnSsYyyZz";
  4.  
  5. for (new i = strlen(ACCENTS) - 1; i >= 0; i--) {
  6. if (c == ACCENTS[i]) {
  7. c = NON_ACCENTS[i];
  8. break;
  9. }
  10. }
  11. return c;
  12. }
  13.  
  14. strRemoveAccent(const source[], dest[], len = sizeof(dest)) {
  15. for (new i = len - 1; i >= 0; i--) {
  16. dest[i] = removeAccent(source[i]);
  17. }
  18. }
  19.  
  20. SendClientMessageToAllAndroid(color, const text[]) {
  21. new strAccents[256];
  22. for(new x = 0, j = GetPlayerPoolSize(); x <= j; x++) {
  23. if(IsPlayerInAndroid(x)) {
  24. strRemoveAccent(text, strAccents);
  25. SendClientMessageAndroid(x, color, strAccents);
  26. }
  27. else {
  28. SendClientMessageAndroid(x, color, text);
  29. }
  30. }
  31. return 1;
  32. }
  33.  
  34. SendClientMessageAndroid(playerid, color, const text[]) {
  35. new strAccents[256];
  36. if(IsPlayerInAndroid(playerid)) {
  37. strRemoveAccent(text, strAccents);
  38. SendClientMessage(playerid, color, strAccents);
  39. }
  40. else {
  41. SendClientMessage(playerid, color, text);
  42. }
  43. return 1;
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement