Advertisement
Guest User

Untitled

a guest
May 25th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.12 KB | None | 0 0
  1. void Credit_StartAnimation(int client, int index) {
  2.     int iPrize;
  3.     if(gI_ProfitChance != -1) {
  4.         switch(gI_ProfitChance) {
  5.             case 0: { iPrize = GetRandomInt(gI_C_MinMax[client][0], gI_C_NormalPrice[index]); }
  6.             case 100:  { iPrize = GetRandomInt(gI_C_NormalPrice[index], gI_C_MinMax[client][1]); }
  7.             default: {
  8.                 int iChance = GetRandomInt(0, 100);
  9.                 if(iChance <= gI_ProfitChance) { iPrize = GetRandomInt(gI_C_NormalPrice[index], gI_C_MinMax[client][1]); } // Profit
  10.                 else { iPrize = GetRandomInt(gI_C_MinMax[client][0], gI_C_NormalPrice[index]); } // Lose
  11.             }
  12.         }
  13.     } else {
  14.         iPrize = GetRandomInt(gI_C_MinMax[client][0] ,gI_C_MinMax[client][1]);
  15.     }
  16.  
  17.     int iTempPrize = iPrize ,PermLength;
  18.     char sPrize[50], sDisplay;
  19.     IntToString(iPrize, sPrize, sizeof(sPrize));
  20.     PermLength = strlen(sPrize);
  21.  
  22.     for(int i = 0; i < PermLength; i++) {
  23.         while(gH_AnimationTimer[client] != INVALID_HANDLE) {
  24.             if(gH_AnimationTimer[client] == INVALID_HANDLE) {
  25.                 continue;
  26.             }
  27.         }
  28.  
  29.         // Getting the number lenght
  30.         char GetNumberLength[50];
  31.         IntToString(iTempPrize, GetNumberLength, sizeof(GetNumberLength));
  32.         float Length = view_as<float>(strlen(GetNumberLength) - 1); // Doing view_as to remove the tag mismatch.
  33.        
  34.         // Gettting the first number in int & convering it to string
  35.         int iFirstNum = iTempPrize % view_as<int>(Pow(10.0, Length)); // Doing view_as to remove the tag mismatch.
  36.         char sFirstNum[2];
  37.         IntToString(iFirstNum, sFirstNum, sizeof(sFirstNum));
  38.  
  39.         ReplaceStringEx(sDisplay, sizeof(sDisplay), sFirstNum, "# ", _, _, false); // keep replacing # with random symbols
  40.  
  41.         for(int j = 0; i <= 9; i++) {
  42.             char sNum[2];
  43.             ReplaceString(sDisplay, sizeof(sDisplay), sNum, "_ ", false);
  44.         }
  45.  
  46.         DataPack dpHack = new DataPack();
  47.         dpHack.WriteCell(client);
  48.         dpHack.WriteString();
  49.        
  50.         CreateTimer(fTimeForLetter, AnimationTimer_GotoNextLetter, client); // Kills the repeat timer
  51.         gH_AnimationTimer[client] = CreateTimer(0.1, ActionTimer_Hack, dphack, TIMER_REPEAT);
  52.  
  53.         // Update the number
  54.         iTempPrize = iTempPrize / view_as<int>(Pow(10.0, Length)); // Doing view_as to remove the tag mismatch.
  55.     }
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement