re do the config. see if its get fixed . tell my the result
Hi @rezaCyber⌠Your duplication issue with stuff spamming the commands is a rather easy fix. You actually already have the code in place, I just added a new line and done. After executing the command once, have it set the last id. Then it wonât run the command multiple times.
âExecuteCOMM(lstdata.content)
lastdata = lstdata.idâ
Thanks for this script! I had no idea this integration was this easy⌠would have done it a long time ago.
Add "âlastdata = lstdata.idâ after âExecuteCOMM(lstdata.content)â in the Thread at the bottom of the server.lua
I had the latest config from your GitHub and still had this issue. Here is what I did to correct. The middle change is the one I did to correct spamming the command.
Thanks For Fixing The Issue. I Edited The Github Post and The Topic.
I just had the nil value come back, but on a new line this time.
https://gyazo.com/e6800602bed7088bc25c369fd3fb9e53
Added in another if statement for that as well.
https://gyazo.com/1712ed68ba2ab760de79d96ca170ba39
Also giveitem is a rather useful one now that it doesnât spam. Here is the code for it if you wanna add to the stuff
elseif string.starts(command,Config.Prefix ⌠âgiveitemâ) then
if Config.ESX then
local t = mysplit(command," ")
if t[2] ~= nil and GetPlayerName(t[2]) ~= nil then
if t[3] ~= nil and t[4] ~= nil then
local xPlayer = ESX.GetPlayerFromId(t[2])
xPlayer.addInventoryItem(t[3], t[4])
sendToDiscord("Add Item Succesfully", "Succesfully added item to " .. GetPlayerName(t[2]) .."\nItem: ".. t[3] .. "\nQuantity: " .. t[4],16711680)
end
else
sendToDiscord("Could Not Find","Could Not Find An ID. Make Sure To Input Valid ID",16711680)
end
else
sendToDiscord("Discord BOT","ESX Is not enable",16711680)
end
Im not Sure What is causing this ânilâ problems . i think its because discord not from the code. with adding if statement we are just ignoring this problem to be solved by itself
Exactly. That is what I was thinking as well. Like you said, the if statements just keep it from breaking, and allowing the loop to fix itself. Cause if it doesnât through the error, it continues to work.
I am going to be seeing if I can add in a check for category. It will check any channel within a category. E.g. if you have a ticket system in your discord, and want to be able to run the commands within a ticket.
IF your but doesnât respond without any error showing up in console it means it got rate limited. to fix this problem increase delay between each tick in config file to 5-6 seconds. it will add a to execute each command but it will prevent the rate limit problem
This only work for admins on server and discord admins?
it doesnât interact with in game admin system(esx or anything). it will only work if user has access to write commands in specified channel. You can restrict channel permission so only person with admin discord role can use it
how to revive someone and what i write and whatâs mean prefix
If you are using ESX you can use prefix + revive
prefix is a word that you use before your command.
for example !revive
! is prefix and revive is command
you can change prefix to anything you want .
! # / are the most popular prefixes
You really made a powerfull tool, and if its not too much to ask for, I really could use somekind of restart server function from this, then I made it, and I will be able to go out, and let my friends ârestartâ the server when needed. Hope you can pull out a bunny more. This script is just everything I was looking for, and its easy to set even for nubies like myself!!
Thanks!
Currently it is not possible to restart the server directly from an script.
UPDATE 1.1
- Added More ESX Commands
- â JOB
- SetJob : prefix + setjob + id + job_name + grade_number.
- GetJob : prefix + getjob + id
- â MONEY PART
- GetMoney : prefix + getmoney + id
- addMoney : prefix + addmoney + id + money
- removeMoney : prefix + removemoney + id + money
- â BANK PART
- Get Bank Account Money : prefix + getbank + id
- Remove Bank Account Money : prefix + removebank + id + money
- Add Bank Account Money : prefix + addbank + id + money
I have some problem when i use cmd, it not respond
but when i restart it work. how can i fix this? (sorry my english is bad)
increase the tick in the config file you probably hit the rate limit
You can change it in config file
Config.WaitEveryTick
Hello! i have a problem!, the non esx commands work, but when i use the esx command it works 1 time, and like the bot turns off, also the non esx commands donât work. But also in the 1 time esx command the bot donât respond but do the action. and i have this error too, when i use the esx commands.
Great job, one thing you could make so the bot deletes the command you wrote.