Configuration
This is the configuration that you can give to this script to modify it to your liking
Change in Config.Framework your Framework
Config.Framework = 'qb-core' --- You can change Framework 'esx' or 'qb-core'
Config File
Config = {}
Config.Framework = 'qb-core' --- 'esx' and 'qb-core'
Config.Command = 'partner'
Config.OpenCoinsKey = 'U'
Config.LogoURL = 'https://i.imgur.com/934b8Oa.png'
Config.MysqlAsync = true -- Set true if you use Mysql-Async and false if you use ghmattimysql, if you don't know what is the difference, then you probably use Mysql-Async and you shouldn't change this.
Config.EveryoneCanCreate = true --Put true if you prefer that everyone can create a referalcode, if you put false, then nobody can create codes only you can do it through the database
Config.CodeMaxLength = 8 --The maximum length of the code (only aplicable if Config.EveryoneCanCreate == true)
Config.Identifier = "license" --The identifier system that you use in your server. It can be: steam or license THIS IS IMPORTANT. You should put here what your es_extended use. (Don't put any slashes(/) in here.)
------------ Command Function ---------------
Config.CreateCommandCode = "codigopartner"--This is only aplicable if Config.EveryoneCanCreate == true. This command is the command that will allow the players to create their own codes. This will also be the command to change the player's code if he already has an existing code and he uses this command. (Don't put any slashes(/) in here.)
Config.CheckMyCodeCommand = "micodigo" -- This will be the command for each player check their own code
Config.UseCodeCommand = "usarcodigo" -- this will be the command for each player to use to support the partner (Don't put any slashes(/) in here.)
---------------------------------------------
----------------- Reward ----------------------
Config.CurrencyType = 'cash' -- Type Account Money if you are using QB-Core change 'money' to 'cash', can u use coin system
Config.HowMuchUserWin = 10000 -- How much does the person that used the code earn? (0 = nothing) It can be configured individually for each code in the database. This would be the default value.
Config.HowMuchPartnerWin = 5000 -- How much does the code creator earn for each use of his code? (0 = nothing) It can be configured individually for each code in the database. This would be the default value.
------------------------------------------------
Config.DaysToReset = {7,4} -- On which days of the week should the code system be completely reseted? If you want to NEVER reset just put {} or false. (1 = Sunday, 2 = Monday, 3 = Tuesday, 4 = Thursday ... 7 = Saturday). The maximum value is 7. You can put as many days as you like. Example: {1,3,4,6,7} In this example, on each day at midnight the system will reset completely. For this to work, cron must be installed on your server.(Only the uses of the codes will be reseted, the codes themselves will continue.) This option can also be changed particularly in the database. To do this just change the "1" in the "deletes" column to "0", so the code that contains "0" will never lose his counts. I do NOT recommend changing these values in the database, but each one can do so if they wish.
------------------------------------------------
--Below you can customize the messages. If you have any doubts for what it serves you can always contact me.
Config.Messages = {
["menutitle"] = "Welcome to Partner Menu",
["youcodeis"] = "Your code is: ",
["codeusedby"] = "Users used your code: ",
["nocode"] = "You currently do not have a code, create your own here:",
["alreadycode"] = "You already have a code, you can update it here:",
["redeemcodehere"] = "Redeem the code here:",
["inputplaceholder"] = "Code",
["updatebtn"] = "Change",
["createbtn"] = "Create",
["rendeembtn"] = "Redeem Code",
["error"] = "An error has occurred, please report it to the staff. ",
["length"] = "Your code is too large. The maximum allowed is "..Config.CodeMaxLength.." characters",
["baduse"] = "You have not used the command in the correct way",
["codechanged"] = "Since you already had a code, your code has been changed to: ",
["codeinuse"] = "That code is already in use by someone else!",
["createcode"] = "Your code has been created! Code: ",
["infocode"] = "Your code is: %s and has already been used by %s people.",
["alreadyused"] = "You have already used a code in the past! Wait for the next restart so you can use it again!",
["useowncode"] = "You can't use your own code!",
["usecodesuccess"] = "Code used successfully! ",
["won"] = "You won $",
["someoneusedyourcode"] = "Someone used your code! Congratulations! ",
["codedoesnotexist"] = "That code doesn't exist!",
}
----------- Your own system notification
function SendNotification(source, msg, success)
if Config.Framework == 'esx' then
TriggerClientEvent('esx:showNotification', source, msg)
elseif Config.Framework == 'qb-core' then
TriggerClientEvent('QBCore:Notify', source, msg)
end
end
Last updated