Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Credit_StartAnimation(int client, int index) {
- int iPrize;
- if(gI_ProfitChance != -1) {
- switch(gI_ProfitChance) {
- case 0: { iPrize = GetRandomInt(gI_C_MinMax[client][0], gI_C_NormalPrice[index]); }
- case 100: { iPrize = GetRandomInt(gI_C_NormalPrice[index], gI_C_MinMax[client][1]); }
- default: {
- int iChance = GetRandomInt(0, 100);
- if(iChance <= gI_ProfitChance) { iPrize = GetRandomInt(gI_C_NormalPrice[index], gI_C_MinMax[client][1]); } // Profit
- else { iPrize = GetRandomInt(gI_C_MinMax[client][0], gI_C_NormalPrice[index]); } // Lose
- }
- }
- } else {
- iPrize = GetRandomInt(gI_C_MinMax[client][0] ,gI_C_MinMax[client][1]);
- }
- int iTempPrize = iPrize ,PermLength;
- char sPrize[50], sDisplay;
- IntToString(iPrize, sPrize, sizeof(sPrize));
- PermLength = strlen(sPrize);
- for(int i = 0; i < PermLength; i++) {
- while(gH_AnimationTimer[client] != INVALID_HANDLE) {
- if(gH_AnimationTimer[client] == INVALID_HANDLE) {
- continue;
- }
- }
- // Getting the number lenght
- char GetNumberLength[50];
- IntToString(iTempPrize, GetNumberLength, sizeof(GetNumberLength));
- float Length = view_as<float>(strlen(GetNumberLength) - 1); // Doing view_as to remove the tag mismatch.
- // Gettting the first number in int & convering it to string
- int iFirstNum = iTempPrize % view_as<int>(Pow(10.0, Length)); // Doing view_as to remove the tag mismatch.
- char sFirstNum[2];
- IntToString(iFirstNum, sFirstNum, sizeof(sFirstNum));
- ReplaceStringEx(sDisplay, sizeof(sDisplay), sFirstNum, "# ", _, _, false); // keep replacing # with random symbols
- for(int j = 0; i <= 9; i++) {
- char sNum[2];
- ReplaceString(sDisplay, sizeof(sDisplay), sNum, "_ ", false);
- }
- DataPack dpHack = new DataPack();
- dpHack.WriteCell(client);
- dpHack.WriteString();
- CreateTimer(fTimeForLetter, AnimationTimer_GotoNextLetter, client); // Kills the repeat timer
- gH_AnimationTimer[client] = CreateTimer(0.1, ActionTimer_Hack, dphack, TIMER_REPEAT);
- // Update the number
- iTempPrize = iTempPrize / view_as<int>(Pow(10.0, Length)); // Doing view_as to remove the tag mismatch.
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement