Advertisement
Meta__

Converting Umlauts

Oct 13th, 2011
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.01 KB | None | 0 0
  1. forward TextDrawSetStringEx(Text:text, string[]);
  2. public TextDrawSetStringEx(Text:text, string[])
  3. {
  4.     new string2[256]; format(string2, sizeof(string2), "%s", string); // you know, sometimes there's a error if using a string from the parameters to edit in a function ...
  5.     ConvertUmlauts(string2);
  6.     return TextDrawSetString(text, string2);
  7. }
  8. #if defined _ALS_TextDrawSetString
  9.     #undef TextDrawSetString
  10. #else
  11.     #define _ALS_TextDrawSetString
  12. #endif
  13. #define TextDrawSetString TextDrawSetStringEx
  14.  
  15. forward GameTextForPlayerEx(playerid, const string[], time, style);
  16. public GameTextForPlayerEx(playerid, const string[], time, style)
  17. {
  18.     new string2[256]; format(string2, sizeof(string2), "%s", string);
  19.     ConvertUmlauts(string2);
  20.     return GameTextForPlayer(playerid, string2, time, style);
  21. }
  22. #if defined _ALS_GameTextForPlayer
  23.     #undef GameTextForPlayer
  24. #else
  25.     #define _ALS_GameTextForPlayer
  26. #endif
  27. #define GameTextForPlayer GameTextForPlayerEx
  28.  
  29. forward GameTextForAllEx(const string[], time, style);
  30. public GameTextForAllEx(const string[], time, style)
  31. {
  32.     new string2[256]; format(string2, sizeof(string2), "%s", string);
  33.     ConvertUmlauts(string2);
  34.     return GameTextForAll(string2, time, style);
  35. }
  36. #if defined _ALS_GameTextForAll
  37.     #undef GameTextForAll
  38. #else
  39.     #define _ALS_GameTextForAll
  40. #endif
  41. #define GameTextForAll GameTextForAllEx
  42.  
  43. forward Text:TextDrawCreateEx(Float:x,Float:y, const text[]);
  44. public Text:TextDrawCreateEx(Float:x,Float:y, const text[])
  45. {
  46.     new string2[256]; format(string2, sizeof(string2), "%s", text);
  47.     ConvertUmlauts(string2);
  48.     return TextDrawCreate(x,y,string2);
  49. }
  50. #if defined _ALS_TextDrawCreate
  51.     #undef TextDrawCreate
  52. #else
  53.     #define _ALS_TextDrawCreate
  54. #endif
  55. #define TextDrawCreate TextDrawCreateEx
  56.  
  57.  
  58.  
  59. forward ConvertUmlauts(string[]);
  60. public ConvertUmlauts(string[])
  61. {
  62.     strrep(string, "Ä", "ƒ"); strrep(string, "ä", "š");
  63.     strrep(string, "Ö", "‘"); strrep(string, "ö", "¨");
  64.     strrep(string, "Ü", "•"); strrep(string, "ü", "¬");
  65.     strrep(string, "ß", "–");
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement