厉害救济

how to remove items from player

2 posts in this topic

private["_payload", "_player","_request","_result","_gethasBet","_source","_Type","_reward","_curReward","_ZBnum","_AInum","_AI_Total","_ZB_Total","_text","_vehicleObject","_lockerMoney","_playerMoney","_duihuanbi"];
_payload = _this;
try
{
 _player = _payload select 0;
 _request = _payload select 1;
 _ZBnum=
 
 switch (_request) do {
  case "GoldtoMoney":
 {
  _duihuanbi=100000;
     _playerMoney = _player getVariable ["ExileLocker", 0];
        _mags = magazines _player;
  
  if (magazines _player find 'goldbar' < 0) then
  {
    [_player, "toastRequest", ["SuccessTitleOnly", [format["you don not have gold bar "]]]] call ExileServer_system_network_send_to;
  }else{
  
 
          _player removeMagazine 'goldbar';
   _newplayerMoney=_playerMoney+_duihuanbi;
         _player setVariable ['ExileLocker',_newplayerMoney, true];
       format["updateLocker:%1:%2", _newplayerMoney, getPlayerUID _player] call ExileServer_system_database_query_fireAndForget;
      [_player, "toastRequest", ["SuccessTitleOnly", [format["you have exchanged a goldbar"]]]] call ExileServer_system_network_send_to;
  
  };
  
 };

Share this post


Link to post
Share on other sites
15 hours ago, 厉害救济 said:
private["_payload", "_player","_request","_result","_gethasBet","_source","_Type","_reward","_curReward","_ZBnum","_AInum","_AI_Total","_ZB_Total","_text","_vehicleObject","_lockerMoney","_playerMoney","_duihuanbi"];
_payload = _this;
try
{
 _player = _payload select 0;
 _request = _payload select 1;
 _ZBnum=
 
 switch (_request) do {
  case "GoldtoMoney":
 {
  _duihuanbi=100000;
     _playerMoney = _player getVariable ["ExileLocker", 0];
        _mags = magazines _player;
  
  if (magazines _player find 'goldbar' < 0) then
  {
    [_player, "toastRequest", ["SuccessTitleOnly", [format["you don not have gold bar "]]]] call ExileServer_system_network_send_to;
  }else{
  
 
          _player removeMagazine 'goldbar';
   _newplayerMoney=_playerMoney+_duihuanbi;
         _player setVariable ['ExileLocker',_newplayerMoney, true];
       format["updateLocker:%1:%2", _newplayerMoney, getPlayerUID _player] call ExileServer_system_database_query_fireAndForget;
      [_player, "toastRequest", ["SuccessTitleOnly", [format["you have exchanged a goldbar"]]]] call ExileServer_system_network_send_to;
  
  };
  
 };

try 

_player removeItem "goldbar";

 

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.