WPNiGGa

Rui Almeida Tradutor

Dec 7th, 2014
291
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.31 KB | None | 0 0
  1. #if defined RT_include
  2.     #endinput
  3. #endif
  4.  
  5. #define RT_include
  6.  
  7. //====================================
  8.  
  9. #if !defined _samp_included
  10.     #include <a_samp>
  11. #endif
  12.  
  13.  
  14. //====================================
  15.  
  16. #if !defined _dof2_included
  17.     #include <DOF2>
  18. #endif
  19.  
  20. //====================================
  21.  
  22. #if !defined FILE_DIRECTORY
  23.     #define FILE_DIRECTORY "langs/%s.ini"
  24. #endif
  25.  
  26. //====================================
  27. #if !defined formatText
  28.     #define formatText(%0,%1,%2) format(%0, sizeof %0, %1, %2)
  29. #endif
  30. //----------
  31. #define RT:: RT_
  32.  
  33. //====================================
  34.  
  35. /*
  36.     ####                ###
  37.     ####FORMAT DIRECTORY###
  38.     ####                ###
  39. */
  40. stock formatDirectory(rt_lang[])
  41. {
  42.     new file[50];
  43.     format(file, sizeof file, FILE_DIRECTORY, rt_lang);
  44.     return file;
  45. }
  46.  
  47.  
  48. stock RT_getText(rt_lang[], rt_key[])
  49. {
  50.     new rt_Trans[128];
  51.     if(DOF2_FileExists(formatDirectory(rt_lang)))
  52.     {
  53.        
  54.         rt_Trans = DOF2::GetString(formatDirectory(rt_lang), rt_key);
  55.     }
  56.     else rt_Trans = "";
  57.     return rt_Trans;
  58. }
  59.  
  60. stock RT_setText(rt_lang[], rt_key[], rt_text[])
  61. {
  62.     if(!DOF2::FileExists(formatDirectory(rt_lang)))
  63.         DOF2::CreateFile(formatDirectory(rt_lang));
  64.     DOF2::SetString(formatDirectory(rt_lang), rt_key, rt_text);
  65. }
Add Comment
Please, Sign In to add comment