Jump to content
alt:V Multiplayer Forum

nki

Member
  • Content Count

    11
  • Joined

  • Last visited

Community Reputation

0 Neutral
  1. Got it working with the stable branch and the 1.13 CLR
  2. I followed your instructions. When I start the server it does not start the resource, once i declare it in the server.cfg resource array, the server crashes. [20:36:32] alt:V Server, build #774, branch beta [20:36:32] Starting alt:V Server on 0.0.0.0:7788 [20:36:32] coreclr-module: version found: 2.0.9 [20:36:32] coreclr-module: version found: 2.1.13 [20:36:32] coreclr-module: version found: 2.2.7 [20:36:32] coreclr-module: version found: 3.0.0-preview9-19423-09 [20:36:32] coreclr-module: greatest version: 3.0.0-preview9-19423-09 [20:36:32] Starting resource test before resource:True [20:36:33][Error] Failed to start resource 'test Could you please elaborate, if further coding or configuration is needed if the video is outdated? KInda Stuyk here...I'm using the Beta-Branch. Thanks in advance
  3. Hey there, we are having trouble with the following snippet: <div class="fixed-bottom mb-3 text-center" style="background: text linear-gradient(green 60%,red); color: transparent;"> <b class="fas fa-3x">{{ fuel }}</b> <i class="fas fa-gas-pump fa-3x"></i> </div> (using font awesome) Works perfectly in the Browser but in the WebView component it stays hidden. Apparently the color: transparent is the source of this behavior. Can anybody point me in the right direction? Thanks in advance!
  4. Hey guys, alt.log does not appear to be working using a linux server. I am using current beta branch. I also had problems with alt.on and alt.emit, but not sure if it might have been a race condition in initializing. Thanks in advance!
  5. Solved by: native.setEntityHeading
  6. Hey there, anybody up to help me set the rotation of the player? Right here (https://wiki.altv.mp/index.php/ServerJS:Player) it says "rot" is an entity. The entity page (https://wiki.altv.mp/index.php/ServerJS:Entity) says it's an object. How do I set it now though? Thanks in advance
  7. nki

    ES6 Classes in alt:V

    Sorry had a lot on my mind lately... I refactored everything into more or less one resource.
  8. nki

    ES6 Classes in alt:V

    Thanks for clarifying! I cleaned up my act, but still get the same error: TypeError: Class constructor Business cannot be invoked without 'new' Any ideas?
  9. nki

    ES6 Classes in alt:V

    Hey there, first: I didn't really know where to put this, hope here is ok. I got the following issue: I declare a class in a resource module, reference and declare it as dependency but always get the following error when using it [18:58:08][Error] [V8] Exception at game:file:///E:/altv-server/resources/game/server/index.mjs:9 [18:58:08][Error] let bus = new Business( 2, "test 2"); [18:58:08][Error] TypeError: Class constructor Business cannot be invoked without 'new' The class: const businesses = []; export class Business { constructor( id, name ) { this.id = id; this.name = name; businesses.push( this ); } getBusinesses() { return businesses; } } Usage: import * as alt from "alt"; import { Business } from "business"; import * as util from "util"; let bus = new Business( 2, "test 2"); alt.log( util.inspect( bus) ); alt.log( util.inspect( bus.getBusinesses() ) ); If I import like this, it works: import { Business } from "../../business/server/business"; But this is not the correct way, right? Anybody dealt with this before and might lend me a hand? Thanks!
  10. so far this works, if it helps anybody import MongoClient from "mongodb"; import * as fs from 'fs'; import co from "co"; let db; const config = JSON.parse( fs.readFileSync( "./resources/mongo/config.json" ) ); MongoClient.connect( config.url, { useNewUrlParser: true, poolSize: config.poolSize }, function(err, client) { console.log("Connected successfully to server"); db = client.db( config.db ); } ); export function insertOne( collection, obj, callback ) { co( function*() { yield db.collection( collection ).insertOne( obj ); callback( ); } ).catch( function( err ) { console.log( err.stack ); }); } you need to "npm install co" and "npm install mongodb"
  11. Why can't I handle default mongoose queries like: const User = new mongoose.model( "user", userSchema ); User.create( { "email": email, "password": hash } ).then( ( userId ) => { alt.log("userId: " + JSON.stringify(userId)); } ) .catch( ( exception ) => { alt.log("register catch: " + exception); } ); Kinda Stuyk here...
×
×
  • Create New...