Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ['A3PL_Inventory_Give', {
- disableSerialization;
- private ['_selection', '_classname', '_itemClass', '_itemDir', '_canUse', '_format',"_display", "_targetPlayerName", "_target"];
- _display = findDisplay 1001;
- _selection = lbCurSel 14571;
- _classname = lbData [14571, _selection];
- _playerSelection = lbCurSel 14572;
- _targetPlayerName = lbText [14572, _playerSelection];
- _target = objectFromNetId (lbData [14572,_playerSelection]);
- _itemClass = [_classname, 'class'] call A3PL_Config_GetItem;
- _name = [_classname, 'name'] call A3PL_Config_GetItem;
- _itemDir = [_classname, 'dir'] call A3PL_Config_GetItem;
- if (_selection == -1) exitWith {};
- if (_playerSelection == -1) exitWith {
- ["Выберите кому хотите передать предмет!", Color_Red] call A3PL_Player_Notification;
- };
- if (animationState player IN ["A3PL_HandsupToKneel","A3PL_HandsupKneelGetCuffed","A3PL_Cuff","A3PL_HandsupKneelCuffed","A3PL_HandsupKneelKicked","A3PL_CuffKickDown","a3pl_idletohandsup","a3pl_kneeltohandsup","a3pl_handsuptokneel","A3PL_HandsupKneel"]) exitWith
- {
- ["Система: Вы не можете передавать вещи с поднятыми руками/в наручниках", Color_Red] call A3PL_Player_Notification;
- };
- _amount = parseNumber (ctrlText (_display displayCtrl 14471));
- if (_amount < 1) exitWith
- {
- ["Введите значение больше 0!", Color_Red] call A3PL_Player_Notification;
- };
- if ((getpos _target) distance (getpos player) > 1) exitwith { ["Система: Игрок слишком далеко",Color_Red] call A3PL_Player_Notification; };
- if (!([_classname,_amount] call A3PL_Inventory_Has)) exitwith { ["Система: У вас недостаточное количество предмета",Color_Red] call A3PL_Player_Notification; };
- [player, _classname, (0 - _amount)] remoteExec ["Server_Inventory_Add", 2];
- [_target, _classname, _amount] remoteExec ["Server_Inventory_Add", 2];
- [format["Вам передали %1 %2",_amount,_name], Color_Green] remoteExec ["A3PL_Player_Notification",_target];
- _format = format['Вы передали %1 %2 игроку %3', _amount, _name, _targetPlayerName];
- [_format, Color_Yellow] call A3PL_Player_Notification;
- [0] call A3PL_Lib_CloseDialog;
- }, false] call Server_Setup_Compile;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement