Skip to content

Supremeeeeeee/esx_society

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 

esx_society

Need help.

Ok, so i am adding in a callsign option to esx_society but i am currently stuck at how to input the callsign to the database using esx_menu_dialog. Click on callsign then the esx_menu_dialog appears and imput whatever callsign and it saves to the database.

https://streamable.com/9zl3pt

image

image

Client side

  if data.value == 'callsign' then
    ESX.UI.Menu.Open(
      'dialog', GetCurrentResourceName(), 'callsign_',
      {
        title = _U('callsign')
      },
      function(data, menu)

        local args = callsign

        if args == nil then
          exports['mythic_notify']:DoCustomHudText('inform', 'Invalid Callsign')
          else
          menu.close()
          OpenEmployeeList(society)
          TriggerServerEvent('esx_society:setCallsign', callsign)
        end
      end,
      function(data, menu)
        menu.close()
          OpenEmployeeList(society)
      end
    )
  end

-- Server Side…

RegisterServerEvent('esx_society:setCallsign') AddEventHandler('esx_society:setCallsign', function(source, args) local argString = table.concat(args, " ") MySQL.Async.execute('UPDATE users SET callsign = @callsign WHERE identifier = @source',{ ['@callsign'] = argString, ["@source"] = GetPlayerIdentifiers(source)[1] },

    function(rowsChanged)
    TriggerClientEvent("output", source, "^2".. argString.. "^0")

end)

end)

been at this all day and night but can’t seem to get it triggered.

Any help would be highly grateful

Releases

No releases published

Packages

No packages published

Languages