-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #96 from JoSchaap/#YUNO_UPDATE
Hotfix for issues found on releaseday money pickup group invites notifications of group invites
- Loading branch information
Showing
7 changed files
with
73 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,86 @@ | ||
// @file Version: 1.1 | ||
// @file Name: pickupMoney.sqf | ||
// @file Author: [404] Deadbeat, [404] Costlyy | ||
// @file Author: [404] Deadbeat, [404] Costlyy, AgentRev | ||
// @file Date modified: 07/12/2012 05:19 | ||
// @file Args: | ||
|
||
// Check if mutex lock is active. | ||
if(mutexScriptInProgress) exitWith | ||
if (mutexScriptInProgress) exitWith | ||
{ | ||
player globalChat "YOU ARE ALREADY PERFORMING ANOTHER ACTION!"; | ||
player globalChat "You are already performing another action."; | ||
}; | ||
|
||
_totalDuration = 2; | ||
_lockDuration = _totalDuration; | ||
_originalState = animationState player; | ||
mutexScriptInProgress = true; | ||
|
||
_moneyObject = (nearestobjects [getpos player, ["Land_Sack_F"], 5] select 0); | ||
if((_moneyObject getVariable "owner") == "world") then | ||
private ["_bagDistance", "_lockDuration", "_originalState", "_moneyBags", "_moneyBag", "_money"]; | ||
|
||
_bagDistance = 5; | ||
_lockDuration = 3; | ||
_originalState = animationState player; | ||
|
||
_moneyBags = nearestObjects [player, ["Land_Sack_F"], _bagDistance]; | ||
|
||
if (count _moneyBags > 0) then | ||
{ | ||
_moneyObject setVariable ["owner", getPlayerUID player, true]; | ||
_moneyBag = _moneyBags select 0; | ||
}; | ||
|
||
for "_iteration" from 1 to _lockDuration do | ||
{ | ||
if((_moneyObject getVariable "owner") != getPlayerUID player) exitWith | ||
{ | ||
player globalChat "This object is already in use."; | ||
mutexScriptInProgress = false; | ||
}; | ||
|
||
if(vehicle player != player) exitWith | ||
if (isNil "_moneyBag") exitWith | ||
{ | ||
player globalChat "You are too far to pick the money up."; | ||
mutexScriptInProgress = false; | ||
}; | ||
|
||
if (!((toLower (_moneyBag getVariable ["owner", ""])) in ["world", getPlayerUID player])) exitWith | ||
{ | ||
player globalChat "This object is already in use."; | ||
mutexScriptInProgress = false; | ||
}; | ||
|
||
_moneyBag setVariable ["owner", getPlayerUID player, true]; | ||
|
||
for "_i" from 1 to _lockDuration do | ||
{ | ||
if (vehicle player != player) exitWith | ||
{ | ||
player globalChat "You can't pick up money whilst in a car"; | ||
player globalChat "You can't pick up money while in a vehicle."; | ||
player action ["eject", vehicle player]; | ||
sleep 1; | ||
_moneyBag setVariable ["owner", "world", true]; | ||
mutexScriptInProgress = false; | ||
|
||
_moneyObject setVariable ["owner", "world", true]; | ||
}; | ||
|
||
}; | ||
|
||
if (animationState player != "AinvPknlMstpSlayWrflDnon_medic") then | ||
{ | ||
player switchMove "AinvPknlMstpSlayWrflDnon_medic"; | ||
}; | ||
|
||
_lockDuration = _lockDuration - 1; | ||
|
||
sleep 1; | ||
if(player distance (nearestobjects [player, ["Land_Sack_F"], 5] select 0) > 5) exitWith | ||
if (player distance _moneyBag > _bagDistance) exitWith | ||
{ | ||
_moneyBag setVariable ["owner", "world", true]; | ||
player switchMove _originalState; | ||
mutexScriptInProgress = false; | ||
_moneyObject setVariable ["owner", "world", true]; | ||
player globalChat "You are too far to pick the money up."; | ||
}; | ||
if (_iteration >= _totalDuration) exitWith | ||
|
||
if (_i >= _lockDuration) exitWith | ||
{ | ||
sleep 1; | ||
_currMoneyTemp = (nearestObjects [getpos player, ["Land_Sack_F"], 5]); | ||
|
||
if(count _currMoneyTemp == 0) then | ||
_money = _moneyBag getVariable ["money", 0]; | ||
deleteVehicle _moneyBag; | ||
if (_money < 0) then { _money = 0 }; | ||
player setVariable ["cmoney", (player getVariable ["cmoney", 0]) + _money, true]; | ||
player switchMove _originalState; | ||
mutexScriptInProgress = false; | ||
|
||
if (_money > 0) then | ||
{ | ||
player globalChat format["You failed to pick the money up"]; | ||
mutexScriptInProgress = false; | ||
_moneyObject setVariable ["owner", "world", true]; | ||
} else { | ||
_money = 0; //fix for scalar value error if a bag contains no money variable | ||
_money = ((nearestobjects [getpos player, ["Land_Sack_F"], 5] select 0) getVariable "money"); | ||
deleteVehicle (nearestobjects [getpos player, ["Land_Sack_F"], 5] select 0); | ||
player setVariable["cmoney", (player getVariable "cmoney")+_money,true]; | ||
player globalChat format["You have picked up $%1",_money]; | ||
mutexScriptInProgress = false; | ||
player switchMove _originalState; | ||
}; | ||
}; | ||
player globalChat format ["You have picked up $%1", _money]; | ||
} | ||
else | ||
{ | ||
player globalChat "The money bag is empty."; | ||
}; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// @file Version: 1.0 | ||
// @file Name: titleTextMessage.sqf | ||
// @file Author: AgentRev | ||
// @file Date modified: 31/07/2013 23:41 | ||
|
||
titleText [_this, "PLAIN", 0]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters