API

Exports

IsInGame

Returns true if the player is playing in the Gun Range, otherwise false.

local retval = exports["rcore_gunrange"]:isInGame()

print(retval) -- true 

Client Events

rcore_gunrange:client:api:onMenuOpen

Triggered whenever the player opens the gun range menu.

rcore_gunrange:client:api:onMenuClose

Triggered when the player closes the gun range menu or when it is closed automatically (e.g., when a game starts).

rcore_gunrange:client:api:onGameStart

Triggered when a game begins. Comes with one parameter, which tells you what game mode player has started.

 AddEventHandler('rcore_gunrange:client:api:onGameStart', function(gameMode)
            print(gameMode) -- EXAM, PRACTISE, SESSION
        end)

rcore_gunrange:client:api:onGameEnd

Triggered when a game ends or is stopped by the player. Comes with one parameter, which tells you what game mode player has completed playing. The parameter can also be UNKNOWN, indicating that the player stopped the game using a command.

 AddEventHandler('rcore_gunrange:client:api:onGameEnd', function(gameMode)
            print(gameMode) -- EXAM, PRACTISE, SESSION, UNKNOWN
        end)

Last updated

Was this helpful?