Advertisement
Guest User

123123

a guest
Apr 1st, 2015
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. /*
  2.  
  3. Commits player money values to Money Over Time system and says to system that the money, the player will receive is OK
  4.  
  5. f[money,reason, uid, name]
  6.  
  7. */
  8.  
  9. private["_cash","_bank","_player","_index","_zeromoney","_arr","_deltat","_delta","_old","_new","_oldtime","_time_diff","_money_time_over_full","_money_time_over_mot","_message","_money","_checktresholds","_result","_query","_uid","_pname","_reason"];
  10.  
  11. _money = _this select 0;
  12. _reason = _this select 1;
  13. _uid = _this select 2;
  14. _pname = [_this, 3, "<NONAME>"] call BIS_fnc_param;
  15.  
  16. if(typeName _money == "STRING") then { _money = parseNumber _money; };
  17.  
  18. //Find index
  19. _index = -1;
  20.  
  21. {
  22. if((_x select 0) == _uid) exitWith
  23. {
  24. _index = _forEachIndex;
  25. };
  26. }
  27. foreach anticheat_mot_values;
  28.  
  29. //Add value
  30. if(_index == -1) then
  31. {
  32. // 0 1 2 3
  33. //Schema: uid, money_earned, money_zero, time
  34. anticheat_mot_values set [count anticheat_mot_values, [_uid, 0, _money, time] ];
  35. _checktresholds = false;
  36. }
  37. else
  38. {
  39. _arr = anticheat_mot_values select _index;
  40.  
  41. _zeromoney = _arr select 2;
  42. _oldtime = _arr select 3;
  43.  
  44. _arr set [2, _zeromoney + _money];
  45.  
  46. diag_log format["<* ANTICHEAT-MOT *> Player %1 (id: %2) will receive valid money $%3 (Reason: %5). Updated Zero to %4", _pname,_uid,
  47. [_money] call life_fnc_numberText,
  48. [_zeromoney + _money] call life_fnc_numberText,
  49. _reason];
  50. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement