Advertisement
MatnixSCRIPT

[FONCTION] fix_Caracter(str); // Fixer vos caractères.

Oct 2nd, 2013
346
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.46 KB | None | 0 0
  1. /*------------------------------------------------------------------------------
  2. ================================================================================
  3. --------------------------------------------------------------------------------
  4.  
  5.                F I X E R V O S         •           C A R A C T E R E S
  6.                               \____by Matnix____/
  7.  
  8. Informations : Grâce à ce script vous pourrez désormais écrire vos texte en toute
  9.                tranquillité. C'est à dire, comme vous l'aurez déjà remarqué en
  10.                ajoutant des accents à votre texte vous avez des caractères un peu
  11.                bizzard non.
  12.                
  13. * FIX DES ACCENTS POUR LES FONCTIONS :  - GameTextForPlayer
  14.                                         - TextDrawCreate
  15.  
  16. [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ C R E D I T S ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
  17.  Matnix, Matnix, Matnix, Matnix, Matnix, Matnix, Matnix, Matnix, Matnix, Matnix,
  18.  Kalcor, Kalcor, Kalcor, Kalcor, Kalcor, Kalcor, Kalcor, Kalcor, Kalcor, Kalcor.
  19. --------------------------------------------------------------------------------
  20. ================================================================================
  21.   192 = À - 199 = Ç - 200 = È - 201 = É - 202 = Ê - 203 = Ë- 207 =Ï - 217 = Ù
  22.   219 = Û - 220 = Ü - 224 = à - 226 = â - 231 = ç - 232 = è - 233 = é - 234 = ê
  23.   235 = ë - 238 = î - 239 = ï - 249 = ù - 250 = ú - 251 = û - 252 = ü - 253 = ý
  24. --------------------------------------------------------------------------------
  25.  
  26. --------------------------------------------------------------------------------*/
  27. #include <a_samp>
  28. new Text:Texte;
  29. /*------------------------------------------------------------------------------
  30.  
  31. --------------------------------------------------------------------------------*/
  32. public OnGameModeInit()
  33. {
  34. // Exemple d'utilisation pour des TextDraw.
  35.     new str[56];
  36.     strcat(str,"À Ç È É Ê Ë Ï Ù", 56);
  37.     fix_Caracter(str);
  38.    
  39.     Texte = TextDrawCreate(147.200088, 274.773284, str);
  40.     TextDrawLetterSize(Texte, 0.210000, 1.256533);
  41.     TextDrawAlignment(Texte, 1);
  42.     TextDrawColor(Texte, -1);
  43.     TextDrawSetShadow(Texte, 0);
  44.     TextDrawSetOutline(Texte, 1);
  45.     TextDrawBackgroundColor(Texte, 51);
  46.     TextDrawFont(Texte, 1);
  47.     return 1;
  48. }
  49. /*------------------------------------------------------------------------------
  50.  
  51. --------------------------------------------------------------------------------*/
  52. public OnPlayerConnect(playerid)
  53. {
  54. // Exemple d'utilisation pour des GameText.
  55.     new str[64];
  56.     format(str, sizeof(str), "À Ç È É Ê Ë Ï Ù");
  57.     GameTextForPlayer(playerid, str, 5000, 3);
  58.     fix_Caracter(str);
  59.     return 1;
  60. }
  61. /*------------------------------------------------------------------------------
  62.  
  63. --------------------------------------------------------------------------------*/
  64. stock fix_Caracter(string[])
  65. {
  66.     new coriginal[22] = {192, 199, 200, 201, 202, 203, 207, 217, 219, 220, 224, 226, 231, 232, 233, 234, 235, 238, 239, 249, 251, 252};
  67.     new cconvertis[22] = {128, 133, 134, 135, 136, 137, 141, 146, 148, 149, 151, 153, 156, 157, 158, 159, 160, 163, 164, 169, 171, 172};
  68.     new len = strlen(string);
  69.     for (new i; i < len; i++)
  70.     {
  71.         for(new j;j < 22;j++)
  72.         {
  73.             if(string[i] == coriginal[j])
  74.             {
  75.                 string[i] = cconvertis[j];
  76.                 break;
  77.             }
  78.         }
  79.     }
  80. }
  81. /*------------------------------------------------------------------------------
  82.   Voilà, merci de garder les crédits. Aller amusez-vous bien la communauté FR.
  83. -------------------------------------------------------------------------------*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement