Csus Posted May 28, 2014 Report Share Posted May 28, 2014 So version 2.0 is finally here! Woooo :D It's a giant improvement over the last version, no more manual labour to get it working! Just plug and play. Features - Select to either sell weapons, sell magazines or sell all items from your vehicle. Select to either sell weapons, sell magazines or sell all items from your backpack. Combine Currency - Takes the player's money and tries to reduce the amount of items while still keep the same value. Example, 5 * 10oz Gold would turn into a Briefcase with 5 * 10oz gold inside. Safe trading, locks your vehicle during trade and the trade is cancelled if, somehow, the vehicle moves, is entered by a player or the gear is changed. It also cancels trading from your backpack if your backpacks gear is changed in some way. If a weapon or magazine cannot be sold at that trader normally, it won't be sold using this script either. If you don't have the right humanity to trade with a trader normally, you can't trade using this either. Things you can modify - You can disable or enable trading from backpack, trading from vehicle and combine currency. You can modify the trading speeds of both magazines and weapons. You can disable or enable the trading of toolbelt items. (These are classed as weapons, keys will ALWAYS be safe.) HOTFIX - Now compatible with Piggd's Banking System. Also shaved 7kb from the file size. Update 0.1 - Added ability to disable trading from vehicle. Improved the maths behind calculationg trading stages. Improved the checks made on weapons/magazines when calculating trading stages. The 'Combine Money' action will no longer show when you only have one currency item in your inventory. This will ALWAYS sell weapons and magazines for the correct price, the exact selling price you have in your database. A newer video will be uploaded as soon as I can do it. Download the files here! Installation and setup instructions are in the download, but it's incredibly easy. -Dwarfer's Version- You can also find an 'unofficial' (also, probably better) version of this script here! This version adds compatability with both config traders and Zupa's Single Currency. It also adds a 'taxing' mechanic. Massive, massive thanks to Dwarfer! People like him are the reason this community is damn good! All posts after this one are regarding the current version. https://www.youtube.com/watch?v=E5gn7-uA7UU Cinjun, Webrene, DeliciousAce and 7 others 10 Link to comment Share on other sites More sharing options...
boyd Posted May 28, 2014 Report Share Posted May 28, 2014 Very interesting, im gonna give this a try. Link to comment Share on other sites More sharing options...
collumjiggas Posted May 28, 2014 Report Share Posted May 28, 2014 My users will love this! It will have to be added asap. I'll post back when I do. Link to comment Share on other sites More sharing options...
fr1nk Posted May 28, 2014 Report Share Posted May 28, 2014 Very nice! Link to comment Share on other sites More sharing options...
Gr8 Posted May 28, 2014 Report Share Posted May 28, 2014 yay, been waiting for this, thanks @Csus Link to comment Share on other sites More sharing options...
Gr8 Posted May 28, 2014 Report Share Posted May 28, 2014 Will this conflict if we put different trader prices than the database? probably not :) Is there an easier way of finding out which weps did i add rather than the defualt epoch weapons, becuase i added in too many and i cant remember. Do I have to remove any weps from your list if they are custom on your server ? Thanks, for the awesome script. I think you should put a note on the animation per items that putting this to a high value will put pressure on the database and can lag trading for others. (does this use the database at all?) Link to comment Share on other sites More sharing options...
bFe Posted May 28, 2014 Report Share Posted May 28, 2014 This is great! Link to comment Share on other sites More sharing options...
Csus Posted May 28, 2014 Author Report Share Posted May 28, 2014 @ Gr8Boi Yeah, you should completely modify the weapons and prices to matchs your server. It will never conflict with anything you put in your database, it never reads or writes from there. The way I found the weapons I want to add is just by using the 'Spawn Weapons' list of infiSTAR to find the proper weapon name, so if you can use that or a similar method that would be most efficient. You can change tfv_SALES_PER_ANIM to any value you like (greater than 0), it will never cause lag. Unless they're playing on an Amiga XD Your databse will never be lagged and any lag caused will always be local lag. I highly doubt it will lag though. I'm glad you all like it! :D Link to comment Share on other sites More sharing options...
Gr8 Posted May 28, 2014 Report Share Posted May 28, 2014 Well, looks like it doesnt work on mine. This is my init and RPT doesnt show any errors Link to comment Share on other sites More sharing options...
Csus Posted May 28, 2014 Author Report Share Posted May 28, 2014 @ Gr8Boi I think your problem is on line 19. After a quick search of character models, I found that 'BAF_Soldier_AAA_MT' is not a proper model. Try another trader and if it works fine then your problem is just a typo. Link to comment Share on other sites More sharing options...
Gr8 Posted May 28, 2014 Report Share Posted May 28, 2014 @ Gr8Boi I think your problem is on line 19. After a quick search of character models, I found that 'BAF_Soldier_AAA_MT' is not a proper model. Try another trader and if it works fine then your problem is just a typo. Its not "BAF_Soldier_AAA_MT" its "BAF_Soldier_AAA_MTP" Typo on your part Link to comment Share on other sites More sharing options...
Gr8 Posted May 28, 2014 Report Share Posted May 28, 2014 Well, i figured it out, Instead of linking the script right under Dedicated loop. I put it at the end before }; Thanks for the awesome script. What are the whitelist action names for infistar AH? Link to comment Share on other sites More sharing options...
Csus Posted May 28, 2014 Author Report Share Posted May 28, 2014 I never had to whitelist any actions for infistar, I've not had any issues with either infistar on battleye. Link to comment Share on other sites More sharing options...
robbiedarza Posted May 28, 2014 Report Share Posted May 28, 2014 Thanks for this, very popular on my server Many thanks Robbie Link to comment Share on other sites More sharing options...
Csus Posted May 29, 2014 Author Report Share Posted May 29, 2014 has anybody found any problems with this at all? i gots to know Link to comment Share on other sites More sharing options...
jackislost Posted May 29, 2014 Report Share Posted May 29, 2014 is there a way that you can sell only from one type of vehicle, like urals.? Link to comment Share on other sites More sharing options...
jackislost Posted May 29, 2014 Report Share Posted May 29, 2014 like if ((vehicle player == player) && (_ownsCar) && (_isUral)) then { ? Link to comment Share on other sites More sharing options...
Csus Posted May 29, 2014 Author Report Share Posted May 29, 2014 yeah, you could. something like this - in the init create a variable called 'tfv_ALLOWED_VEHICLES'. then add the vehicles to this, e.g - tfv_ALLOWED_VEHICLES = ["UralCivil","Horse_Carriage","Flying_Saucer_DES_EP1_DZE"]; then in the monitor.sqf add a new variable to line 3 called '_isAllowed', it should look like this - private ["_vehicle","_crew","_driver","_ownsCar","_trader","_trader_obj","_isAllowed"]; next, add this directly below line 19 _isAllowed = (typeOf _vehicle) in tfv_ALLOWED_VEHICLES; so line 19 to 27 should look like - if (vehicle player != player) then { //Check if the player was in the driver seat. _vehicle = vehicle player; _isAllowed = (typeOf _vehicle) in tfv_ALLOWED_VEHICLES; _crew = crew _vehicle; _driver = _crew select 0; if (player == _driver) then { _ownsCar = true; } else { _ownsCar = false; }; }; now, you just gotta change this line - if ((vehicle player == player) && (_ownsCar)) then { to this - if ((vehicle player == player) && (_ownsCar)&&(_isAllowed)) then { this should work just nicley for you jackislost 1 Link to comment Share on other sites More sharing options...
jackislost Posted May 30, 2014 Report Share Posted May 30, 2014 Well, i figured it out, Instead of linking the script right under Dedicated loop. I put it at the end before }; Thanks for the awesome script. What are the whitelist action names for infistar AH? I got the same problem than you. Default files, no errors, no debug. Like it just wont run. Tried what u say, nothing. Link to comment Share on other sites More sharing options...
Csus Posted May 30, 2014 Author Report Share Posted May 30, 2014 this is a chunk of my init.sqf //Load in compiled functions call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\variables.sqf"; //Initilize the Variables (IMPORTANT: Must happen very early) progressLoadingScreen 0.1; call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\publicEH.sqf"; //Initilize the publicVariable event handlers progressLoadingScreen 0.2; call compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\setup_functions_med.sqf"; //Functions used by CLIENT for medical progressLoadingScreen 0.4; call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf"; //Compile regular functions progressLoadingScreen 0.5; call compile preprocessFileLineNumbers "server_traders.sqf"; //Compile trader configs progressLoadingScreen 1.0; "filmic" setToneMappingParams [0.153, 0.357, 0.231, 0.1573, 0.011, 3.750, 6, 4]; setToneMapping "Filmic"; if (isServer) then { //Compile vehicle configs call compile preprocessFileLineNumbers "\z\addons\dayz_server\missions\DayZ_Epoch_24.Napf\dynamic_vehicle.sqf"; // Add trader citys _nil = [] execVM "\z\addons\dayz_server\missions\DayZ_Epoch_24.Napf\mission.sqf"; _serverMonitor = [] execVM "\z\addons\dayz_code\system\server_monitor.sqf"; }; if (!isDedicated) then { [] ExecVM "TradeFromVehicle\init.sqf"; // <<<< Line to launch TradeFromVehicle script [10] ExecVM "AutoEpi\AutoEpi.sqf"; //Conduct map operations 0 fadeSound 0; waitUntil {!isNil "dayz_loadScreenMsg"}; dayz_loadScreenMsg = (localize "STR_AUTHENTICATING"); //Run the player monitor _id = player addEventHandler ["Respawn", {_id = [] spawn player_death;}]; _playerMonitor = [] execVM "\z\addons\dayz_code\system\player_monitor.sqf"; }; as long as you have the ExecVM line around the same place I do it should work pefectly. Link to comment Share on other sites More sharing options...
Bambit Posted May 30, 2014 Report Share Posted May 30, 2014 Csus (I like how this chord sounds ;P) Do you mind if I change it to backpack selling? Link to comment Share on other sites More sharing options...
sisquo007 Posted May 30, 2014 Report Share Posted May 30, 2014 This is so awesome!! ppl love it on my server! It works without issues when u have setup the config correctly. it only sells weapons which the trader support! (love this) Realy good work! It would be more awesome if u could trade magazines too! Is this possible to come in future updates?? Link to comment Share on other sites More sharing options...
Csus Posted May 30, 2014 Author Report Share Posted May 30, 2014 @sisquo007 I could add magazine selling to it, i'll get that out as soon as i can :) @Bambit After nearly 10 years of using this name in games and generally everywhere online, someone finally knows what it is :D And, if you know how to adjust it to sell from your backpack, you're more than welcome to do so. Let me know how it goes! Link to comment Share on other sites More sharing options...
Mugzy Posted May 30, 2014 Report Share Posted May 30, 2014 Don't want to have to hand update the gun list for this mod? I came up with the SQL needed to generate the list. First you will need a split function: CREATE FUNCTION SPLIT_STR( x VARCHAR(255), delim VARCHAR(12), pos INT ) RETURNS VARCHAR(255) RETURN REPLACE(SUBSTRING(SUBSTRING_INDEX(x, delim, pos), LENGTH(SUBSTRING_INDEX(x, delim, pos -1)) + 1), delim, ''); Then just run the query below and copy the results into the init array. SELECT item, case SPLIT_STR(sell,',',2) when '\"ItemGoldBar10oz\"' then (concat(SPLIT_STR(item,',',1) ,',',replace(SPLIT_STR(sell,',',1),'[','')*1000,'],') ) when '\"ItemGoldBar\"' then (concat(SPLIT_STR(item,',',1) ,',',replace(SPLIT_STR(sell,',',1),'[','')*100,'],') ) when '\"ItemSilverBar10oz\"' then (concat(SPLIT_STR(item,',',1) ,',',replace(SPLIT_STR(sell,',',1),'[','')*10,'],') ) when '\"ItemSilverBar\"' then (concat(SPLIT_STR(item,',',1) ,',',replace(SPLIT_STR(sell,',',1),'[',''),'],') ) end as list FROM traders_data where afile in ('trade_weapons','trade_items') group by item order by list Link to comment Share on other sites More sharing options...
Csus Posted May 30, 2014 Author Report Share Posted May 30, 2014 SQL makes my brain melt, but if that does what I think it does, it's frikkin awesome! Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now