Jump to content

[RELEASE] TradeFromVehicle - Version 2.0 is here!


Csus

Recommended Posts

It truly is unfortunate that this script doesn't use the trader items and prices already set in the database. The hassle alone of having to add any custom items, and match up trader prices, especially if the server has a customized economy, is enough for me not to bother with this script.

 

Don't get me wrong, it's an awesome concept, and yes, definitely makes the players lives a lot easier, but the simple fact that it could take hours of setup for me, the server admin, completely turns me off.

 

Maybe look into doing a database lookup in the traders_data table for the item and item price instead of setting it in your script. For any server admin who has a custom economy and has customized prices on items, this would save A LOT of setup time.

There is a SQL split function posted earlier that does take about half of the work out of setting up prices. Mine created 4 entries for everything but I can't be sure I did everything right either. I'd agree though that a tool to pull trader names, the class names of the items they sell, and the prices and automatically drop them into a file would be key to making this a widespread and easy to use tool.

Link to comment
Share on other sites

i tested this script and it works fine and i think my player gonna love it.

but there's one thing that bothers me...... no humanity check.

it is now possible to sell your weapons as hero at the bandit dealer

the buy menu is still blocked (your humanity is to blablabla...), but the "trade from vehicle" is shown and works

Link to comment
Share on other sites

i tested this script and it works fine and i think my player gonna love it.

but there's one thing that bothers me...... no humanity check.

it is now possible to sell your weapons as hero at the bandit dealer

the buy menu is still blocked (your humanity is to blablabla...), but the "trade from vehicle" is shown and works

i'll implement this ASAP

Link to comment
Share on other sites

updated the files, can now use a humanity restriction on traders. check documentation.txt or the default init.sqf to see how to implement the humanity requirement on your existing init.sqf

Link to comment
Share on other sites

updated the files, can now use a humanity restriction on traders. check documentation.txt or the default init.sqf to see how to implement the humanity requirement on your existing init.sqf

 

wow, that was fast.

i tested it and it works correct :)

 

but i found a problem.

cars get locked while trading and unlock after it

but if your car is empty and you try to trade, it canceled and your car doesn't unlocked again

Link to comment
Share on other sites

yeah, in your mission.sqm file at around line 1300 you'll see something like this -

	class Sensors
	{
		items=10;
		class Item0
		{
			position[]={8246.3184,15.544708,15485.867};
			activationBy="WEST";
			repeating=1;
			interruptable=1;
			age="UNKNOWN";
			name="Lenz";
			expCond="(player distance Lenz) < 50;";
			expActiv="TitleText[""Now Entering Trader City Lenzburg"",""PLAIN DOWN""]; canbuild = false;";
			expDesactiv="TitleText[""Now Leaving Trader City Lenzburg"",""PLAIN DOWN""]; canbuild = true;";
			class Effects
			{
			};
		};

mine is for napf but the differences are trivial.

now find the chunks of code in that section that are to do with your trader cities and make the expActiv and expDesactiv look like mine by puttin the canbuild=true/false on the end of them

 

that should get it working for you :)

Link to comment
Share on other sites

i updated the 'documentation.txt' file to include a few fixes for common problems aswell as the SQL function created by Mugzy. Big big thanks to him for creating that :D gave him the credit he deserves in the 'documentation.txt' file :D

Link to comment
Share on other sites

ran this as a query in navicat.. did i do something wrong?
 
 
     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, '');
[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'x VARCHAR(255),
    delim VARCHAR(12),
    pos INT
    )
    RETURNS VARCHAR' at line 1
Link to comment
Share on other sites

    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, '');

that's my fault, sorry. when I put that in the files I must have missed the top line. i'll update the files right away!

Link to comment
Share on other sites

on line 30 -

["MVD_Soldier_Marksman"

at the end of that line, remove the comma ;)

 

took me a while to realise that you were referring to the 'systemChat' lines with the count to four.

i just spent 10 minutes being so confused XD

Link to comment
Share on other sites

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
  • Advertisement
×
×
  • Create New...