-- Hack Mod by Serpent
-- 2021
setText(logotext, 'HACK MOD by Serpent -- press ~ to active console in game!')
game.hackPanel = getElementEX(
game,
anchorNone,
XYWH(0, 60, 300, 380),
false,
{
colour1 = RGB(20, 25, 30),
}
);
game.hackPanel.name = getLabelEX(
game.hackPanel,
anchorNone,
XYWH(0, 10, 300, 10),
nil,
'Hack Console - by Serpent',
{
nomouseevent = true,
text_halign = ALIGN_MIDDLE,
text_valign = ALIGN_TOP,
}
);
// Unlimited resources
Export Function HackUnlimitedResources;
var i, j, tmp;
begin
tmp := FilterAllUnits([[f_side, your_side], [f_or, [f_btype, b_depot], [f_btype, b_warehouse]]]);
if not tmp then
exit;
for i in tmp do
for j = 1 to 3 do
SetResourceType(GetBase(i), j, 99999);
End;
game.hackPanel.button1 = getButtonEX_Basic(
game.hackPanel,
anchorL,
XYWH(10, 40, 280, 20),
SKINTYPE_NONE,
'OW_CUSTOM_COMMAND(1);',
Button_Colour,
Bevel_Highlight,
Bevel_Shadow,
{
visible = true,
text = 'Add resources',
}
);
game.hackPanel.button2 = getButtonEX_Basic(
game.hackPanel,
anchorL,
XYWH(10, 75, 280, 20),
SKINTYPE_NONE,
'OW_CUSTOM_COMMAND(2);',
Button_Colour,
Bevel_Highlight,
Bevel_Shadow,
{
visible = true,
text = '10 level for selected units',
}
);
game.hackPanel.button3 = getButtonEX_Basic(
game.hackPanel,
anchorL,
XYWH(10, 100, 280, 20),
SKINTYPE_NONE,
'OW_CUSTOM_COMMAND(3);',
Button_Colour,
Bevel_Highlight,
Bevel_Shadow,
{
visible = true,
text = '10 level for all your units',
}
);
game.hackPanel.button4 = getButtonEX_Basic(
game.hackPanel,
anchorL,
XYWH(10, 135, 280, 20),
SKINTYPE_NONE,
'OW_CUSTOM_COMMAND(4);',
Button_Colour,
Bevel_Highlight,
Bevel_Shadow,
{
visible = true,
text = 'Spawn human',
}
);
game.hackPanel.button5 = getButtonEX_Basic(
game.hackPanel,
anchorL,
XYWH(10, 160, 280, 20),
SKINTYPE_NONE,
'OW_CUSTOM_COMMAND(5);',
Button_Colour,
Bevel_Highlight,
Bevel_Shadow,
{
visible = true,
text = 'Spawn vehicle',
}
);
game.hackPanel.button11 = getButtonEX_Basic(
game.hackPanel,
anchorL,
XYWH(10, 185, 280, 20),
SKINTYPE_NONE,
'OW_CUSTOM_COMMAND(11);',
Button_Colour,
Bevel_Highlight,
Bevel_Shadow,
{
visible = true,
text = 'Spawn apeman',
}
);
game.hackPanel.button6 = getButtonEX_Basic(
game.hackPanel,
anchorL,
XYWH(10, 215, 280, 20),
SKINTYPE_NONE,
'OW_CUSTOM_COMMAND(6);',
Button_Colour,
Bevel_Highlight,
Bevel_Shadow,
{
visible = true,
text = 'Set selected units invincible',
}
);
game.hackPanel.button7 = getButtonEX_Basic(
game.hackPanel,
anchorL,
XYWH(10, 240, 280, 20),
SKINTYPE_NONE,
'OW_CUSTOM_COMMAND(7);',
Button_Colour,
Bevel_Highlight,
Bevel_Shadow,
{
visible = true,
text = 'Set selected units invisible',
}
);
game.hackPanel.button8 = getButtonEX_Basic(
game.hackPanel,
anchorL,
XYWH(10, 265, 280, 20),
SKINTYPE_NONE,
'OW_CUSTOM_COMMAND(8);',
Button_Colour,
Bevel_Highlight,
Bevel_Shadow,
{
visible = true,
text = 'Change your side',
}
);
game.hackPanel.button9 = getButtonEX_Basic(
game.hackPanel,
anchorL,
XYWH(10, 290, 280, 20),
SKINTYPE_NONE,
'OW_CUSTOM_COMMAND(9);',
Button_Colour,
Bevel_Highlight,
Bevel_Shadow,
{
visible = true,
text = 'Change selected units side',
}
);
game.hackPanel.button10 = getButtonEX_Basic(
game.hackPanel,
anchorL,
XYWH(10, 320, 280, 20),
SKINTYPE_NONE,
'OW_CUSTOM_COMMAND(10);',
Button_Colour,
Bevel_Highlight,
Bevel_Shadow,
{
visible = true,
text = 'Fog off',
}
);
game.hackPanel.button12 = getButtonEX_Basic(
game.hackPanel,
anchorL,
XYWH(10, 345, 280, 20),
SKINTYPE_NONE,
'OW_CUSTOM_COMMAND(12);',
Button_Colour,
Bevel_Highlight,
Bevel_Shadow,
{
visible = true,
text = 'Boom!',
}
);
function showHackPanel()
if (not getVisible(game)) then
return;
end;
local MODE = getVisible(game.hackPanel);
if (not MODE) then
setVisible(game.hackPanel, true);
setX(game.hackPanel, 0);
else
setVisible(game.hackPanel, false);
end;
end;
function onMenuKeyPress(k)
if (k == 192) then
showHackPanel();
end;
end;
set_Callback(0, CALLBACK_KEYPRESS, 'onMenuKeyPress(%k)');
// Unlimited resources
Export Function HackUnlimitedResources;
var i, j, tmp;
begin
tmp := FilterAllUnits([[f_side, your_side], [f_or, [f_btype, b_depot], [f_btype, b_warehouse]]]);
if not tmp then
exit;
for i in tmp do
for j = 1 to 3 do
SetResourceType(GetBase(i), j, 99999);
End;