No Longer available for public

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. :slight_smile:

“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.

https://gyazo.com/5c13020e4197ec90cfaf7a6ca21e9aae

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.

https://gyazo.com/5c13020e4197ec90cfaf7a6ca21e9aae

1 Like

Thanks For Fixing The Issue. I Edited The Github Post and The Topic.:heart:

:frowning: 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 :slight_smile:

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.

1 Like

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

2 Likes

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!!

1 Like

Thanks!
Currently it is not possible to restart the server directly from an script.

1 Like

UPDATE 1.1 :pencil2:

  • Added More ESX Commands
  1. – JOB
  • SetJob : prefix + setjob + id + job_name + grade_number.
  • GetJob : prefix + getjob + id
  1. – MONEY PART
  • GetMoney : prefix + getmoney + id
  • addMoney : prefix + addmoney + id + money
  • removeMoney : prefix + removemoney + id + money
  1. – 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
1 Like

I have some problem when i use cmd, it not respond
image
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.
image

Great job, one thing you could make so the bot deletes the command you wrote.