Coder Social home page Coder Social logo

stuyk / rebar-altv Goto Github PK

View Code? Open in Web Editor NEW
48.0 3.0 26.0 127.17 MB

Accelerate your game mode development with a simple alt:V framework written in TypeScript.

Home Page: https://rebarv.com/

TypeScript 96.65% HTML 0.05% JavaScript 2.43% Vue 0.86% CSS 0.01%
altv fivem ragemp

rebar-altv's Introduction

Rebar for alt:V

Rebar is a TypeScript framework for alt:V that prioritizes plugins, translations. Rebar was inspired by Athena and meant to take Athena's best features and create a framework that gives developers a quick starting point.

Plugins for Rebar allow developers to drag & drop repositories into their server framework.

Features

  • TypeScript
  • Plugins
  • Locale / Translation Support
  • Path Aliasing
  • Transpiling
  • Reload
  • Webview Overlays, Persistent Pages, and Single Pages
  • Vue 3
  • TailwindCSS

Where to find Plugins?

If you're looking for plugins for Rebar, check out these two websites.

Requirements & Usage

See Install Instructions for quick installation

Structure

A folder structure that is simple to read, and simple to write.

├───main
│   ├───client
│   ├───server
│   ├───shared
│   └───translate
└───plugins
    └───your-plugin
        ├───client
        │   └───index.ts
        ├───server
        │   └───index.ts
        ├───translate
        │   └───index.ts
        └───webview
            └───MyCustomPage.vue

Documentation

https://rebarv.com

If you wish to run documentation locally, you can do the following:

pnpm install retypeapp --global
retype start ./docs

rebar-altv's People

Contributors

battlezoneyt avatar booster1212 avatar dav-renz avatar floydya avatar iboldurev avatar korongit avatar lenicdev avatar mafineeek avatar mikield avatar mnkyarts avatar shortbyte avatar stuyk avatar unfloned avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

rebar-altv's Issues

The positionIsClear function is not working properly

test code:

const vehicle = new alt.Vehicle('blista', SpawnPos, new alt.Vector3(0,0,0));
vehicle.dimension = 0
let result = await Rebar.get.useWorldGetter().positionIsClear(SpawnPos,'vehicle')
alt.logWarning(`positionIsClear:${result}`) // alaways return true

Increased to 100 milliseconds will work normally

const colshape = new alt.ColshapeCylinder(pos.x, pos.y, pos.z - 1, 2, 2);
await alt.Utils.wait(100);

Door System

Athena still has a really good door system for managing doors, I want to port it over with virtual entities.

"pnpm dev" = endless loop

The update 50 destroyed the functionality of "pnpm dev" for me. Two symptoms occur, both produce an endless loop. ("pnpm dev:hot" works)
1
2

Interaction Adds a range of single/multiple player interactions and destruction methods

Specify single \ multiple player interactions

When creating Interaction, you can specify single or multiple player interactions,other players are not allowed to interact.

Destruction method

If a given player completes the interaction, consider letting him self-destruct, or destroy the interaction when all players in the interaction have finished

Rebar.usePlayer(player).attachment.remove not work

Rebar.usePlayer(player).attachment.remove

not work

i think i found why

function createAttachments has not push the new object to entityAttachments[]

async function createAttachments(player: alt.Player, attachments: Attachment[]) {
entityAttachments[player.id] = [];

for (let attachment of attachments) {
    if (!attachment.rot) {
        attachment.rot = alt.Vector3.zero;
    }

    const object = new alt.LocalObject(
        attachment.model,
        player.pos,
        new alt.Vector3(attachment.rot),
        true,
        false,
        true,
        15,
    );

    await object.waitForSpawn();

    object.attachToEntity(
        player,
        attachment.bone,
        new alt.Vector3(attachment.offset),
        new alt.Vector3(attachment.rot),
        true,
        false,
        true,
    );
  //add this
    entityAttachments[player.id].push(object);
}

}

NuxtJS as a higherlevel framework

Hey I kinda love rebar.
But I got a short question. Is it possible to upgrade the build in VueJS to use NuxtJS as a higherlevel framework?

greetings
ExXTreMe

global.ts setBulk not working correctly

Since it still didn't work after this error "setField not exist #102", I looked into it.

For me it only works if I change (global.ts)

async function setBulk<T = Object>(data: Partial<T>): Promise<boolean> {
        data[identifier] = Object.assign(data[identifier], data); 
        return await db.update({ _id: data[identifier]._id, ...data }, CollectionNames.Global);
    }

to

async function setBulk<T = Object>(getdata: Partial<T>): Promise<boolean> {
        data[identifier] = Object.assign(data[identifier], getdata); 
        return await db.update({ _id: data[identifier]._id, ...getdata }, CollectionNames.Global);
    }

So the "data" for example in "getdata"

Move Transmitter to Hono API

The vscode transmitter is currently handling everything via http; and need to get it all under one server instead of 2.

It's mostly refactoring that needs to be done.

Transmitter will be updated to the correct ports after update.

Reloading core resource does not work

When reloading the resource with the restart resource function, it does not load the core resource again.

It has something to do with index.ts and can't seem to pin point exactly where it's happening.

If fixed I can integrate proper resource reloading via nodemon and prevent disconnections entirely while developing.

Reset RPM to Zero on toggleEngine

import * as alt from 'alt-client';

alt.onServer('ResetRPM', () => {
alt.Player.local.vehicle.rpm = 0; // Fixes vehicle stuttering
});

Need a solution otherwise vehicles will stutter on engineStop & letting em roll out

Webview texture replacement Wrapper

Would love if we had a wrapper for webviews on textures. Maybe even with audio (or even multichannel audio as @Dav-Renz requested) but dont know if that is in the scope.

Could be funny to use for server that want todo public viewing events, or even like in some FiveM Servers, that each tv prop can stream custom youtube videos, twitch streams etc.

heres the declaration:
WebView(url: string, propHash: number, targetTexture: string): WebView

https://docs.altv.mp/js/api/alt-client.WebView.html#_altmp_altv_types_alt_client_WebView_constructor_1

Feat/Req: Keydown/Keyup Event Handling for Keybinder Function

Would love if we could have both Keydown and Keyup for the Serverside Keybinder. This would allow us to create more interactive and dynamic experiences by reacting immediately when a key is pressed and also when it is released.

Here maybe an idea how it could look:

const Keybinder = Rebar.useKeybinder();

Keybinder.on(75, 'keydown', (player) => {
    console.log('pressed k down');
});

Keybinder.on(75, 'keyup', (player) => {
    console.log('pressed k up');
});

Crash on restart while rmlui open

In dev mode if you reload the server while there is an rmlui visible the game crashes.

video

The error that the server throws:

[02:26:10][Error] Uncaught exception: TypeError: Cannot read properties of null (reading 'statusCode')
    at Socket.onSocketError (node:internal/deps/undici/undici:9133:47)
    at Socket.emit (node:events:525:35)
    at emitErrorNT (node:internal/streams/destroy:151:8)
    at emitErrorCloseNT (node:internal/streams/destroy:116:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
[02:26:10][Error] Uncaught exception: TypeError: Cannot read properties of null (reading 'statusCode')
    at Socket.onSocketError (node:internal/deps/undici/undici:9133:47)
    at Socket.emit (node:events:525:35)
    at emitErrorNT (node:internal/streams/destroy:151:8)
    at emitErrorCloseNT (node:internal/streams/destroy:116:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

The error on client side:

[02:26:00] Connecting to: [::1]:7788 MTU: 1392
[02:26:01] Connected with id: 1
[02:26:01] Loading resource rmlui
[02:26:01] Loaded resource rmlui
[02:26:01] Loading resource webview
[02:26:01] Loaded resource webview
[02:26:01] Loading resource core
[02:26:01] [V8] Starting script main/client/index.js
[02:26:01] Controllers - Loaded Blip Handler
[02:26:01] Controllers - Loaded Interaction Handler
[02:26:01] Controllers - Loaded Marker Handler
[02:26:01] Controllers - Loaded Object Handler
[02:26:01] Loaded Controllers
[02:26:01][Warning] The font face 'inter-regular' is already registered
[02:26:01][Warning] The font face 'inter-black' is already registered
[02:26:01][Warning] The font face 'inter-bold' is already registered
[02:26:01] Loaded Screen
[02:26:01] Loaded System
[02:26:01] Virtual Entities - Loaded Marker Handler
[02:26:01] Virtual Entities - Loaded Text Label Handler
[02:26:01] Loaded Virtual Entites
[02:26:01] :: Loading Client Plugins
[02:26:01] ::: Plugin: admin
[02:26:01] ::: Plugin: auth
[02:26:01] ::: Plugin: character-creator
[02:26:01] ::: Plugin: character-select
[02:26:01] ::: Plugin: chat
[02:26:01] ::: Plugin: clothes-shop
[02:26:01] ::: Plugin: death
[02:26:01] ::: Plugin: hotkey
[02:26:01] ::: Plugin: recoil
[02:26:01] ::: Plugin: vehicles
[02:26:01] ::: Plugin: weapon
[02:26:01] :: Loaded Client Plugins
[02:26:01] [V8] Started script main/client/index.js
[02:26:01] Loaded resource core
[02:26:01] :::: Registered key=113 for action=open-vehicle-list
[02:26:01][Warning] System update Net Manager took too much time to execute. 127 ms
[02:26:01][Error] Player already exists 1 true 1 true
[02:26:01] Webview Page Composable Started
[02:26:01][Warning] System update Net Manager took too much time to execute. 38 ms
[02:26:10][Error] [V8] Exception at core:main/client/player/camera.js:13
[02:26:10][Error]       alt.clearInterval(interval);
[02:26:10][Error]   Error: Invalid timer id
    at destroy (main/client/player/camera.js:13:9)
[02:26:10][Error] Error: Invalid timer id
[02:26:10] Stopping resource core
[02:26:10][Warning] System update NetworkManager took too much time to execute. 214 ms
[02:26:10] MINIDUMP: Temporary dump saved
[02:26:10][Warning] [Warning] System update NetworkManager took too much time to execute. 538 ms

[02:26:10] Last loaded asset: prop_forsale_tri_01.yft prop_forsale_lrg_03.yft
[02:26:10] Texture info: CS_rsl_dd_Foreclosure_01 CS_rsl_dd_Foreclosure_01_N
[02:26:10] Last deleted vehicle model 0000000000000000
[02:26:10] Last pos Point{ x: 176.94, y: -332.993, z: 44.0675 }
[02:26:10] Shutting down

App.vue - Cannot find module

In webview->src->app.vue it says "import DevelopmentBar from './components/Development.vue';" but it doesn't exist.

2024-07-29 09_30_17-Window

Keybinder - WHILE Key HELD

May add option to the Keybinder to Show something as long as the KEY is HELD i.e. if ALT_LEFT is held do xyz and if its not longer HELD anymore remove it

Reusable components for webviews

How to create reusable components for using in all webview resources?

Like forms, inputs, list or another... If the need for me

Feat/Req: Asset folder (Image folder to asset?)

It would be great to get somekind of asset folder where we could put fonts (and other assets) which gets used by like for example alt.TextLabels. (Dont think we have something like this?). Maybe even just renaming images to assets (or something else) and have the possibility to add more stuff in there? Don't know how necessary another folder is

Disable Ambient sounds as Serverconfig

Adding disable Ambient sound to Serverconfig:

native.startAudioScene("DLC_MPHEIST_TRANSITION_TO_APT_FADE_IN_RADIO_SCENE") // removes the music
    native.setStaticEmitterEnabled("LOS_SANTOS_VANILLA_UNICORN_01_STAGE", false) // disables the audio from unicorn
    native.setStaticEmitterEnabled("LOS_SANTOS_VANILLA_UNICORN_02_MAIN_ROOM", false) // disables the audio from unicorn
    native.setStaticEmitterEnabled("LOS_SANTOS_VANILLA_UNICORN_03_BACK_ROOM", false) // disables the audio from unicorn
    native.setAmbientZoneListStatePersistent("AZL_DLC_Hei4_Island_Zones", true, true) // cayo ambient
    native.setAmbientZoneListStatePersistent("AZL_DLC_Hei4_Island_Disabled_Zones", false, true)  // cayo ambien
    native.startAudioScene("FBI_HEIST_H5_MUTE_AMBIENCE_SCENE") // mute fib ambience
    native.startAudioScene("CHARACTER_CHANGE_IN_SKY_SCENE") // starts the sky scene audio if you use a another audio scene e.g DLC_VW_Casino_General you must stop the CHARACTER_CHANGE_IN_SKY_SCENE audio scene before starting the another scene
    native.setAudioFlag("PoliceScannerDisabled", true) // Disables the police scanner audio functionality
    native.setAudioFlag("DisableFlightMusic", true) // Disables the flight audio functionality

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.