1.0.8 • Published 2 years ago

full-fivem-api v1.0.8

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

fivem-api

An easy-to-use API wrapper for FiveM. This library also has 100% API coverage

Usage

To use the API you will need to make an instance of FivemServer with the server ip and port (defaults to 30120). Then to get server information you will need to fetch(), or to get player information you will need to fetchPlayers().

{FivemServer,IdentifierType} = require("full-fivem-api")

async function main() {
    const server = new FivemServer("IP");
    const status =  await server.fetch();
    if(status.online){
        // if (status.online === false) these fields would be null
        console.log(server.maxClients);
        await server.fetchPlayers();
        console.log(server.players);
        console.log(server.getUserByName("NAME"))
        console.log(server.getUserByIdentifier(IdentifierType.discord,"DISCORD-ID"))
    }
    
}

Available data:

FivemServer.players (populated with fetchPlayers)
FivemServer.requestSteamTicket
FivemServer.icon
FivemServer.resources
FivemServer.server
FivemServer.bannerConnecting
FivemServer.bannerDetailed
FivemServer.game
FivemServer.locale
FivemServer.onesyncEnabled
FivemServer.enforceGameBuild
FivemServer.enhancedHostSupport
FivemServer.lan
FivemServer.licenseKeyToken
FivemServer.maxClients
FivemServer.projectDesc
FivemServer.projectName
FivemServer.pureLevel
FivemServer.scriptHookAllowed
FivemServer.tags
FivemServer.txAdminVersion
FivemServer.version
1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago