Advertisement
Guest User

Untitled

a guest
May 16th, 2016
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.61 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. public OnFilterScriptInit()
  4. {
  5.     printf("strMix(Pawno.pl) = %s", strMix("Pawno.pl"));
  6.     printf("strMix(Pawno.pl) = %s", strMix("Pawno.pl"));
  7.     printf("strMix(Pawno.pl) = %s", strMix("Pawno.pl"));
  8.     return 1;
  9. }
  10.  
  11.  
  12. #define MAX_MIX_STRING 128
  13. stock strMix(string[])
  14. {
  15.     new str2[MAX_MIX_STRING];
  16.     if(strlen(string) < MAX_MIX_STRING)
  17.     {
  18.         new i = strlen(string) - 1;
  19.         new str3[MAX_MIX_STRING];
  20.         new rand;
  21.  
  22.         strcat(str3, string);
  23.         while(i >= 0)
  24.         {
  25.             rand = random(strlen(str3));
  26.             str2[i] = str3[rand];
  27.             strdel(str3, rand, rand + 1);
  28.             i--;
  29.         }
  30.     }
  31.     return str2;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement