Advertisement
Guest User

Untitled

a guest
Aug 19th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.42 KB | None | 0 0
  1. ['A3PL_Inventory_Give', {
  2.  
  3. disableSerialization;
  4. private ['_selection', '_classname', '_itemClass', '_itemDir', '_canUse', '_format',"_display", "_targetPlayerName", "_target"];
  5.  
  6. _display = findDisplay 1001;
  7.  
  8. _selection = lbCurSel 14571;
  9. _classname = lbData [14571, _selection];
  10.  
  11. _playerSelection = lbCurSel 14572;
  12. _targetPlayerName = lbText [14572, _playerSelection];
  13. _target = objectFromNetId (lbData [14572,_playerSelection]);
  14.  
  15. _itemClass = [_classname, 'class'] call A3PL_Config_GetItem;
  16. _name = [_classname, 'name'] call A3PL_Config_GetItem;
  17. _itemDir = [_classname, 'dir'] call A3PL_Config_GetItem;
  18.  
  19. if (_selection == -1) exitWith {};
  20. if (_playerSelection == -1) exitWith {
  21. ["Выберите кому хотите передать предмет!", Color_Red] call A3PL_Player_Notification;
  22. };
  23.  
  24. 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
  25. {
  26. ["Система: Вы не можете передавать вещи с поднятыми руками/в наручниках", Color_Red] call A3PL_Player_Notification;
  27. };
  28.  
  29. _amount = parseNumber (ctrlText (_display displayCtrl 14471));
  30. if (_amount < 1) exitWith
  31. {
  32. ["Введите значение больше 0!", Color_Red] call A3PL_Player_Notification;
  33. };
  34.  
  35. if ((getpos _target) distance (getpos player) > 1) exitwith { ["Система: Игрок слишком далеко",Color_Red] call A3PL_Player_Notification; };
  36.  
  37. if (!([_classname,_amount] call A3PL_Inventory_Has)) exitwith { ["Система: У вас недостаточное количество предмета",Color_Red] call A3PL_Player_Notification; };
  38.  
  39. [player, _classname, (0 - _amount)] remoteExec ["Server_Inventory_Add", 2];
  40. [_target, _classname, _amount] remoteExec ["Server_Inventory_Add", 2];
  41.  
  42. [format["Вам передали %1 %2",_amount,_name], Color_Green] remoteExec ["A3PL_Player_Notification",_target];
  43.  
  44. _format = format['Вы передали %1 %2 игроку %3', _amount, _name, _targetPlayerName];
  45. [_format, Color_Yellow] call A3PL_Player_Notification;
  46.  
  47. [0] call A3PL_Lib_CloseDialog;
  48.  
  49. }, false] call Server_Setup_Compile;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement