NFive

NFive

  • Docs
  • Help
  • API
  • Plugins
  • GitHub
  • Languages iconEnglish
    • Čeština
    • Español
    • Norsk
    • Português (Brasil)
    • Help Translate

›Client Side

Getting Started

  • Overview
  • Components
  • Database Setup
  • Server Setup
  • Installing Plugins
  • Administration
  • Troubleshooting

Plugin Manager

  • Overview
  • Command Reference

Plugin Development

  • Overview
  • Setup
  • Hub
  • Definition
  • Server Side

    • Life Cycle
    • Controller
    • Configurable Controller
    • Dependency Injection
    • Database Access
    • RCON

    Client Side

    • Life Cycle
    • Service
Edit

Service

NFive.SDK.Client.Services.Service

A service is the main entrypoint for client plugins. The FiveM client starts the services on connection to the server and they exist for the duration of the client connection.

Plugins should contain one or more classes which inherit from Service in one of their main assemblies.

Constructor

Service(ILogger logger, ITickManager ticks, IEventManager events, IRpcHandler rpc, ICommandManager commands, OverlayManager overlayManager, User user)

For convenience the logger, events, RPC and command manager, overlay manager and connected user types are stored to local properties for easy access.

Methods

  • Loaded()
  • Started()
  • HoldFocus()
  • Delay()

Loaded()

public virtual Task Loaded()

Run immediately after the plugin's constructor is called, provided for continence so that asynchronous code can be used during construction. NFive client will block and wait for this method to complete before loading the next plugin.


Started()

public virtual Task Started()

Run asynchronously at the same time for all plugins after they have all been loaded. This method is where all plugin startup logic should be ran.


HoldFocus()

public virtual Task HoldFocus()

Delay()

protected async Task Delay(int ms)
protected async Task Delay(TimeSpan delay)
Last updated on 5/16/2019
← Life CycleNext →
  • Constructor
  • Methods
    • Loaded()
    • Started()
    • HoldFocus()
    • Delay()
NFive
Docs
Getting StartedPlugin ManagerAPI Reference
Community
Getting HelpProject ChatDiscord NFive chat
More
Plugin HubGitHubNFive stargazers on GitHub