Skip to content

Commit 8d6024c

Browse files
author
ole
committed
replaced single weapon prize with know crates, like Box_NATO_Wps_F
1 parent 1b8a6ce commit 8d6024c

File tree

6 files changed

+16
-75
lines changed

6 files changed

+16
-75
lines changed
-2.07 KB
Binary file not shown.

source/scratchie_server/bootstrap/fn_preInit.sqf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ forEach
2121
[
2222
['ExileServer_lottery_network_request', 'x\scratchie_server\code\ExileServer_lottery_network_request.sqf'],
2323
['ExileServer_lottery_network_winner', 'x\scratchie_server\code\ExileServer_lottery_network_winner.sqf'],
24-
['ExileServer_lottery_crate_xtras', 'x\scratchie_server\code\ExileServer_lottery_crate_xtras.sqf'],
2524
['ExileServer_lottery_generate', 'x\scratchie_server\code\ExileServer_lottery_generate.sqf']
2625
];
2726

source/scratchie_server/code/ExileServer_lottery_crate_xtras.sqf

Lines changed: 0 additions & 40 deletions
This file was deleted.

source/scratchie_server/code/ExileServer_lottery_network_request.sqf

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ try
3636
_prize = format ["getLotteryPrize:%1", getPlayerUID _player] call ExileServer_system_database_query_selectSingle;
3737

3838
if !(isNil "_prize") then
39-
{
40-
format ["setPrizeDelivered:%1", getPlayerUID _player] call ExileServer_system_database_query_fireAndForget;
41-
39+
{
4240
switch (_prize select 1) do
4341
{
4442
case "VehiclePrize":
@@ -79,20 +77,20 @@ try
7977
// find a safe position
8078
_safepos = [position _player, 5, 80, 3, 0, 20, 0] call BIS_fnc_findSafePos;
8179

82-
_vehicleObject = createVehicle ["Box_NATO_Wps_F", _safepos, [], 0, "CAN_COLLIDE"];
83-
_vehicleObject addWeaponCargoGlobal [_prize select 0, 1];
84-
85-
[_vehicleObject, _prize select 0] call ExileServer_lottery_crate_xtras;
80+
_vehicleObject = createVehicle [_prize select 0, _safepos, [], 0, "CAN_COLLIDE"];
8681

8782
// teleport player to the crate
8883
_player setPosATL [(_safepos select 0) - 1, _safepos select 1, 0];
8984
// do a spawn and sleep X minutes until crate will be deleted
9085
[_vehicleObject, _rand] spawn { sleep (_this select 1); deleteVehicle (_this select 0); };
9186
// inform the player
92-
[_player, "dynamicTextRequest", [format ["YOUR PRIZE SPAWND IN THE CRATE<br/><br/>Lifetime %1 minute(s)", round(_rand / 60)], 0, 2, "#ffffff"]] call ExileServer_system_network_send_to;
87+
[_player, "dynamicTextRequest", [format ["Crate spawned in front of you<br/><br/>Lifetime %1 minute(s)", round(_rand / 60)], 0, 2, "#ffffff"]] call ExileServer_system_network_send_to;
9388
};
9489
};
9590

91+
// mark the prize as delivered
92+
format ["setPrizeDelivered:%1", getPlayerUID _player] call ExileServer_system_database_query_fireAndForget;
93+
9694
} else {
9795
[_player, "toastRequest", ["InfoTitleOnly", ["No prize for you :-("]]] call ExileServer_system_network_send_to;
9896
};

source/scratchie_server/code/ExileServer_lottery_network_winner.sqf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ try
6060
_text = "%1 won " + (str _curPrize) + " poptabs";
6161
};
6262
case "WeaponPrize": {
63-
_text = "%1 won " + getText(configFile >> "CfgWeapons" >> _curPrize >> "displayName");
63+
_text = "%1 won " + getText(configFile >> "CfgVehicles" >> _curPrize >> "displayName") + " crate";
6464
};
6565
default { _text = "%1 won a prize"; };
6666
};
@@ -78,7 +78,7 @@ try
7878
["dynamicTextRequest", [format [_text, name _x], 0, 2, "#ffffff"]] call ExileServer_system_network_send_broadcast;
7979
};
8080
// tell it to the winner explicitly
81-
[_x, "dynamicTextRequest", [format [_text, "You have"], 0, 2, "#ffffff"]] call ExileServer_system_network_send_to;
81+
[_x, "dynamicTextRequest", [format [_text, "You "], 0, 2, "#ffffff"]] call ExileServer_system_network_send_to;
8282
} forEach _winners;
8383
};
8484

source/scratchie_server/config.cpp

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/**
22
* Scratchie - Lottery like minigame for Exile Mod
33
* @author ole1986 - https://github.com/ole1986/a3-exile-scratchie
4-
* @version 0.6
54
*/
65

76
class CfgPatches {
@@ -60,12 +59,7 @@ class CfgSettings
6059
* @var int ItemPrize lifetime - How long is the crate available for item prizes (default: 180 sec = 3 minutes)
6160
*/
6261
CrateLifetime = 180;
63-
64-
/**
65-
* @var int how many items are being added into crate (0 = only weapon plus magazines, 1 = weapon + magazine + 1 item from the ItemPrize list)
66-
*/
67-
ItemsPerCrate = 3;
68-
62+
6963
/**
7064
* Possible Types to win
7165
*/
@@ -109,27 +103,17 @@ class CfgSettings
109103
75000,
110104
100000
111105
};
112-
106+
113107
/**
114-
* @var array list of Item prizes - Check out the ExileServer_lottery_crate_xtras.sqf for a proper ammunation
108+
* @var array known crates containing weapons already which can be the prize for weapon types
115109
*/
116110
WeaponPrize[] = {
117-
"LMG_Zafir_F",
111+
"Box_NATO_Wps_F",
118112
/*"launch_NLAW_F",*/ /* i dont like rocket launchers */
119-
"LMG_Mk200_MRCO_F",
120-
"srifle_GM6_LRPS_F"
121-
};
122-
123-
/**
124-
* @var array list of Items additionally inserted into crates on weapon prizes
125-
*/
126-
ItemPrize[] = {
127-
"Exile_Item_SafeKit",
128-
"Exile_Item_CodeLock",
129-
"optic_DMS",
130-
"U_I_GhillieSuit",
131-
"H_HelmetSpecB_paint2",
132-
"Exile_Item_InstaDoc"
113+
"Box_NATO_WpsSpecial_F",
114+
"Box_East_WpsSpecial_F",
115+
"Box_East_Wps_F",
116+
"Box_IND_WpsSpecial_F"
133117
};
134118
};
135119
};

0 commit comments

Comments
 (0)