Advertisement
Guest User

fn_forceprice

a guest
Mar 26th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. #include "..\..\script_macros.hpp"
  2. /*
  3. ##################### DYNAMIC MARKET SCRIPT #####################
  4. ### AUTHOR: RYAN TT. ###
  5. ### STEAM: www.steamcommunity.com/id/ryanthett ###
  6. ### ###
  7. ### DISCLAIMER: THIS SCRIPT CAN BE USED ON EVERY SERVER ONLY ###
  8. ### WITH THIS HEADER / NOTIFICATION ###
  9. #################################################################
  10. */
  11. disableSerialization;
  12. _dialog = findDisplay 7000;
  13. _tochangeName = _dialog displayCtrl 7004;
  14. _tochangePrice = _dialog displayCtrl 7005;
  15.  
  16. _tochangeNameText = ctrlText _tochangeName;
  17. _tochangePriceText = ctrlText _tochangePrice;
  18. _tochangePriceNumber = parseNumber _tochangePriceText;
  19.  
  20. if ((_tochangeNameText=="")||(_tochangePriceText=="")) exitWith {hint parseText "<t color='#FF0000'>--ERROR--</t><br/><t color='#FF0000'>INVALID INPUT</t>";};
  21.  
  22. _exists = false;
  23.  
  24. {
  25. if (_tochangeNameText==_x select 0) then {_exists=true;};
  26. } forEach DYNMARKET_prices;
  27.  
  28. if (_exists) then {
  29. hint parseText "<t color='#01DF01'>--UPDATED--</t><br/><t color='#01DF01'>SUCCESSFULLY ADJUSTED THE PRICE, IT WILL UPDATE WITH THE NEXT PRICEUPDATES!</t>";
  30. [_tochangeNameText,_tochangePriceNumber] remoteExec ["TON_fnc_changePrice",RSERV];
  31. } else {
  32. hint parseText "<t color='#FF0000'>--ERROR--</t><br/><t color='#FF0000'>THE REQUESTED ITEM DOES NOT EXIST, MAYBE YOU MISSPELLED IT?</t>";
  33. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement