bcl-team / bcl-runcode

GNU General Public License v3.0
13 stars 4 forks source link
developer-tools fivem gta5

Stand With Ukraine

RunCode Resource for FiveM devs

Overview

RunCode is a comprehensive resource for FiveM devs that introduces an in-game code editor, empowering developers to write, edit, and execute code directly within the game environment. Supporting both Lua and JavaScript runtimes, RunCode enhances the coding experience with rich editing features, making it a versatile tool for real-time development and debugging.

Features

Installation

  1. Download the Resource: Obtain the latest version of RunCode from the GitHub repository.
  2. Add to Your Server: Place the RunCode resource folder into your server’s resources directory.
  3. Update Server Config: Add start bcl-runcode to your server configuration file (server.cfg).
  4. Restart Server: Restart your FiveM server to load the new resource.

Usage

  1. Open the Editor: Use the assigned keybinding or command to open the RunCode editor in-game.
  2. Write Your Code: Utilize the editor's features to write and edit your Lua or JavaScript scripts.
  3. Execute Scripts: Run your code directly within the game and observe the output and effects immediately.
  4. Server and Client Execution: Choose to execute scripts on the server or client side as needed for thorough testing.

Contribute

RunCode is an open-source project and we welcome contributions from the community. Visit our GitHub repository to report issues, suggest features, or submit pull requests.

Extensions

These functions/props are injected into both lua and js runtimes

shared helper functions/props

declare const playerId: number;
declare const playerPed: number;
declare const currentVehicle: number;
declare const lastVehicle: number;
declare const sleep: (ms: number) => Promise<void>;
declare const waitUntil: (predicate: () => boolean, max?: number) => Promise<boolean>;

client specific helper functions/props

declare const serverId: number;
declare const requestModel: (model: string | number) => Promise<void>;
declare const requestAnimDict: (dict: string) => Promise<void>;

lua specific helper functions/props

declare const setTick: (handler: () => any) => TickHandle;
declare const clearTick: (handle: TickHandle) => boolean;