Server Customization

Information for customizing the server side functions

copCheck

This function is triggered if copsNeeded.enable is set to 'true'.

This function doesn't receive any data, but needs to return the amount of police online/active.

function copCheck()
    local copsOnline = exports.yourPoliceResource:getOnlinePolice()
    return copsOnline
end

giveItem

This function is triggered if inventory is set to "custom".

This function receives the following data:

  • source = the player's server ID

  • item = The name of the item to be given.

  • amount = The amount of the item to give.

function giveItem(source, item, amount)
    -- Place your custom inventory exports here 
end

removeItem

This function is triggered if inventory is set to "custom".

This function receives the following data:

  • source = the player's server ID

  • item = The name of the item to be given.

  • amount = The amount of the item to give.

function removeItem(source, item, amount)
    -- Place your custom inventory exports here 
end

bankPayout

This function is triggered if payout is set to "bank"

This function receives the following data:

  • source = the player's server ID

  • amount = The amount of money to give.

function bankPayout(source, amount)
    local xPlayer = ESX.GetPlayerFromId(source)
    xPlayer.addAccountMoney('bank', amount)
end

Last updated