FallingSheep

Sheep's Slotmachine v4

35 posts in this topic

hey guys thought id share my slotmachine with you all, now on to the dirty work :P 

VIDEO COMING SOON!

ok  for it to work correctly you MUST have have this installed first or the poptabs wont save after relog/restart

Update Respect/Poptabs and save to database by @happydayz

UPDATED V4 - another exploit fixed

special thanks to @Tuna for testing and bug finding :)

DOWNLOAD - http://www.mediafire.com/download/obo45v7ulkzbb6s/slot_machinev4.zip

1. Extract the Scripts and Pictures folder's into your mpmission folder from the zip file

2. open your description.ext and add this to the very bottom

//Slot Machine
#include"Scripts\slotmachine\slots.hpp"

3.  you can change the chance of winning by editing BOTH open_dialog and slots.sqf

 

changing this line

SlotsWinChance = random 100;

if the random number is greater than 90 players will win  
if you set the chance lower than 90 players CANT win!

Examples
SlotWinChance = random 100;    -  10% chance to win
SlotWinChance = random 90;    -  1% chance to win
 

4.  you call the slotmachine using

[] execVM "Scripts\SlotMachine\open_dialog.sqf";

 

example: if your using XM8apps add it like so
 

//App 1 
_app1Text = "Slot Machine";
_app1Logo = "";
app1_action = {
	[] execVM "Scripts\SlotMachine\open_dialog.sqf";
};

 

5. you can change the payouts/prizes by editing open_dialog.sqf and changing these lines

PRIZE1 = 500;
PRIZE2 = 750;
PRIZE3 = 1200;
PRIZE4 = 2500;
PRIZE5 = 5000;
PRIZE6 = 7500;
PRIZE7 = 10000;

you then also have to change the text thats shown when you win so open slots.sqf under //Check Prize and pay out

Example: to change PRIZE1 find the below code and change the 500 to what ever you changed PRIZE1 to.
 

if (reel1 == "cherry") then {
		titleText ["You won 500","PLAIN DOWN",3]; 
		titleFadeOut 5;
			_newPoptabs = ExileClientPlayerMoney + PRIZE1;
			ENIGMA_UpdateStats = [player,_newPoptabs];
			publicVariableServer "ENIGMA_UpdateStats";
		};

 

enjoy gambling away :)

Edited by FallingSheep
defines fix....sorry!
  • Like 6

Share this post


Link to post
Share on other sites
Advertisement

Now im a bit confused :-) 

 Warning Message: File mpmissions\__cur_mp.Panthera3\scripts\slotmachine\slots.hpp, line 7: /RscDisplaySlots/Controls.RscBackground_5000: Undefined base class 'RscBackground'

Share this post


Link to post
Share on other sites
3 hours ago, cubitron said:

Now im a bit confused :-) 

 Warning Message: File mpmissions\__cur_mp.Panthera3\scripts\slotmachine\slots.hpp, line 7: /RscDisplaySlots/Controls.RscBackground_5000: Undefined base class 'RscBackground'

I got the same error.

Share this post


Link to post
Share on other sites
18 minutes ago, ShootingBlanks said:

that means the custom control rscbackground has not been defined.

you can probably replace that with rsctext until its fixed properly.

class RscBackground_5000: RscText

11:50:10 Warning Message: File mpmissions\Exile.Altis\addons\slotmachine\slots.hpp, line 7: /RscTitles/RscDisplaySlots/Controls.RscBackground_5000: Undefined base class 'RscText'

Dont think it worked for me. I will just wait. Thanks tho

Share this post


Link to post
Share on other sites
On 1/18/2016 at 2:28 AM, cubitron said:

Now im a bit confused :-) 

 Warning Message: File mpmissions\__cur_mp.Panthera3\scripts\slotmachine\slots.hpp, line 7: /RscDisplaySlots/Controls.RscBackground_5000: Undefined base class 'RscBackground'


ok add this to the top of slots.hpp add it at the very top above class RscDisplaySlots 

class RscText
{
	deletable = 0;
	fade = 0;
	access = 0;
	type = 0;
	idc = -1;
	colorBackground[] = {0,0,0,0};
	colorText[] = {1,1,1,1};
	text = "";
	fixedWidth = 0;
	x = 0;
	y = 0;
	h = 0.037;
	w = 0.3;
	style = 2;
	shadow = 1;
	colorShadow[] = {0,0,0,0.5};
	font = "PuristaMedium";
	SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
	linespacing = 1;
	tooltipColorText[] = {1,1,1,1};
	tooltipColorBox[] = {1,1,1,1};
	tooltipColorShade[] = {0,0,0,0.65};
};
class RscBackground
{
	type = 0;
	style = ST_BACKGROUND;
	shadow = 2;
	colorBackground[] = {0,0,0,1};
	colorText[] = {1,1,1,1};
	font = "TahomaB";
	sizeEx = 0.02;
	text = "";
	
};
class MyRscFrame
{
	type = 0;
	idc = -1;
	style = 64;
	shadow = 2;
	colorBackground[] = {0,0,0,1};
	colorText[] = {1,1,1,1};
	font = "TahomaB";
	sizeEx = 0.02;
	text = "";
};
class RscPicture
{
	access = 0;
	type = 0;
	idc = -1;
	style = 48;
	colorBackground[] = {0, 0, 0, 0};
	colorText[] = {1, 1, 1, 1};
	font = "TahomaB";
	sizeEx = 0;
	lineSpacing = 0;
	text = "";
	fixedWidth = 0;
	shadow = 0;
	x = 0;
	y = 0;
	w = 0.2;
	h = 0.15;
};
class RscButton
{
	deletable = 0;
	fade = 0;
	access = 0;
	type = 1;
	text = "";
	colorText[] = {1,1,1,1};
	colorDisabled[] = {1,1,1,0.25};
	colorBackground[] = {0.212,0.2,0.231,0.3};
	colorBackgroundDisabled[] = {0,0,0,0.5};
	colorBackgroundActive[] = {1,1,1,0.1};
	colorFocused[] = {1,1,1,0.1};
	colorShadow[] = {0,0,0,0};
	colorBorder[] = {1,1,1,0.1};
	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
	};
	style = 2;
	x = 0;
	y = 0;
	w = 0.095589;
	h = 0.039216;
	shadow = 2;
	font = "PuristaMedium";
	sizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
	offsetX = 0;
	offsetY = 0;
	offsetPressedX = 0;
	offsetPressedY = 0;
	borderSize = 0;
};

 

Share this post


Link to post
Share on other sites
Spoiler

//////////////////////////////////////////
//    Slot Dialog made by Fallingsheep    //
//////////////////////////////////////////
class RscText
{
    deletable = 0;
    fade = 0;
    access = 0;
    type = 0;
    idc = -1;
    colorBackground[] = {0,0,0,0};
    colorText[] = {1,1,1,1};
    text = "";
    fixedWidth = 0;
    x = 0;
    y = 0;
    h = 0.037;
    w = 0.3;
    style = 2;
    shadow = 1;
    colorShadow[] = {0,0,0,0.5};
    font = "PuristaMedium";
    SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
    linespacing = 1;
    tooltipColorText[] = {1,1,1,1};
    tooltipColorBox[] = {1,1,1,1};
    tooltipColorShade[] = {0,0,0,0.65};
};
class RscBackground
{
    type = 0;
    style = ST_BACKGROUND;
    shadow = 2;
    colorBackground[] = {0,0,0,1};
    colorText[] = {1,1,1,1};
    font = "TahomaB";
    sizeEx = 0.02;
    text = "";
    
};
class MyRscFrame
{
    type = 0;
    idc = -1;
    style = 64;
    shadow = 2;
    colorBackground[] = {0,0,0,1};
    colorText[] = {1,1,1,1};
    font = "TahomaB";
    sizeEx = 0.02;
    text = "";
};
class RscPicture
{
    access = 0;
    type = 0;
    idc = -1;
    style = 48;
    colorBackground[] = {0, 0, 0, 0};
    colorText[] = {1, 1, 1, 1};
    font = "TahomaB";
    sizeEx = 0;
    lineSpacing = 0;
    text = "";
    fixedWidth = 0;
    shadow = 0;
    x = 0;
    y = 0;
    w = 0.2;
    h = 0.15;
};
class RscButton
{
    deletable = 0;
    fade = 0;
    access = 0;
    type = 1;
    text = "";
    colorText[] = {1,1,1,1};
    colorDisabled[] = {1,1,1,0.25};
    colorBackground[] = {0.212,0.2,0.231,0.3};
    colorBackgroundDisabled[] = {0,0,0,0.5};
    colorBackgroundActive[] = {1,1,1,0.1};
    colorFocused[] = {1,1,1,0.1};
    colorShadow[] = {0,0,0,0};
    colorBorder[] = {1,1,1,0.1};
    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
    };
    style = 2;
    x = 0;
    y = 0;
    w = 0.095589;
    h = 0.039216;
    shadow = 2;
    font = "PuristaMedium";
    sizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
    offsetX = 0;
    offsetY = 0;
    offsetPressedX = 0;
    offsetPressedY = 0;
    borderSize = 0;
};

class RscDisplaySlots
{
   idd = 9000;
   movingenable = false;

   class Controls
   {
     class RscBackground_5000: RscBackground
     {
       idc = 5000;
       colorBackground[] = {0,0,0,1};
       colorText[] = {1,1,1,1};
       x = 0.32375 * safezoneW + safezoneX;
       y = 0.3355 * safezoneH + safezoneY;
       w = 0.367188 * safezoneW;
       h = 0.3055 * safezoneH;
     };
     class RscFrame_1800: MyRscFrame
     {
       idc = 1800;
       colorBackground[] = {0,0,0,1};
       colorText[] = {1,1,1,1};
       x = 0.32375 * safezoneW + safezoneX;
       y = 0.3355 * safezoneH + safezoneY;
       w = 0.367188 * safezoneW;
       h = 0.3055 * safezoneH;
     };
     class credittext_TXT: RscText
     {
       idc = 1000;
       text = "Credits:";
       x = 0.32375 * safezoneW + safezoneX;
       y = 0.3355 * safezoneH + safezoneY;
       w = 0.0440625 * safezoneW;
       h = 0.0235 * safezoneH;
     };
     class credits_TXT: RscText
     {
       idc = 1001;
       text = "0";
       x = 0.367812 * safezoneW + safezoneX;
       y = 0.3355 * safezoneH + safezoneY;
       w = 0.0514062 * safezoneW;
       h = 0.0235 * safezoneH;
     };
     class RscPicture_1201: RscPicture
     {
       idc = 1201;
       text = "#(argb,8,8,3)color(1,1,1,1)";
       x = 0.477969 * safezoneW + safezoneX;
       y = 0.3825 * safezoneH + safezoneY;
       w = 0.05875 * safezoneW;
       h = 0.1175 * safezoneH;
     };
     class RscPicture_1202: RscPicture
     {
       idc = 1202;
       text = "#(argb,8,8,3)color(1,1,1,1)";
       x = 0.573438 * safezoneW + safezoneX;
       y = 0.3825 * safezoneH + safezoneY;
       w = 0.05875 * safezoneW;
       h = 0.1175 * safezoneH;
     };
     class RscPicture_1200: RscPicture
     {
       idc = 1200;
       text = "#(argb,8,8,3)color(1,1,1,1)";
       x = 0.3825 * safezoneW + safezoneX;
       y = 0.3825 * safezoneH + safezoneY;
       w = 0.05875 * safezoneW;
       h = 0.1175 * safezoneH;
     };
     class spin_BTN: RscButton
     {
       idc = 1600;
       text = "SPIN";
       x = 0.338437 * safezoneW + safezoneX;
       y = 0.5705 * safezoneH + safezoneY;
       w = 0.05875 * safezoneW;
       h = 0.0235 * safezoneH;
       onButtonClick = "[] execVM 'scripts\slotmachine\slots.sqf';";
     };
     class credit1_BTN: RscButton
     {
       idc = 1601;
       text = "1 Spin";
       x = 0.419219 * safezoneW + safezoneX;
       y = 0.5705 * safezoneH + safezoneY;
       w = 0.0734375 * safezoneW;
       h = 0.0235 * safezoneH;
       onButtonClick = "[] execVM 'scripts\slotmachine\add1credit.sqf';";
     };
     class credit10_BTN: RscButton
     {
       idc = 1602;
       text = "10 Spins";
       x = 0.514687 * safezoneW + safezoneX;
       y = 0.5705 * safezoneH + safezoneY;
       w = 0.0807813 * safezoneW;
       h = 0.0235 * safezoneH;
       onButtonClick = "[] execVM 'scripts\slotmachine\add10credit.sqf';";
     };
     class cashout_BTN: RscButton
     {
       idc = 1603;
       text = "CASH OUT";
       x = 0.6175 * safezoneW + safezoneX;
       y = 0.5705 * safezoneH + safezoneY;
       w = 0.05875 * safezoneW;
       h = 0.0235 * safezoneH;
       onButtonClick = "[] execVM 'scripts\slotmachine\cashout.sqf';";
     };
   };
};

Getting this error with new code you supplied. Am i missing something 

14:28:48 Warning Message: File mpmissions\Exile.Altis\scripts\slotmachine\slots.hpp, line 25: .RscText: Member already defined.
14:28:48 Warning Message: File mpmissions\Exile.Altis\scripts\slotmachine\slots.hpp, line 122: .RscButton: Member already defined.

 

Edited by Tuna

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.