Exports

Please note that these are server side exports

getPlayerRestaurantId

This export gets the player restaurantId if he's employed at any restaurant, it will return nil if he's not employed in any of the created restaurants

RegisterCommand('getPlayerRestId', function(source, args)
    local playerId = source
    local restaurantId = exports['nn_restaurants']:getPlayerRestaurantId(playerId)
    if restaurantId then
        print('The player is employed at restaurant id: ', restaurantId)
    else
        print('The player is not employed at any restaurant')
    end
end)

addMoney

Adds money to a restaurant finance using the restaurantId, you can set the amount and an optional description for that transaction.

RegisterCommand('addMoneyToRestaurant', function(source, args)
    local restaurantId = tonumber(args[1])
    exports['nn_restaurant']:addMoney(restaurantId, 15000, 'This is a description to add money')
end)

removeMoney

Removes money to a restaurant finance using the restaurantId, you can set the amount and an optional description for that transaction.

Last updated