Author Topic: help with slot machine variable change  (Read 751 times)

Im trying to make the slot machine brick use money from a separate gamemode/system.

Thanks.

what have you tried?
which bit are you having issues with?

what have you tried?
which bit are you having issues with?

I want to take the money from this: https://www.mediafire.com/file/q9b9l4hxdgfqw6h/System_GTA.zip/file

and have this use it: https://www.mediafire.com/file/93zbxkpqrzrdnj7/Brick_SlotMachine.zip/file


The only thing i can find is "money". I dont know how to code really at all I was just hoping I could find the name of the variable and use it in the slot machine, thats all.
« Last Edit: February 02, 2020, 11:57:53 PM by yeahbuddy1OO »

try looking in the code for what variable is being used in each
then replace the ones in the slot machines with the ones in the money mod?
if you post the relevant bits of code, we can probably point out which variables are which

try looking in the code for what variable is being used in each
then replace the ones in the slot machines with the ones in the money mod?
if you post the relevant bits of code, we can probably point out which variables are which

Thats the thing, I have no idea what is relevant. Does this help?

function gameConnection::addMoney(%this, %value) {
   %user = GTAData.collection("users").document(%this.getDocumentName());
   %this.setMoney(mAdd(%user.get("money"), %value));
}
« Last Edit: February 03, 2020, 12:08:55 AM by yeahbuddy1OO »

looks useful
now when the slot machine adds or subtracts things, you can probably swap it to using that function

So i discovered that the money from the gta system is partially score, so it changes the score no problem because thats what it effects at default. It does not change the money in the HUD. is there some line of code that I can put at the bottom of the server.cs script in the slot machine brick folder that will also change the HUD?

I really hope this makes sense, thank you.

So i discovered that the money from the gta system is partially score, so it changes the score no problem because thats what it effects at default. It does not change the money in the HUD. is there some line of code that I can put at the bottom of the server.cs script in the slot machine brick folder that will also change the HUD?
in /src/display.cs edit line 28.

change
Code: [Select]
%str = %str @ "<sbreak>" @ %color @ "$" @ %user.get("money");
to
Code: [Select]
%str = %str @ "<sbreak>" @ %color @ "$" @ %this.score;
should display proper score as shown in the f2 menu

in /src/display.cs edit line 28.

change
Code: [Select]
%str = %str @ "<sbreak>" @ %color @ "$" @ %user.get("money");
to
Code: [Select]
%str = %str @ "<sbreak>" @ %color @ "$" @ %this.score;


should display proper score as shown in the f2 menu

thanks man

theres a variable for using a variable from the client's object in the slot machine but this stupid gta gamemode is so ridiculously complicated that you have to use some whack database to access a players money so youll have to rewrite a function

theres a variable for using a variable from the client's object in the slot machine but this stupid gta gamemode is so ridiculously complicated that you have to use some whack database to access a players money so youll have to rewrite a function

alright darn i cant do that i can barely edit code

i'm sure you can find the parts that need changing and ask about them and what they need changing too