Runkit
Runkit
home page
user forum
new notebook
support & documentation
log in
sign up
new notebook
documentation & support
Sign In
Sign Up
soka's notebooks
PhoenixRP - PNC API
-
/soka/phx-pnc-api
Last edited 4 years ago
PhoenixRP PNC API Uses cheerio to scrape the PhoenixRP PNC and returns the results in JSON
PhoenixRP - Server Status
-
/soka/phx-server-status
Last edited 5 years ago
const gamedig = require("gamedig") gamedig.query({ type: "arma3", host: "s1.phoenixrp.co.uk" }).then((data) => { // Lists Playercount console.log("Current Playercount: " + data.players.length); // Array of all Players console.log(data.players) // Shows all available data console.log(data) }).catch((error) => { console.log("PhoenixRP is offline"); });
PhoenixRP - Stats API
-
/soka/phx-stats-api
Last edited 5 years ago
PhoenixRP Stats API Uses cheerio to scrape the PhoenixRP Stats Page and returns the results in JSON
PhoenixRP - Police Count
-
/soka/phx-police-count
Last edited 5 years ago
const gamedig = require("gamedig") gamedig.query({ type: "arma3", host: "s1.phoenixrp.co.uk" }).then((data) => { police = 0 data.players.forEach(player => { if(player.name.includes("[KV") || player.name.includes("[AT") || player.name.includes("[AC") || player.name.includes("[CO") || player.name.includes("[RS") || player.name.includes("[MI") || player.name.includes("[CO") || player.name.includes("[TST")) { police = police + 1 } }); if(police >= 10) { console.log("You can play as rebel") console.log("Officers Online: " + police) } else { console.log("You can't play as rebel") console.log("Officers Online: " + police) } })