Cloud22

Flag Hacking 1.0.4

99 posts in this topic

Thanks to @kuplion for compiling this! His amazing work just mind blows me!

After I added this to my server, I noticed that when the hack completed, you didn't get any vehicle. This is a fix for that error.

Edit the file "ExileServer_object_flag_network_hackFlagRequest.sqf"

at line 60:

_vehicleInfo = format["confirmVehicleOwnership:%1", _storedVehicleRandom select 1] call ExileServer_system_database_query_selectSingle;

edit it to:

_vehicleInfo = format["confirmVehicleOwnership:%1:%2", _storedVehicleRandom select 1, _territoryID] call ExileServer_system_database_query_selectSingle;

Also thanks to Cloud22 for creating this flag hack!

(Sorry for bad explanation, and other stuff)

Share this post


Link to post
Share on other sites

I added as you wrote @kuplion in the init.sqf, made the folders, dropped off the files in those separate folders. Added 


[] execVM "Custom\EnigmaRevive\init.sqf";
[] execVM "Custom\StatusBar\statusBar_init.sqf";
[] execVM "R3F_LOG\init.sqf";
[] execVM "ClaimVehicles_Client\ClaimVehicles_Client_init.sqf";
[] execVM "Custom\HaloParachute\init.sqf";

// Compile all the things!!
{
    _code = "";
    _function = _x select 0;
    _file = _x select 1;
    _code = compileFinal (preprocessFileLineNumbers _file);
    missionNamespace setVariable [_function, _code];
}
forEach
[
    // Server
    ["ExileServer_object_flag_network_hackFlagRequest","Custom\FlagHacking\ServerFiles\ExileServer_object_flag_network_hackFlagRequest.sqf"],
    ["ExileServer_object_flag_network_startFlagHackRequest","Custom\FlagHacking\ServerFiles\ExileServer_object_flag_network_startFlagHackRequest.sqf"],
    ["ExileServer_object_flag_network_updateFlagHackAttemptRequest","Custom\FlagHacking\ServerFiles\ExileServer_object_flag_network_updateFlagHackAttemptRequest.sqf"],
    
    // Client
    ["ExileClient_action_hackFlag_aborted","Custom\FlagHacking\ClientFiles\ExileClient_action_hackFlag_aborted.sqf"],
    ["ExileClient_action_hackFlag_completed","Custom\FlagHacking\ClientFiles\ExileClient_action_hackFlag_completed.sqf"],
    ["ExileClient_action_hackFlag_condition","Custom\FlagHacking\ClientFiles\ExileClient_action_hackFlag_condition.sqf"],
    ["ExileClient_action_hackFlag_duration","Custom\FlagHacking\ClientFiles\ExileClient_action_hackFlag_duration.sqf"],
    ["ExileClient_action_hackFlag_failChance","Custom\FlagHacking\ClientFiles\ExileClient_action_hackFlag_failChance.sqf"],
    ["ExileClient_action_hackFlag_failed","Custom\FlagHacking\ClientFiles\ExileClient_action_hackFlag_failed.sqf"]
];

 

config.cpp - 

class HackFlag: ExileAbstractAction
            {
                title = "Hack Flag";
                condition = "(getNumber(missionConfigFile >> 'CfgFlagHacking' >> 'enableHacking') isEqualTo 1) && ('Exile_Item_Laptop' in (magazines player)) && !ExilePlayerInSafezone";
                action = "['HackFlag', _this select 0] call ExileClient_action_execute";
            }; 

under class Flag

and added addional files in the config.cpp. Still not possible to "hack flag" when you are next to it.

Share this post


Link to post
Share on other sites
Advertisement

anyone got an install guide ?  

when i hack flag i get this error ... not sure what ive done wrong

15:01:22 Error in expression <dVehicles", []];
_storedVehicleRandom = selectRandom (_storedVehicles);
_index =>
15:01:22   Error position: <selectRandom (_storedVehicles);
_index =>
15:01:22   Error selectrandom: Type String, expected Array
15:01:22 File FlagHack\ExileServer_object_flag_network_hackFlagRequest.sqf, line 47

 

Share this post


Link to post
Share on other sites
On 5/7/2018 at 8:58 AM, Grayz_lost said:

anyone got an install guide ?  

when i hack flag i get this error ... not sure what ive done wrong


15:01:22 Error in expression <dVehicles", []];

_storedVehicleRandom = selectRandom (_storedVehicles);

_index =>

15:01:22   Error position: <selectRandom (_storedVehicles);

_index =>

15:01:22   Error selectrandom: Type String, expected Array

15:01:22 File FlagHack\ExileServer_object_flag_network_hackFlagRequest.sqf, line 47

 

Go to @kuplion's post

Share this post


Link to post
Share on other sites

ive done what @kuplion said to do . put overides in config.cpp for the server files , placed all files in mission folder and i get this error now .

Do i need to update my database ? or add anything to my sql exile .ini?

 

 

10:11:35 "ExileServer - Database Error: Error Incorrect Number of Inputs"
10:11:35 Error in expression <ase_handleBig;
};
};
(_result select 1) select 0>
10:11:35   Error position: <select 0>
10:11:35   Error Generic error in expression
10:11:35 File exile_server\code\ExileServer_system_database_query_selectSingle.sqf, line 27
10:11:35 Error in expression <ase_handleBig;
};
};
(_result select 1) select 0>
10:11:35   Error position: <select 0>
10:11:35   Error Generic error in expression
10:11:35 File exile_server\code\ExileServer_system_database_query_selectSingle.sqf, line 27

Share this post


Link to post
Share on other sites

When I do everything right, I get the hack flag option. but as soon as I press it, it breaks all of the menus and when you click on something it won't do it.

Edited by graylyn

Share this post


Link to post
Share on other sites

for me, the HackFlag scripts work fine. Thx to @Cloud22

I copied the server files in the exile_server.pbo and changed the fn_preInit.sqf.

I copied the client files in the mission file and added this (below) to init.sqf - thx @kuplion

Spoiler
{
    _code = "";
    _function = _x select 0;
    _file = _x select 1;
    _code = compileFinal (preprocessFileLineNumbers _file);
    missionNamespace setVariable [_function, _code];
}
forEach
[
     // Client
    ["ExileClient_action_hackFlag_aborted","Custom\FlagHacking\ClientFiles\ExileClient_action_hackFlag_aborted.sqf"],
    ["ExileClient_action_hackFlag_completed","Custom\FlagHacking\ClientFiles\ExileClient_action_hackFlag_completed.sqf"],
    ["ExileClient_action_hackFlag_condition","Custom\FlagHacking\ClientFiles\ExileClient_action_hackFlag_condition.sqf"],
    ["ExileClient_action_hackFlag_duration","Custom\FlagHacking\ClientFiles\ExileClient_action_hackFlag_duration.sqf"],
    ["ExileClient_action_hackFlag_failChance","Custom\FlagHacking\ClientFiles\ExileClient_action_hackFlag_failChance.sqf"],
    ["ExileClient_action_hackFlag_failed","Custom\FlagHacking\ClientFiles\ExileClient_action_hackFlag_failed.sqf"]
];

Changed the ExileClient_action_execute.sqf and added it to the CustomCode section in the config.cpp (mission file).

Spoiler

class CfgExileCustomCode
{
    ExileClient_action_execute = "CustomCode\ExileClient_action_execute.sqf";
};

Added this also to the config.cpp

Spoiler

class CfgFlagHacking
{
    enableHacking = 1;
    failChance = 25;
    hackDuration = 10;
    maxHackAttempts = 3;
    minPlayers = 30;
    maxHacks = 3;
    removeChance = 5;
    showMapIcon = 1;
    notifyServer = 1;
    notificationCooldown = 5;
};

class CfgExileDelayedActions
{
    class Abstract
    {
        duration=10;
        abortInCombatMode=1;
        durationFunction="";
        animation="";
        animationType="switchMove";
        failChance=0;
        conditionFunction="";
        completedFunction="";
        abortedFunction="";
        failedFunction="";
        repeatingCheckFunction="";
    };
    class HackFlag: Abstract
    {
        animationType="switchMove";
        animation="Acts_TerminalOpen";
        abortInCombatMode=0;
        failChanceFunction="ExileClient_action_hackFlag_failChance";
        durationFunction="ExileClient_action_hackFlag_duration";
        conditionFunction="ExileClient_action_hackFlag_condition";
        completedFunction="ExileClient_action_hackFlag_completed";
        failedFunction="ExileClient_action_hackFlag_failed";
        abortedFunction="ExileClient_action_hackFlag_aborted";
    };
};

class CfgInteractionMenus
{
    class Flag
    {
        targetType = 2;
        target = "Exile_Construction_Flag_Static";

        class Actions
        {
            class HackFlag: ExileAbstractAction
            {
                title = "Hack Flag";
                condition = "(getNumber(missionConfigFile >> 'CfgFlagHacking' >> 'enableHacking') isEqualTo 1) && ('Exile_Item_Laptop' in (magazines player)) && !ExilePlayerInSafezone";
                action = "['HackFlag', _this select 0] call ExileClient_action_execute";
            };
        };
    };
};

Added this to the description.ext:

Spoiler

class CfgNetworkMessages
{
    class hackFlagRequest
    {
        module="object_flag";
        parameters[]=
        {
            "STRING"
        };
    };
    class updateFlagHackAttemptRequest
    {
        module="object_flag";
        parameters[]=
        {
            "STRING"
        };
    };
    class startFlagHackRequest
    {
        module="object_flag";
        parameters[]=
        {
            "STRING"
        };
    };
};

 

I think I have found a small issue. If I hack the flag and get the last vehicle and the virtual garage is empty I can start the next hack

without any notification. After server restart I get the the correct notification the virtual garage is empty.

I will test it a second time, maybe I made a mistake.

 

Share this post


Link to post
Share on other sites

ok .. so ive put files in server pbo and changed fn_prenit.sqf as captainchaos said .. etc  added whats needed to discription.ext and config.cpp and i still get this error

(_result select 1) select 0>
15:52:33   Error position: <select 0>
15:52:33   Error Generic error in expression
15:52:33 File exile_server\code\ExileServer_system_database_query_selectSingle.sqf, line 27
15:52:33 Error in expression <ase_handleBig;
};

any ideas ??  the virtual garage works as normal , and if hack fails or you abort etc that works ok. 

 

Share this post


Link to post
Share on other sites
24 minutes ago, Grayz_lost said:

ok .. so ive put files in server pbo and changed fn_prenit.sqf as captainchaos said .. etc  added whats needed to discription.ext and config.cpp and i still get this error


(_result select 1) select 0>

15:52:33   Error position: <select 0>

15:52:33   Error Generic error in expression

15:52:33 File exile_server\code\ExileServer_system_database_query_selectSingle.sqf, line 27

15:52:33 Error in expression <ase_handleBig;

};

any ideas ??  the virtual garage works as normal , and if hack fails or you abort etc that works ok. 

 

Go to my post to fix:

 

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.