Jump to content

[Tutorial] Casino - Roulette


gustavseitztestarma3

Recommended Posts

PreviewClick

Instruction:

Author: ChoseN

Open your dialog\MasterHandler.hpp and add:

#include "roulette.hpp"

Open your description.ext and under CfgSounds add:

class casino_win {        
  name = "casino_win";        
  sound[] = {"\sounds\casino_win.ogg", 1.0, 1};        
  titles[] = {};    
};

class casino_lose {        
  name = "casino_lose";        
  sound[] = {"\sounds\casino_lose.ogg", 1.0, 1};        
  titles[] = {};    
};

class roulette_spin {        
  name = "roulette_spin";        
  sound[] = {"\sounds\roulette_spin.ogg", 1.0, 1};        
  titles[] = {};    
};

Open your Functions.hpp and add under Life_Client_Core:

    class Roulette {
        file = "core\casino\roulette";
        class roulette {};
        class startRoulette {};
        class rouletteChangePos {};
        class roulettePayout {};
    };

Object Init:

this enableSimulation false; this allowDamage false; this addAction["Play Roulette",life_fnc_roulette,"",1.5,true,true,"","true",5];

Make sure you have the following class in your common.hpp:

class Life_RscButtonInvisible
{
    style = 2;
    type = 16;
    x = 0;
    y = 0;
    w = 0.095589;
    h = 0.039216;
    shadow = 2;
    font = "PuristaMedium";
    colorText[] = {1,1,1,0.0};
    color[] = {1, 1, 1, 0.0};
    colorDisabled[] = {1, 1, 1, 0};
    color2[] = {0,0,0,0};
    colorBackground[] = {1, 1, 1, 0};
    colorBackgroundActive[] = {1, 1, 1, 0};
    colorBackgroundDisabled[] = {1, 1, 1, 0};
    colorFocused[] = {1, 1, 1, 0};
    colorShadow[] = {1, 1, 1, 0};
    animTextureNormal = "#(argb,8,8,3)color(1,1,1,0)";
    animTextureDisabled = "#(argb,8,8,3)color(1,1,1,0)";
    animTextureOver = "#(argb,8,8,3)color(1,1,1,0)";
    animTextureFocused = "#(argb,8,8,3)color(1,1,1,0)";
    animTexturePressed = "#(argb,8,8,3)color(1,1,1,0)";
    animTextureDefault = "#(argb,8,8,3)color(1,1,1,0)";
    colorBackgroundFocused[] = {1,1,1,0};
    colorBackground2[] = {0.75,0.75,0.75,0};
    offsetX = 0.003;
    offsetY = 0.003;
    offsetPressedX = 0.002;
    offsetPressedY = 0.002;
    SizeEx = "(            (            (            ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8)";
    size = "(            (            (            ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1.2)";    
    borderSize = 0.0;
    soundEnter[] = {"\A3\ui_f\data\sound\RscButton\soundEnter",0.09,1};
    soundPush[] = {"\A3\ui_f\data\sound\RscButton\soundPush",0.09,1};
    soundClick[] = {"\A3\ui_f\data\sound\RscButton\soundClick",0.09,1};
    soundEscape[] = {"\A3\ui_f\data\sound\RscButton\soundEscape",0.09,1};
    class HitZone
    {
        left = 0.0;
        top = 0.0;
        right = 0.0;
        bottom = 0.0;
    };
    class TextPos
    {
        left = "0.25 *             (            ((safezoneW / safezoneH) min 1.2) / 40)";
        top = "(            (            (            ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) -         (            (            (            ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)) / 2";
        right = 0.005;
        bottom = 0.0;
    };
    class Attributes
    {
        font = "PuristaLight";
        color = "#E5E5E5";
        align = "left";
        shadow = "0";
    };
    class ShortcutPos
    {
        left = "(6.25 *             (            ((safezoneW / safezoneH) min 1.2) / 40)) - 0.0225 - 0.005";
        top = 0.005;
        w = 0.0225;
        h = 0.03;
    };
    textureNoShortcut = "";
};

 

File

Edited by gustavseitztestarma3
changed hint - updated file attached
  • Like 2
  • Thanks 1
Link to comment
Share on other sites

  • 1 month later...
  • 2 weeks later...

Open your description.ext and under CfgSounds add:

    class casino_win {        
        name = "casino_win";        
        sound[] = {"\sounds\casino_win.ogg", 1.0, 1};        
        titles[] = {};    
    };
    
    class casino_lose {        
        name = "casino_lose";        
        sound[] = {"\sounds\casino_lose.ogg", 1.0, 1};        
        titles[] = {};    
    };
    
    class roulette_spin {        
        name = "casino_lose";        
        sound[] = {"\sounds\carUnlock.ogg", 1.0, 1};        
        titles[] = {};    
    };

Link to comment
Share on other sites

  • 11 months later...

Thanks for sharing this tutorial on the Casino-Roulette preview. It seems like a pretty interesting feature to add to a game. I'll definitely give it a try if I get a chance to play the game.  It's pretty cool that you've shared some instructions on how to add this feature to the game. I'm not much of a coder myself, but I'm sure there are plenty of people who would find these instructions useful. Also, check out w88oaz.com, a cool website. I'm not much of a gambler myself, but I can see how people who enjoy playing casino games might find it appealing. And this website is amazing for making money.

Edited by xxsylasxx
  • Like 1
Link to comment
Share on other sites

  • 2 months later...
  • 3 months later...

The detail in your instructions is superb, really great for people who want to dive into the more technical aspects of game customization. Adding a roulette element definitely brings a unique spin to the casino experience, no pun intended! And since we're talking about gaming experiences, if any of you are into online betting or casino games outside of your development endeavors, you might want to check out Slot Gacor. They offer a variety of games and sports to bet on, similar to the immersive atmosphere you're creating here. Anyway, a year has passed since this thread started. Has anyone implemented this or made any modifications? Would love to know how it's going for you all!

Edited by Buffinto
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.