Jump to content
Snipes Murphy

[Tutorial] Advanced Banking System, With Pins.

Recommended Posts

═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════

 

Difficulty: Hard

Published By: Snipes Murphy

Version: 4.x

Credit: DiabolicaTrix

 

═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════


All files are available here: https://github.com/DiabolicaTrix/Life-Banking-System/releases

  1. Navigate to the core folder, and drag the banking folder directly into it (these are single files, no files should be replaced)
  2. In the session folder, open the file fn_requestReceived.sqf and copy the contents of the file. Then go to your file of the same name, and copy the code just after initializing the CASH, BANK, etc. variables.
  3. Open the file fn_updatePartial.sqf, and copy the contents. Paste the code just after the "box 7: ..."
  4. In the shop folder, open fn_atmMenu.sqf, and copy the one line. Then replace the contents of your file with the same name by this single line.
  5. At the core root, open the configuration.sqf file, and in your file of the same name, copy the rows right after the life_marker
  6. In the init.sqf, copy the contents of the file, and in your file, paste the code between the initialization of the "sides" (initCiv, initCop, etc.) and the initialization of the "restrained"
  7. In the dialog folder, drag the banking folder directly.
  8. In the function, paste the files directly, and replace existing files.
  9. Copy the atm.hpp file directly to the dialog folder.
  10. Open the MasterHandler.hpp file and copy the contents. Add it to the very end of the file.
  11. Drag the sounds folder directly
  12. Drag the textures folder directly
  13. Drag the Config_Banking.hpp file directly
  14. Copy the single line of the Config_Master.hpp file and add it to the end of the Config_Master.hpp file.
  15. Copy the contents of description.ext, and add it to the end of CfgSounds
  16. In Functions.hpp, add the contents of the file after Vehicle.
  17. In the stringtable.xml, add the content to the end of the file, just before the closing tag of Project (</ Project>)
  18. In your life_server, navigate to the Mysql folder, and open the file fn_queryRequest.sqf, add "banking_pin" after each query, just after playtime. An example is provided in the file in question. Then, in the same file, copy the rest of the file and paste it before the switch.
  19. Copy the contents of fn_updatePartial.sqf, and add the right after box 7.
  20. In your database, add a new field in the player table, the field must be an int, with a length of 4, and be non-null (same features as the cash field).

fadedserverslogo.png

Edited by Snipes Murphy
  • Like 13

Share this post


Link to post
Share on other sites

how can i add it to the init.sqf   where?

/*
    File: init.sqf
    Author: 
    
    Description:
    
*/
StartProgress = false;

[] execVM "briefing.sqf"; //Load Briefing
[] execVM "KRON_Strings.sqf";
[] execVM "script\fn_statusBar.sqf";
[] execVM "script\Grenadestop.sqf"; 
DYNAMICMARKET_boughtItems = [];
[player] remoteExec ["TON_fnc_playerLogged",RSERV];

StartProgress = true;

this is my init.sqf

Share this post


Link to post
Share on other sites
8 minutes ago, BeastDog666 said:

how can i add it to the init.sqf   where?

/*
    File: init.sqf
    Author: 
    
    Description:
    
*/
StartProgress = false;

[] execVM "briefing.sqf"; //Load Briefing
[] execVM "KRON_Strings.sqf";
[] execVM "script\fn_statusBar.sqf";
[] execVM "script\Grenadestop.sqf"; 
DYNAMICMARKET_boughtItems = [];
[player] remoteExec ["TON_fnc_playerLogged",RSERV];

StartProgress = true;

this is my init.sqf

core/init.sqf

Share this post


Link to post
Share on other sites

Can someone help me with this ?

  1. In your life_server, navigate to the Mysql folder, and open the file fn_queryRequest.sqf, add "banking_pin" after each query, just after playtime. An example is provided in the file in question. Then, in the same file, copy the rest of the file and paste it before the switch.

Share this post


Link to post
Share on other sites
5 minutes ago, DEVIL666 said:

Can someone help me with this ?

  1. In your life_server, navigate to the Mysql folder, and open the file fn_queryRequest.sqf, add "banking_pin" after each query, just after playtime. An example is provided in the file in question. Then, in the same file, copy the rest of the file and paste it before the switch.

there is an example into the file into downloaded directory

Share this post


Link to post
Share on other sites

I've another problem with database

Waiting for the server to be ready

there my extdb2 rpt

extDB2: Version: 71
extDB2: https://github.com/Torndeco/extDB2
extDB2: Windows Version
Message: All development for extDB2 is done on a Linux Dedicated Server
Message: If you would like to Donate to extDB2 Development
Message: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=2SUEFTGABTAM2
Message: Also leave a message if there is any particular feature you would like to see added.
Message: Thanks for all the people that have donated.
Message: Torndeco: 20/02/15


extDB2: Found extdb-conf.ini
extDB2: Detected 8 Cores, Setting up 6 Worker Threads


[14:49:01:903887 +02:00] [Thread 10564] extDB2: Database Type: MySQL
[14:49:01:924397 +02:00] [Thread 10564] extDB2: Database Session Pool Started
[14:49:01:934214 +02:00] [Thread 10564] extDB2: SQL_RAW_V2: Initialized: ADD_QUOTES True
[14:49:01:948245 +02:00] [Thread 11540] extDB2: SQL_RAW_V2: Error StatementException: MySQL: [MySQL]: [Comment]: mysql_stmt_execute error    [mysql_stmt_error]: The user specified as a definer ('arma3'@'localhost') does not exist    [mysql_stmt_errno]: 1449    [mysql_stmt_sqlstate]: HY000    [statemnt]: CALL deleteOldGangs
[14:49:01:948247 +02:00] [Thread 14688] extDB2: SQL_RAW_V2: Error StatementException: MySQL: [MySQL]: [Comment]: mysql_stmt_execute error    [mysql_stmt_error]: The user specified as a definer ('arma3'@'localhost') does not exist    [mysql_stmt_errno]: 1449    [mysql_stmt_sqlstate]: HY000    [statemnt]: CALL deleteOldHouses
[14:49:01:948304 +02:00] [Thread 14688] extDB2: SQL_RAW_V2: Error StatementException: SQL: CALL deleteOldHouses
[14:49:01:948244 +02:00] [Thread 14512] extDB2: SQL_RAW_V2: Error StatementException: MySQL: [MySQL]: [Comment]: mysql_stmt_execute error    [mysql_stmt_error]: The user specified as a definer ('arma3'@'localhost') does not exist    [mysql_stmt_errno]: 1449    [mysql_stmt_sqlstate]: HY000    [statemnt]: CALL resetLifeVehicles
[14:49:01:948334 +02:00] [Thread 14512] extDB2: SQL_RAW_V2: Error StatementException: SQL: CALL resetLifeVehicles
[14:49:01:948283 +02:00] [Thread 11540] extDB2: SQL_RAW_V2: Error StatementException: SQL: CALL deleteOldGangs
[14:49:01:948593 +02:00] [Thread 7448] extDB2: SQL_RAW_V2: Error StatementException: MySQL: [MySQL]: [Comment]: mysql_stmt_execute error    [mysql_stmt_error]: The user specified as a definer ('arma3'@'localhost') does not exist    [mysql_stmt_errno]: 1449    [mysql_stmt_sqlstate]: HY000    [statemnt]: CALL deleteDeadVehicles
[14:49:01:948610 +02:00] [Thread 7448] extDB2: SQL_RAW_V2: Error StatementException: SQL: CALL deleteDeadVehicles
[14:50:06:597265 +02:00] [Thread 11540] extDB2: SQL_RAW_V2: Error StatementException: MySQL: [MySQL]: [Comment]: mysql_stmt_execute error    [mysql_stmt_error]: The user specified as a definer ('arma3'@'localhost') does not exist    [mysql_stmt_errno]: 1449    [mysql_stmt_sqlstate]: HY000    [statemnt]: CALL deleteDeadVehicles
[14:50:06:597310 +02:00] [Thread 11540] extDB2: SQL_RAW_V2: Error StatementException: SQL: CALL deleteDeadVehicles
[14:50:06:597288 +02:00] [Thread 14688] extDB2: SQL_RAW_V2: Error StatementException: MySQL: [MySQL]: [Comment]: mysql_stmt_execute error    [mysql_stmt_error]: The user specified as a definer ('arma3'@'localhost') does not exist    [mysql_stmt_errno]: 1449    [mysql_stmt_sqlstate]: HY000    [statemnt]: CALL deleteOldGangs
[14:50:06:597338 +02:00] [Thread 14688] extDB2: SQL_RAW_V2: Error StatementException: SQL: CALL deleteOldGangs
[14:50:06:597279 +02:00] [Thread 14512] extDB2: SQL_RAW_V2: Error StatementException: MySQL: [MySQL]: [Comment]: mysql_stmt_execute error    [mysql_stmt_error]: The user specified as a definer ('arma3'@'localhost') does not exist    [mysql_stmt_errno]: 1449    [mysql_stmt_sqlstate]: HY000    [statemnt]: CALL deleteOldHouses
[14:50:06:597363 +02:00] [Thread 14512] extDB2: SQL_RAW_V2: Error StatementException: SQL: CALL deleteOldHouses
[14:50:06:597391 +02:00] [Thread 7448] extDB2: SQL_RAW_V2: Error StatementException: MySQL: [MySQL]: [Comment]: mysql_stmt_execute error    [mysql_stmt_error]: The user specified as a definer ('arma3'@'localhost') does not exist    [mysql_stmt_errno]: 1449    [mysql_stmt_sqlstate]: HY000    [statemnt]: CALL resetLifeVehicles
[14:50:06:597479 +02:00] [Thread 7448] extDB2: SQL_RAW_V2: Error StatementException: SQL: CALL resetLifeVehicles
[14:51:03:677911 +02:00] [Thread 7448] extDB2: SQL_RAW_V2: Error StatementException: MySQL: [MySQL]: [Comment]: mysql_stmt_execute error    [mysql_stmt_error]: The user specified as a definer ('arma3'@'localhost') does not exist    [mysql_stmt_errno]: 1449    [mysql_stmt_sqlstate]: HY000    [statemnt]: CALL resetLifeVehicles
[14:51:03:677955 +02:00] [Thread 7448] extDB2: SQL_RAW_V2: Error StatementException: SQL: CALL resetLifeVehicles
[14:51:03:677981 +02:00] [Thread 14688] extDB2: SQL_RAW_V2: Error StatementException: MySQL: [MySQL]: [Comment]: mysql_stmt_execute error    [mysql_stmt_error]: The user specified as a definer ('arma3'@'localhost') does not exist    [mysql_stmt_errno]: 1449    [mysql_stmt_sqlstate]: HY000    [statemnt]: CALL deleteOldHouses
[14:51:03:678000 +02:00] [Thread 14688] extDB2: SQL_RAW_V2: Error StatementException: SQL: CALL deleteOldHouses
[14:51:03:678024 +02:00] [Thread 14512] extDB2: SQL_RAW_V2: Error StatementException: MySQL: [MySQL]: [Comment]: mysql_stmt_execute error    [mysql_stmt_error]: The user specified as a definer ('arma3'@'localhost') does not exist    [mysql_stmt_errno]: 1449    [mysql_stmt_sqlstate]: HY000    [statemnt]: CALL deleteDeadVehicles
[14:51:03:678053 +02:00] [Thread 14512] extDB2: SQL_RAW_V2: Error StatementException: SQL: CALL deleteDeadVehicles
[14:51:03:678234 +02:00] [Thread 11540] extDB2: SQL_RAW_V2: Error StatementException: MySQL: [MySQL]: [Comment]: mysql_stmt_execute error    [mysql_stmt_error]: The user specified as a definer ('arma3'@'localhost') does not exist    [mysql_stmt_errno]: 1449    [mysql_stmt_sqlstate]: HY000    [statemnt]: CALL deleteOldGangs
[14:51:03:678249 +02:00] [Thread 11540] extDB2: SQL_RAW_V2: Error StatementException: SQL: CALL deleteOldGangs

 

Share this post


Link to post
Share on other sites

Should it look like this ? in "fn_queryRequest.sqf" File

_tmp = _queryResult select 13;
_queryResult set[16,[_tmp] call DB_fnc_numberSafe];
_query = switch (_side) do {
    // West - 11 entries returned
    case west: {format["SELECT playerid, name, cash, bankacc, adminlevel, donorlevel, cop_licenses, coplevel, cop_gear, blacklist, cop_stats, playtime, banking_pin FROM players WHERE playerid='%1'",_uid];};
    _tmp = _queryResult select 13;
    _queryResult set[16,[_tmp] call DB_fnc_numberSafe]; 
    // Civilian - 12 entries returned
    case civilian: {format["SELECT playerid, name, cash, bankacc, adminlevel, donorlevel, civ_licenses, arrested, civ_gear, civ_stats, civ_alive, civ_position, playtime, banking_pin FROM players WHERE playerid='%1'",_uid];};
    _tmp = _queryResult select 13;
    _queryResult set[16,[_tmp] call DB_fnc_numberSafe];
    // Independent - 10 entries returned
    case independent: {format["SELECT playerid, name, cash, bankacc, adminlevel, donorlevel, med_licenses, mediclevel, med_gear, med_stats, playtime, banking_pin FROM players WHERE playerid='%1'",_uid];};
};

Share this post


Link to post
Share on other sites

Because if i understand right it should look like this 

Example:     case west: {format["SELECT playerid, name, cash, bankacc, adminlevel, donorlevel, cop_licenses, coplevel, cop_gear, blacklist, cop_stats, playtime FROM players WHERE playerid='%1'", banking_pin, _uid];};

(query meaning) = FROM players WHERE playerid='%1

Edited by DEVIL666

Share this post


Link to post
Share on other sites
15 minutes ago, DEVIL666 said:

Because if i understand right it should look like this 

Example:     case west: {format["SELECT playerid, name, cash, bankacc, adminlevel, donorlevel, cop_licenses, coplevel, cop_gear, blacklist, cop_stats, playtime FROM players WHERE playerid='%1'", banking_pin, _uid];};

(query meaning) = FROM players WHERE playerid='%1

No to both things you've just said

Share this post


Link to post
Share on other sites

J have a Error:

15:25:10 Error in expression <use"];
life_vehicles pushBack _house;
} forEach life_houses;

life_gangData = _t>
15:25:10   Error position: <forEach life_houses;

life_gangData = _t>
15:25:10   Error foreach: Typ Zahl, erwartet Array
15:25:10 File mpmissions\__CUR_MP.xcam_taunus\core\session\fn_requestReceived.sqf, line 92

My fn_requestReceived.sqf

#include "..\..\script_macros.hpp"
/*
    File: fn_requestReceived.sqf
    Author: Bryan "Tonic" Boardwine

    Description:
    Called by the server saying that we have a response so let's
    sort through the information, validate it and if all valid
    set the client up.
*/
private["_array"];
life_session_tries = life_session_tries + 1;
if (life_session_completed) exitWith {}; //Why did this get executed when the client already initialized? Fucking arma...
if (life_session_tries > 3) exitWith {cutText[localize "STR_Session_Error","BLACK FADED"]; 0 cutFadeOut 999999999;};

0 cutText [localize "STR_Session_Received","BLACK FADED"];
0 cutFadeOut 9999999;

//Error handling and junk..
if (isNil "_this") exitWith {[] call SOCK_fnc_insertPlayerInfo;};
if (_this isEqualType "") exitWith {[] call SOCK_fnc_insertPlayerInfo;};
if (count _this isEqualTo 0) exitWith {[] call SOCK_fnc_insertPlayerInfo;};
if ((_this select 0) isEqualTo "Error") exitWith {[] call SOCK_fnc_insertPlayerInfo;};
if (!(getPlayerUID player isEqualTo (_this select 0))) exitWith {[] call SOCK_fnc_dataQuery;};

//Lets make sure some vars are not set before hand.. If they are get rid of them, hopefully the engine purges past variables but meh who cares.
/*
if (!isServer && (!isNil "life_adminlevel" || !isNil "life_coplevel" || !isNil "life_donorlevel")) exitWith {
    [profileName,getPlayerUID player,"VariablesAlreadySet"] remoteExecCall ["SPY_fnc_cookieJar",RSERV];
    [profileName,format["Variables set before client initialization...\nlife_adminlevel: %1\nlife_coplevel: %2\nlife_donorlevel: %3",life_adminlevel,life_coplevel,life_donorlevel]] remoteExecCall ["SPY_fnc_notifyAdmins",RCLIENT];
    sleep 0.9;
    failMission "SpyGlass";
};
*/

//Parse basic player information.
CASH = parseNumber (_this select 2);
BANK = parseNumber (_this select 3);
CONST(life_adminlevel,parseNumber (_this select 4));
if (LIFE_SETTINGS(getNumber,"donor_level") isEqualTo 1) then {
    CONST(life_donorlevel,parseNumber (_this select 5));
} else {
    CONST(life_donorlevel,0);
};
life_bankingpin = parseNumber (_this select 16);
//Loop through licenses
if (count (_this select 6) > 0) then {
    {missionNamespace setVariable [(_x select 0),(_x select 1)];} forEach (_this select 6);
};

life_gear = _this select 8;
[true] call life_fnc_loadGear;

//Parse side specific information.
switch (playerSide) do {
    case west: {
        CONST(life_coplevel, parseNumber(_this select 7));
        CONST(life_medicLevel,0);
        life_blacklisted = _this select 9;
        if (LIFE_SETTINGS(getNumber,"save_playerStats") isEqualTo 1) then {
            life_hunger = ((_this select 10) select 0);
            life_thirst = ((_this select 10) select 1);
            player setDamage ((_this select 10) select 2);
        };
    };

    case civilian: {
        life_is_arrested = _this select 7;
        CONST(life_coplevel, 0);
        CONST(life_medicLevel, 0);
        life_houses = _this select 13;
        if (LIFE_SETTINGS(getNumber,"save_playerStats") isEqualTo 1) then {
            life_hunger = ((_this select 9) select 0);
            life_thirst = ((_this select 9) select 1);
            player setDamage ((_this select 9) select 2);
        };

        //Position
        if (LIFE_SETTINGS(getNumber,"save_civilian_position") isEqualTo 1) then {
            life_is_alive = _this select 10;
            life_civ_position = _this select 11;
            if (life_is_alive) then {
                if (count life_civ_position != 3) then {diag_log format["[requestReceived] Bad position received. Data: %1",life_civ_position];life_is_alive =false;};
                if (life_civ_position distance (getMarkerPos "respawn_civilian") < 300) then {life_is_alive = false;};
            };
        };

        {
            _house = nearestObject [(call compile format["%1",(_x select 0)]), "House"];
            life_vehicles pushBack _house;
        } forEach life_houses;

        life_gangData = _this select 14;
        if (!(count life_gangData isEqualTo 0)) then {
            [] spawn life_fnc_initGang;
        };
        [] spawn life_fnc_initHouses;
    };

    case independent: {
        CONST(life_medicLevel, parseNumber(_this select 7));
        CONST(life_coplevel,0);
        if (LIFE_SETTINGS(getNumber,"save_playerStats") isEqualTo 1) then {
            life_hunger = ((_this select 9) select 0);
            life_thirst = ((_this select 9) select 1);
            player setDamage ((_this select 9) select 2);
        };
    };
	
	case east: { 
        CONST(life_adaclevel, parseNumber(_this select 7)); 
        CONST(life_coplevel,0); 
        if (LIFE_SETTINGS(getNumber,"save_playerStats") isEqualTo 1) then {
               life_hunger = ((_this select 9) select 0);
               life_thirst = ((_this select 9) select 1);
        player setDamage ((_this select 9) select 2); 
        }; 
    };
};

if (count (_this select 15) > 0) then {
    {life_vehicles pushBack _x;} forEach (_this select 15);
};

life_session_completed = true;

 

Share this post


Link to post
Share on other sites

@Snipes Murphy

This tutorial really needs to be thought through again i had a look on the git and you are selecting 13 for all sides, however each side brings in a unique number. Plus this was made for 4.4r4 which actually sets houses to 13 (civ obviously) which has not been incremented as it should have been to take place for the extra piece of data you have added. This will cause issues with peoples Arma and end up breaking their server.

  • Like 1

Share this post


Link to post
Share on other sites

Hello there
I enter the server.
ATM Password Registration Menu Does Not Appear.
This error occurs when I enter a random password at ATM.

 

Wrong PIN Please TRY AGAIN

Share this post


Link to post
Share on other sites

1.Polis and Medic ATM WRONG Passport.

2.Password not selected during login

3.The server didn't find any player information matching your UID, attempting to add player to system.

4. Texture Paa open failed. "Error Loading File"

Edited by TulparHAN

Share this post


Link to post
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...