SQL Database question

  • Offline Mokey
  • Fractured Wasteland
  • Elite
  • ******
  • Posts: 606
  • Https://Fractured-Gaming.com

SQL Database question

« posted: Aug 02, 2015, 06:49 PM »
Ok so Currently I have implemeted my players gear levels on my database (finally). However I was wondering if some1 could explain to me how I can move "Money" (money on hand) in the data base from playersave to playerinfo

Currently when a player reaches 1 mil I wipe their accounts and I have to flip back and forwards to adjust it all.

:) Thanks Creampie and Cael for the help on the gear level btw :)

I was looking for something similar in the ini for extdb for money but couldn't find where it's being pulled from.

Code: [Select]
[getPlayerGearLevel]
SQL1_1 = SELECT GearLevel FROM PlayerInfo WHERE UID = '$INPUT_1';

Number of Inputs = 1
Posts once, edits post 40 times in 60 seconds. STUPID FAT FINGERS!
  • Offline AgentRev
  • Developer
  • Veteran
  • ******
  • Posts: 2490

Re: SQL Database question

« Reply #1 posted: Aug 03, 2015, 02:24 AM »
I don't understand what you're trying to do, but it doesn't sound like the right approach. When which amount reaches 1 mil? Bank or on hand? What do you mean by flip back and forwards?

Money on hand is associated with a map-specific "live" save, which means it's lost (dropped) on death. If you permanently "move" money on hand from playersave to playerinfo, then your wallet essentially becomes a second bank account. That wouldn't make sense.
  • Offline CREAMPIE
  • Armaholic
  • Veteran
  • ******
  • Posts: 1077
  • ^_^;;

Re: SQL Database question

« Reply #2 posted: Aug 03, 2015, 08:33 AM »

:) Thanks Creampie and Cael for the help on the gear level btw :)


Anytime man ;)

- from the grassy knoll -
  • Offline Mokey
  • Fractured Wasteland
  • Elite
  • ******
  • Posts: 606
  • Https://Fractured-Gaming.com

Re: SQL Database question

« Reply #3 posted: Aug 04, 2015, 01:16 PM »
@agentrev

So the way it is now players reach 1 mil in their bank account,  they fill out a gear level application on my forum., I then go to the database,  reset their bank money,  grant them a gear level in "playerinfo" on the database. Then I go to "playersave" and give them the appropriate gear level cash on hand. (to keep them From keeping extra cash during a gear level upgrade) I would like to add I added a Gear level section In my database to do all of this.

So the "money" in player save,  which is cash on hand is in an inconvienant place for my database and would like to move it to "playerinfo" from "playersave"

I tried duplicating the column,  but that doesn't seem to work and unfortunately my skills in SQL are very limited, but I'm willing to learn anything :)

Posts once, edits post 40 times in 60 seconds. STUPID FAT FINGERS!
  • Offline AgentRev
  • Developer
  • Veteran
  • ******
  • Posts: 2490

Re: SQL Database question

« Reply #4 posted: Aug 04, 2015, 01:33 PM »
Is this gear level cash on hand a one-time lump sum or something the player should be getting every spawn?

Also you can't move money on hand to playerinfo, that would require a re-engineering of the save loading scripts, which would fuck up anything related to server or map switch in that regard.

Re: SQL Database question

« Reply #5 posted: Aug 04, 2015, 07:22 PM »
I may understand this the wrong way but if you set their bank money to 0 in the DB you don't want them to have "cash on hand" either? or is it that they might withdraw the bank money before they relog to get their new "gear level" and get to keep all the money? (that got confusing but i hope you understand =) ).

Sideinformation for anyone that are interested, if you look at the attached pic i added GearLevel and Bounty to player info as i don't want those values deleted on player death/respawn or whatever.
 I guess you did it like this too Mokey?

Sorry for the rambling but i want to understand better =)
  • Offline Mokey
  • Fractured Wasteland
  • Elite
  • ******
  • Posts: 606
  • Https://Fractured-Gaming.com

Re: SQL Database question

« Reply #6 posted: Aug 05, 2015, 06:23 PM »
@AgentRev

Yes they get a set amount per gear level each spawn.  And now I know it would be too much work for a little cause on the database.

@Cael
So for gear level 4 they get $400 extra each spawn,  what players were doing is submitting a gear level application,  then hoarding money in hand prior to the gear level being administered. Which made their friends hold money and try to get extra quicker. There was a lot of complaining so I started it this way and it helped a lot.

So what I do is wipe their bank money,  then give them the starting cash (in hand) amount according to their gear level. In this case it would be $5,400 (5,000 default,  400 extra) and grant them a gear level.

And yes,  I did it the same way,  however I do not have bounty... I may be PM'ing you later lolz.
Posts once, edits post 40 times in 60 seconds. STUPID FAT FINGERS!
  • Offline Mokey
  • Fractured Wasteland
  • Elite
  • ******
  • Posts: 606
  • Https://Fractured-Gaming.com

Re: SQL Database question

« Reply #8 posted: Aug 05, 2015, 08:03 PM »
Posts once, edits post 40 times in 60 seconds. STUPID FAT FINGERS!
  • Offline Mokey
  • Fractured Wasteland
  • Elite
  • ******
  • Posts: 606
  • Https://Fractured-Gaming.com

Re: SQL Database question

« Reply #9 posted: Aug 16, 2015, 02:05 AM »
ok rev, now that I'm porting this to v1.2 I cant get any of it to work. I tried my way, and I've tried your comments, it seems to just kill the database 100%. however since before the switch over with the old database on extdb and not extDB2 it worked flawlessly

Unfortunately i'm to invested in the database with my old version just to nix it. What would you recommend?
Posts once, edits post 40 times in 60 seconds. STUPID FAT FINGERS!
  • Offline Mokey
  • Fractured Wasteland
  • Elite
  • ******
  • Posts: 606
  • Https://Fractured-Gaming.com

Re: SQL Database question

« Reply #10 posted: Aug 16, 2015, 09:55 PM »
Rev, I sent you a PM.
Posts once, edits post 40 times in 60 seconds. STUPID FAT FINGERS!
  • Offline Mokey
  • Fractured Wasteland
  • Elite
  • ******
  • Posts: 606
  • Https://Fractured-Gaming.com

Re: SQL Database question

« Reply #11 posted: Aug 16, 2015, 10:28 PM »
Sigh...

Code: [Select]
16:32:36 File mpmissions\__CUR_MP.Stratis\client\functions\spawnAction.sqf, line 32
16:32:36 Error in expression <_startingMoney", 100] call getPublicVar + (400 * (player getVariable ["gearLevel>
16:32:36   Error position: <+ (400 * (player getVariable ["gearLevel>
16:32:36   Error +: Type code, expected Number,Array,String,Not a Number
16:32:36 File mpmissions\__CUR_MP.Stratis\client\functions\spawnAction.sqf, line 32
16:32:37 Error in expression <_startingMoney", 100] call getPublicVar + (400 * (player getVariable ["gearLevel>
16:32:37   Error position: <+ (400 * (player getVariable ["gearLevel>
16:32:37   Error +: Type code, expected Number,Array,String,Not a Number
16:32:37 File mpmissions\__CUR_MP.Stratis\client\functions\spawnAction.sqf, line 32
16:32:37 Error in expression <_startingMoney", 100] call getPublicVar + (400 * (player getVariable ["gearLevel>
16:32:37   Error position: <+ (400 * (player getVariable ["gearLevel>
16:32:37   Error +: Type code, expected Number,Array,String,Not a Number
16:32:37 File mpmissions\__CUR_MP.Stratis\client\functions\spawnAction.sqf, line 32
16:32:37 Error in expression <_startingMoney", 100] call getPublicVar + (400 * (player getVariable ["gearLevel>
16:32:37   Error position: <+ (400 * (player getVariable ["gearLevel>
16:32:37   Error +: Type code, expected Number,Array,String,Not a Number
16:32:37 File mpmissions\__CUR_MP.Stratis\client\functions\spawnAction.sqf, line 32
16:32:38 Error in expression <_startingMoney", 100] call getPublicVar + (400 * (player getVariable ["gearLevel>
16:32:38   Error position: <+ (400 * (player getVariable ["gearLevel>
16:32:38   Error +: Type code, expected Number,Array,String,Not a Number
16:32:38 File mpmissions\__CUR_MP.Stratis\client\functions\spawnAction.sqf, line 32
16:32:45 Error in expression <_startingMoney", 100] call getPublicVar + (400 * (player getVariable ["gearLevel>
16:32:45   Error position: <+ (400 * (player getVariable ["gearLevel>
16:32:45   Error +: Type code, expected Number,Array,String,Not a Number
16:32:45 File mpmissions\__CUR_MP.Stratis\client\functions\spawnAction.sqf, line 32
16:32:46 Error in expression <_startingMoney", 100] call getPublicVar + (400 * (player getVariable ["gearLevel>
16:32:46   Error position: <+ (400 * (player getVariable ["gearLevel>
16:32:46   Error +: Type code, expected Number,Array,String,Not a Number
16:32:46 File mpmissions\__CUR_MP.Stratis\client\functions\spawnAction.sqf, line 32
16:32:46 Error in expression <_startingMoney", 100] call getPublicVar + (400 * (player getVariable ["gearLevel>
16:32:46   Error position: <+ (400 * (player getVariable ["gearLevel>
16:32:46   Error +: Type code, expected Number,Array,String,Not a Number
16:32:46 File mpmissions\__CUR_MP.Stratis\client\functions\spawnAction.sqf, line 32
16:32:47 Error in expression <_startingMoney", 100] call getPublicVar + (400 * (player getVariable ["gearLevel>
16:32:47   Error position: <+ (400 * (player getVariable ["gearLevel>
16:32:47   Error +: Type code, expected Number,Array,String,Not a Number
16:32:47 File mpmissions\__CUR_MP.Stratis\client\functions\spawnAction.sqf, line 32
16:32:47 Error in expression <_startingMoney", 100] call getPublicVar + (400 * (player getVariable ["gearLevel>
16:32:47   Error position: <+ (400 * (player getVariable ["gearLevel>
16:32:47   Error +: Type code, expected Number,Array,String,Not a Number
Posts once, edits post 40 times in 60 seconds. STUPID FAT FINGERS!