elseif args[1]=="create" and args[2]==nil and open_assists[source] and active_assists[source] then TriggerClientEvent("chat:addMessage",source,{color={255,0,0},multiline=false,args={"Someone is already helping your or you already have a pending assist report"}})
What I’m trying to do is create a command called request that has 3 args (request create reason) all works but the reason. How can i make a 3rd arg that lets the player input what he wants and in an if statement have it set to if reason has something it will go through.
TriggerEvent('es:addCommand', 'request', function(source, args, user)
local xPlayer = ESX.GetPlayerFromId(source)
local target = tonumber(args[2])
local found = false
local reason = tonumber(args[2]) -- how to make this work?
if reason==""
What I’m trying to do is create a command called request that has 3 args (request create reason) all works but the reason. How can i make a 3rd arg that lets the player input what he wants and in an if statement have it set to if reason has something it will go through.
table.remove( args, 1 ) -- Remove first arg which is command
table.concat( args, " " ) -- Then concatenate every args separated by a space :D
I believe you can also use the third parameter (raw) as the full argument string, maybe you need to remove some characters because the command name might be in it as well!