npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

arma3-life-db

v1.0.8

Published

Connects to your life server's database on arma 3 to pull or update information.

Downloads

24

Readme

arma3-life-db

Connects to your life server's database on arma 3 to pull or update information.

Features

  • Get cash, bank, levels, etc.. for a player
  • Get a value from any table
  • Update a value from any table

Requirements

  • Node.JS
  • NPM
  • Database(MySQL/MariaDB)

Installation

  1. Install the package using NPM with command npm i --save arma3-life-db
  2. Done! Now time to configure.

Configuration

Package

Add this to the top of your file.

const {Config, Query_Get, Query_Update} = require("arma3-life-db")

Database Setup

Add this function to your file and change the key values.

Config({
    IP: "127.0.0.1",
    Port: "3306",
    Database: "altislife",
    Username: "test",
    Password: "123321"
})

Functions

Config(ConfigObject)

This function configures and starts up the SQL pool.

  • Parameters
    • "ConfigObject" (Object) - The configuration for a3ldb
      • "IP" (string) - The IPv4 of the SQL server
      • "Port" (string) - The port of the SQL server
      • "Database" (string) - The database in the SQL server where the info is stored
      • "Username" (string) - The SQL username that has access to the database
      • "Password" (string) - The SQL username's password that has access to the database

Query_Get(Table, Column, Search_Column, Search_Value)

This function gets a value for the supplied player.

  • Parameters
    • "Table" (String) - The SQL table to search from
    • "Column" (String) - The SQL column to get the value from
    • "Search_Column" (String) - The SQL column to search from
    • "Search_Value" (String) - The value to search the Search_Column for
async function Get_Player_Cop_And_Medic_Levels() {
    console.log("Cop level", await Query_Get("players", "coplevel", "pid", "76561198325855765"))
    console.log("Medic level", await Query_Get("players", "mediclevel", "pid", "76561198325855765"))
}
Get_Player_Cop_And_Medic_Levels()

Query_Update(Table, Column, Column_Value, Search_Column, Search_Value)

This function updates a value for the supplied table and for the supplied search value.

  • Parameters
    • "Table" (String) - The SQL table to update
    • "Column" (String) - The SQL column to update
    • "Column_Value" (String) - The new value to replace the old value
    • "Search_Column" (String) - The SQL column to search from
    • "Search_Value" (String) - The value to search the Search_Column for
async function Update_Player_Cash() {
    console.log("Cash update", await Query_Update("players", "cash", "1000000", "pid", "76561198325855765"))
}
Update_Player_Cash()

To-Do List

  • Optimize project
  • Write less code