Skip to content

Commit

Permalink
Merge pull request #96 from JoSchaap/#YUNO_UPDATE
Browse files Browse the repository at this point in the history
Hotfix for issues found on releaseday


    money pickup
    group invites
    notifications of group invites
  • Loading branch information
JoSchaap committed Aug 1, 2013
2 parents 96f4bfa + 7a06cd9 commit e0e2f9c
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 55 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Initialise un véhicule transporteur
* Initialise un v�hicule transporteur
*
* @param 0 le transporteur
*/
Expand All @@ -14,14 +14,14 @@ if (isNil "_est_desactive") then
_transporteur setVariable ["R3F_LOG_disabled", false];
};

// Définition locale de la variable si elle n'est pas définie sur le réseau
// D�finition locale de la variable si elle n'est pas d�finie sur le r�seau
_objets_charges = _transporteur getVariable "R3F_LOG_objets_charges";
if (isNil "_objets_charges") then
{
_transporteur setVariable ["R3F_LOG_objets_charges", [], false];
};

_transporteur addAction [("<t color=""#06ef00"">" + STR_R3F_LOG_action_charger_deplace + "</t>"), "addons\R3F_ARTY_AND_LOG\R3F_LOG\transporteur\charger_deplace.sqf", nil, 6, true, true, "", "R3F_LOG_objet_addAction == _target && R3F_LOG_action_charger_deplace_valide"];
_transporteur addAction [("<img image=""client\icons\r3f_loadin.paa""/> <t color=""#06ef00"">" + STR_R3F_LOG_action_charger_deplace + "</t>"), "addons\R3F_ARTY_AND_LOG\R3F_LOG\transporteur\charger_deplace.sqf", nil, 6, true, true, "", "R3F_LOG_objet_addAction == _target && R3F_LOG_action_charger_deplace_valide"];

_transporteur addAction [("<img image=""client\icons\r3f_loadin.paa""/> <t color=""#06ef00"">" + STR_R3F_LOG_action_charger_selection + "</t>"), "addons\R3F_ARTY_AND_LOG\R3F_LOG\transporteur\charger_selection.sqf", nil, 6, true, true, "", "R3F_LOG_objet_addAction == _target && R3F_LOG_action_charger_selection_valide"];

Expand Down
104 changes: 57 additions & 47 deletions client/actions/pickupMoney.sqf
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.";
};
};
};
3 changes: 2 additions & 1 deletion client/functions/clientCompile.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ onKilled = compile preprocessfile "client\clientEvents\onKilled.sqf";
onKeyPress = compile preprocessFile "client\clientEvents\onKeyPress.sqf";
fn_fitsInventory = compile preprocessFileLineNumbers "client\functions\fn_fitsInventory.sqf";
findHackedVehicles = compileFinal preprocessFileLineNumbers "client\systems\adminPanel\findHackedVehicles.sqf";
serverMessage = compile preprocessFileLineNumbers "client\functions\serverMessage.sqf";
serverMessage = compileFinal preprocessFileLineNumbers "client\functions\serverMessage.sqf";
titleTextMessage = compileFinal preprocessFileLineNumbers "client\functions\titleTextMessage.sqf";

// Player details and actions
loadPlayerMenu = compile preprocessFile "client\systems\playerMenu\init.sqf";
Expand Down
6 changes: 6 additions & 0 deletions client/functions/titleTextMessage.sqf
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];
2 changes: 1 addition & 1 deletion client/systems/adminPanel/playerSelect.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ if ((_uid in moderators) OR (_uid in administrators) OR (_uid in serverAdministr
{
_warnText = ctrlText _warnMessage;
_playerName = name player;
[_warnText, "adminMessage", _target, false] call TPG_fnc_MP;
[format ["Message from Admin: %1", _warnText], "titleTextMessage", _target, false] call TPG_fnc_MP;
};
case 2: //Slay
{
Expand Down
5 changes: 3 additions & 2 deletions client/systems/groups/inviteToGroup.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,6 @@ diag_log "Invite to group: After the checks";
currentInvites set [count currentInvites,[getPlayerUID player,getPlayerUID _target]];
publicVariableServer "currentInvites";

_target groupChat format["You have been invited to join %1's group",name player];
player globalChat format["you have invited %1 to join the group",name _target];
[format ["You have been invited to join a group!"], "titleTextMessage", _target, false] call TPG_fnc_MP;

player globalChat format["You have invited %1 to join the group", name _target];
2 changes: 1 addition & 1 deletion server/antihack/remote/fn_MPexec.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ if (ismultiplayer && _mode == 0) then {
{
private ["_allowedFunctions", "_blockedParams", "_blockedFunction", "_defineServerRules"];

_allowedFunctions = ["chatBroadcast", "checkHackedVehicles", "flagHandler", "clientFlagHandler", "adminMessage"];
_allowedFunctions = ["chatBroadcast", "checkHackedVehicles", "flagHandler", "clientFlagHandler", "titleTextMessage"];

_blockedParam = [["createMine","createUnit","createVehicle","money","toString","publicVariableClient","AAN","3dCredits","spawnCrew","spawnEnemy","spawnGroup","spawnVehicle","BIS_fnc_MP_packet"], [str _params] call fn_filterString] call fn_findString;
_blockedFunction = [["creat","spawning","AAN","3dCredits","spawnCrew","spawnEnemy","spawnGroup","spawnVehicle"], [_functionName] call fn_filterString] call fn_findString;
Expand Down

0 comments on commit e0e2f9c

Please sign in to comment.