This repository is a basic boilerplate for getting started with Angular in alt:V Multiplayer. It contains several helpful features and was generated with the Angular CLI. The project was setup using SCSS as stylesheet format, it is for both browser and in-game based development workflow.
If you are stuck somewhere and don't know how to resolve, here is a workaround ready that contains alt:V server files.
Clone the repository and use npm install
, after installing the packages use:
Caution
If you do not have the Angular CLI installed, install it before advancing further.
ng serve
for development mode, it's going to watch the files and build the application upon changes. You can create the alt:V browser on the generated address.ng build
to build the angular project.
- When the player is connecting on server-side, emit an event to client-side and on client-side create the the view.on events.
The view.on events are the events called from the UI using sendClient.
Example:
import * as alt from 'alt-client';
export let view = new alt.WebView('http://localhost:4200/');
view.focus();
alt.onServer("initializeBrowser", () => {
view.on('SEND_TO_SERVER', (eventName, ...args) => {
alt.emitServer(eventName, ...args)
})
view.on('onBrowserLoaded', () => {
alt.log('The browser loaded succesfully.');
})
});
- You're all done! If you did everything mentioned up correctly, you should have an alt:V + Angular project running with no problems.
If you want to support me, just give me a Coffee🍵☕