Giter Site home page Giter Site logo

cw-trading's Introduction

cw-trading ๐Ÿค

Package of two scripts to allow NPCs that trade items to other items or cash.

Ever felt like your QB server really needs someone who trades burritos for meth? or burgers for fried chicken? We gotcha! Easy setup. You only need to modify and add to the config files.

Developed by Coffeelot and Wuggie

More scripts by us ๐Ÿ‘ˆ

Support, updates and script previews:

Join The discord!

All our scripts are and will remain free. If you want to support what we do, you can buy us a coffee here:

Buy Us a Coffee

Preview

Video

How to use cw-traders ๐Ÿ›’

This script creates physical traders that uses the cw-trade script to. All you need to do is add the traders in the config.lua. Uses qb-target.

Using with cw-tokens ๐Ÿ”‘

At the top of the Config you will find Config.UseTokens = false. Change false to true if you want to use cw-tokens.

Trader objects

name: Variable name of the trader. Needs to be unique.
model: the model of the character (see link below)
tradeLabel: What shows up in game
tradeName: needs to match the unique variable name of the trade in cw-trades config that you want to use
coords: location of the trader
animation: How many items the traders gives (see link below)
available = {from, to}: This is optional! If you add this, the trader will only do the trade in the given timespan

ped models
animation pastebin

How to use cw-trade ๐Ÿ’ฐ

This script creates trades for cw-traders. All you need to do is add the trades in the config.lua. The script is separated so that you can use the same events for other

If you want to use rep and repType you need mz-skills. Otherwise REMOVE THESE PROPERTIES from your trades.

Trade objects

tradeName: Variable name of the trade. Needs to be unique.
fromItem: Variable name of the item the player give the trader (found in items.lua in qbcore)
fromAmount: How many items the traders takes
toItem: Variable name of the item the trader give the player (found in items.lua in qbcore)
toAmount: How many items the traders gives
toCash = {to, from}: This is optional! If you add this, it will let the trader give the player cash in the span between to and from for the item toBills This is optional! If you add this, it will let the trader give the player money rolls ('rolls') in the span between to and from for the item. You will need to add these in the items.lua for it to work:

	["rolls"] 					 = {["name"] = "rolls", 			 	["label"] = "Roll Of Small Notes", 		        ["weight"] = 100, 		["type"] = "item", 		["image"] = "cash_roll.png", 				["unique"] = false, 		["useable"] = false,		["created"] = nil,		["decay"] = nil, 	["shouldClose"] = false,   ["combinable"] = nil,   ["description"] = "Roll of Small Notes"},

cw-trading's People

Contributors

coffeelot avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.