Search the Community

Showing results for '{query}'.


Didn't find what you were looking for? Try searching for:


More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • RAGE Multiplayer
    • Announcements
    • Discussion
    • Suggestions
    • RDR2 Multiplayer
  • Scripting
    • Scripting
    • Resources
  • Community
    • Support
    • Servers
    • Media Gallery
  • Non-English
    • Русский - Russian
    • Français - French
    • Deutsch - German
    • Espanol - Spanish
    • Română - Romanian
    • Portuguesa - Portuguese
    • Polski - Polish

Categories

  • Scripts
  • Gamemodes
  • Libraries
  • Plugins
  • Maps
  • Tools

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


About Me


Facebook


Youtube


Skype


Web


VK

Found 91 results

  1. hello, i need some help for my function, i make it returned a value under JSON.stringify but since it's an asynchronous function, it sends it to me with promise {result} so I can not use JSON.parse after. If you have a solution to my problem, I do not mind async getItemForPlayerMenu(id) { const playerItem = []; const data = await misc.query(`SELECT u.*, i.itemName, i.usable, i.itemcount FROM user_items u LEFT JOIN items i ON i.id = u.itemId WHERE u.charId = "${id}"`); for (const item of data) { if (item.charId !== id) continue; const v = { id: item.id, owner: item.charId, itemId: item.itemId, amount: item.amount, title: item.itemName, usable: item.usable, poids: item.itemcount } playerItem.push(v); } return JSON.stringify(playerItem); } Promise { '[{"id":1,"owner":6,"itemId":1,"amount":10,"title":"Eau","usable":"Y","poids":1},{"id":2,"owner":6,"itemId":2,"amount":10,"title":"Sandwich","usable":"Y","poids":1}]' }
  2. For some reason the script cant get x, y, z from my database, if im using normal cordinates instead of x,yz its working fine. mp.events.add("server:KeyE", (player) => { gm.databaseManager.getConnection().query("SELECT * FROM garagen WHERE 1=1",[],function(err,res) { console.log("Geht"); if (err) console.log("Error in Garagen: "+err); for(let i = 0; i < res.length; i++) { let GaragenCol = mp.colshapes.newSphere(parseInt(res[0].X),parseInt(res[0].Y),parseInt(res[0].Z), 3, 0); if(GaragenCol.isPointWithin(player.position)) { mp.events.call("server:garagemenu",player,res[i].id); } } }); }); Can anyone help me with that?
  3. [N] Starting network... - OK: (IPv4-only) at 127.0.0.1:22005 (node:8776) ExperimentalWarning: The ESM module loader is experimental. Loading packages "camera" loaded "server" loaded [P] Plugin bridge.dll loaded! Started HTTP server at 22006 port. (node:8776) DeprecationWarning: current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor. [DEBUG] Server started at Thu Oct 10 2019 15:59:09 GMT+0200 (GMT+02:00) [Houses] 5 loaded. [Data] 5 loaded. [Business] 9 loaded. (node:8776) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'x' of null at global.UpdateBizz3D (C:\RAGEMP\server-files\packages\server\src\systems\business\index.js:101:24) at Business.forEach (C:\RAGEMP\server-files\packages\server\src\systems\business\index.js:74:7) at Array.forEach (<anonymous>) at query.then (C:\RAGEMP\server-files\packages\server\src\systems\business\index.js:73:14) at process._tickCallback (internal/process/next_tick.js:68:7) (node:8776) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:8776) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. hello great job but unfortunately the camera hangs in the air without giving me the registration I do not know how to solve this error I have solved others but I do not know this I really hope someone help me thanks and sorry for my English
  4. That would be asynchronous like a mysql query, but still slower.
  5. Hello, I hope for help here, I'm just about to create a fraction system, but I come in the query whether the player in the group is not further. my plan should look like this, but how the implementation works I unfortunately do not know yet. I would have to put PlayerEnterVehicle on a certain road, or all fraction vehicles
  6. Guten Tag und zwar habe ich da ein kleines Problem mit mit meinem Login System sobald ich einen Query ausführe habe ich folgendes in der server_exceptions.txt stehen ==================[10/5/19 5:38:43 PM]================== System.IO.FileNotFoundException: Could not load the specified file. File name: 'System.ComponentModel.Primitives' at Assembly System.Runtime.Loader.AssemblyLoadContext.ResolveUsingEvent(AssemblyName assemblyName) ========================================================= ==================[10/5/19 5:38:43 PM]================== System.IO.FileNotFoundException: Could not load the specified file. File name: 'System.ComponentModel.TypeConverter' at Assembly System.Runtime.Loader.AssemblyLoadContext.ResolveUsingEvent(AssemblyName assemblyName) ========================================================= ==================[10/5/19 5:38:43 PM]================== System.IO.FileNotFoundException: Could not load file or assembly 'System.ComponentModel.TypeConverter, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified. File name: 'System.ComponentModel.TypeConverter, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' at RuntimeMethodHandleInternal ModuleHandle.ResolveMethod(RuntimeModule module, int methodToken, IntPtr* typeInstArgs, int typeInstCount, IntPtr* methodInstArgs, int methodInstCount) at RuntimeMethodHandleInternal ModuleHandle.ResolveMethodHandleInternalCore(RuntimeModule module, int methodToken, IntPtr[] typeInstantiationContext, int typeInstCount, IntPtr[] methodInstantiationContext, int methodInstCount) ========================================================= ==================[10/5/19 5:38:43 PM]================== System.IO.FileNotFoundException: Could not load the specified file. File name: 'System.ComponentModel.TypeConverter' at Assembly System.Runtime.Loader.AssemblyLoadContext.ResolveUsingEvent(AssemblyName assemblyName) ========================================================= ==================[10/5/19 5:38:43 PM]================== System.IO.FileNotFoundException: Could not load file or assembly 'System.ComponentModel.TypeConverter, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified. File name: 'System.ComponentModel.TypeConverter, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' at void ModuleHandle.ResolveType(RuntimeModule module, int typeToken, IntPtr* typeInstArgs, int typeInstCount, IntPtr* methodInstArgs, int methodInstCount, ObjectHandleOnStack type) at RuntimeType ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module, int typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext) ========================================================= ==================[10/5/19 5:38:43 PM]================== System.TypeLoadException: Could not load type 'System.Management.WbemDefPath' from assembly 'System.Management, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. at System.Management.ManagementPath.CreateWbemPath(String path) at System.Management.ManagementPath..ctor(String path) ========================================================= ==================[10/5/19 5:38:43 PM]================== System.IO.FileNotFoundException: Could not load the specified file. File name: 'System.ComponentModel.TypeConverter' at Assembly System.Runtime.Loader.AssemblyLoadContext.ResolveUsingEvent(AssemblyName assemblyName) ========================================================= ==================[10/5/19 5:38:43 PM]================== System.IO.FileNotFoundException: Could not load file or assembly 'System.ComponentModel.TypeConverter, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified. File name: 'System.ComponentModel.TypeConverter, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' at RuntimeMethodHandleInternal ModuleHandle.ResolveMethod(RuntimeModule module, int methodToken, IntPtr* typeInstArgs, int typeInstCount, IntPtr* methodInstArgs, int methodInstCount) at RuntimeMethodHandleInternal ModuleHandle.ResolveMethodHandleInternalCore(RuntimeModule module, int methodToken, IntPtr[] typeInstantiationContext, int typeInstCount, IntPtr[] methodInstantiationContext, int methodInstCount) ========================================================= ==================[10/5/19 5:38:43 PM]================== System.IO.FileNotFoundException: Could not load the specified file. File name: 'System.ComponentModel.TypeConverter' at Assembly System.Runtime.Loader.AssemblyLoadContext.ResolveUsingEvent(AssemblyName assemblyName) ========================================================= ==================[10/5/19 5:38:43 PM]================== System.IO.FileNotFoundException: Could not load file or assembly 'System.ComponentModel.TypeConverter, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified. File name: 'System.ComponentModel.TypeConverter, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' at void ModuleHandle.ResolveType(RuntimeModule module, int typeToken, IntPtr* typeInstArgs, int typeInstCount, IntPtr* methodInstArgs, int methodInstCount, ObjectHandleOnStack type) at RuntimeType ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module, int typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext) ========================================================= ==================[10/5/19 5:38:43 PM]================== System.TypeInitializationException: The type initializer for 'System.Management.ManagementPath' threw an exception. ---> System.TypeLoadException: Could not load type 'System.Management.WbemDefPath' from assembly 'System.Management, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. at System.Management.ManagementPath.CreateWbemPath(String path) at System.Management.ManagementPath..ctor(String path) at System.Management.ManagementPath..cctor() --- End of inner exception stack trace --- at System.Management.ManagementScope._Clone(ManagementScope scope, IdentifierChangedEventHandler handler) ========================================================= ==================[10/5/19 5:38:43 PM]================== System.ArgumentException: 'windows-1252' is not a supported encoding name. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method. Parameter name: name at int System.Globalization.EncodingTable.GetCodePageFromName(string name) ========================================================= Alle dlls sind im runtime Order auf meinem Linux server.. Ich habe versucht die System.ComponentModel.TypeConverter aus dem dotnet Ordner hoch zu laden aber dann läuft der Server nicht mehr. Über jede hilfe freue ich mich Edit: Oder kann ich es ignorieren da die querys richtig ausgeführt werden?
  7. Ich habe rein garnichts geklaut, Snilloc hatte alles auf Github und es war Public zugänglich. Zudem hast du KEINE Lizenz. Aber mach mal weiter mit deinen Lügen. Wird schon schief gehen. Die User sollen selber sehen dass du Nichts kannst! Und damit du nicht immer Items per Datenbank manuell Eintragen musst, habe ich dir mal was kleines gebaut *Lache innerlich* mp.events.addCommand("addshopitem", (player, full, id, itemId, price, shopId, name) => { gm.mysql.handle.query("INSERT INTO shop_items SET id = ?, itemId = ?, price = ?, shopId, = ? name = ?", [id, itemId, price, shopId, name], function (err, res) { if(err) console.log("Error in addshopitem : " + err); player.notify("~g~Du hast erfolgreich das Item" + name + "dem Shop mit der ID " + shopId + " hinzugefügt!") }); }); Usage : /addshopitem <ItemEintragsId> <ItemId> <Price> <ShopID> Keine Ahnung wie man den ganzen Kram nur Zeile für Zeile manuell eintragen kann. Ach und hier deine Logs die nicht funktioniert haben. Gern geschehen. mp.events.add({ "sqlLog": async (player, logfile) => { try { if (!player) return; if (!logfile) return; var charname = "" + player.data.firstname + " " + player.data.lastname; gm.mysql.handle.query("INSERT INTO logs (playername, log, socialclub, ip) VALUES (?, ?, ?, ?)", [charname, logfile, player.socialClub, player.ip], function (err, res) { if (err) console.log("FILE: ERROR on sqlLog for player " + player.data.ingameName + ": " + err); }); } catch (ex) { return console.log("FILE: ERROR on sqlLog for player " + player.data.ingameName + ": " + ex); } } }); mp.events.add({ "adminLog": async (player, logfile) => { try { if (!player) return; if (!logfile) return; var charname = "" + player.data.firstname + " " + player.data.lastname; gm.mysql.handle.query("INSERT INTO adminlogs (playername, log, socialclub, ip) VALUES (?, ?, ?, ?)", [charname, logfile, player.socialClub, player.ip], function (err, res) { if (err) console.log("FILE: ERROR on sqlLog for admin " + player.data.ingameName + ": " + err); }); } catch (ex) { return console.log("FILE: ERROR on sqlLog for admin " + player.data.ingameName + ": " + ex); } } });
  8. Hey Guys, hope you can help me with my problem. i want to end a function in a Event, if the player disconnects or leave the Server. But i only get crashes. Here my Code: function playerQuit(player) { console.log(`${player.name} has quit.`); } mp.events.add("playerQuit", playerQuit); // After player die mp.events.add("playerDeath", (player, reason, killer) => { //Set values hospital -> player dead/alive //hospitaltime -> time that he have to be in hospital player.hospital = 1; player.hospitaltime = 12; //update values in database gm.mysql.handle.query('UPDATE `accounts` SET hospital = ?, hospitaltime = ? WHERE username = ?', [player.hospital, player.hospitaltime, player.name], function(err, res, row){ if(err) console.log(err); }); if(player){ gm.mysql.handle.query('SELECT hospital, hospitaltime FROM `accounts` WHERE username = ?', [player.name], function(err, res){ if(err) console.log(err); //Read Values from Database player.hospital = parseInt(res[0]["hospital"]); player.hospitaltime = parseInt(res[0]["hospitaltime"]); }); //if player is dead do -> if(player.hospital == 1){ var timeLeft = parseInt(player.hospitaltime); var timerID = setInterval(countdown, 5000); //Countdown for hospitaltime function countdown(){ //if time over player have to be spawned and timeout have to be cleared if(timeLeft == 1){ clearTimeout(timerID); player.hospitaltime = 0; player.hospital = 0; gm.mysql.handle.query('UPDATE `accounts` SET hospital = ?, hospitaltime = ? WHERE username = ?', [player.hospital , player.hospitaltime, player.name], function(err, res, row){ if(err) console.log(err); }); player.spawn(new mp.Vector3(-799.5113525390625, -99.25785827636719, 37.604530334472656)); return; } else { // if player leave put values in database if(playerQuit.player.name == player.name){ clearTimeout(timerID); player.hospital = 1; player.hospitaltime = timeLeft; gm.mysql.handle.query('UPDATE `accounts` SET hospital = ?, hospitaltime = ? WHERE username = ?', [player.hospital , player.hospitaltime, player.name], function(err, res, row){ if(err) console.log(err); }); return; } //write new values timeLeft--; gm.mysql.handle.query('UPDATE `accounts` SET hospitaltime = ? WHERE username = ?', [timeLeft, player.name], function(err, res, row){ if(err) console.log(err); }); } } } } }); to test this code i have in my cmd.js this: mp.events.addCommand('kick', (player, target) => { let newTarget = mp.players.at(target); if(!target || isNaN(target)) return player.outputChatBox("Syntax: /kick [playerID]"); if(newTarget === null) return player.outputChatBox("There is no player online with the ID given.") newTarget.outputChatBox("You have been kicked from the server."); newTarget.kick('Kicked.'); }); My server crashes everytime when i kick me, when im in the hospital. it also crashes without this Code section: // if player leave put values in database if(playerQuit.player.name == player.name){ clearTimeout(timerID); player.hospital = 1; player.hospitaltime = timeLeft; gm.mysql.handle.query('UPDATE `accounts` SET hospital = ?, hospitaltime = ? WHERE username = ?', [player.hospital , player.hospitaltime, player.name], function(err, res, row){ if(err) console.log(err); }); return; } i get following logs in my console: Error: asyc stack has become corrutep (actual: 29, expected: 30) 1: 00007FF824079805 2: 00007FF824059B82 3: 00007FF824069CB3 4: 00007FF82409ABD0 5: 00007FF82415BCDE 6: 00007FF8241F810D 7: 00007FF8241F5066 [...]***more of them*** Edit: The problem was, that i had 2 events with the same name. now it does not crash anymore
  9. Please explain better how to install this server. I have this errors. And none login screen. Started HTTP server at 22006 port. (node:1536) DeprecationWarning: current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor. [DEBUG] Server started at Mon Sep 16 2019 01:02:35 GMT+0200 (GMT+02:00) [Data] 5 loaded. [Business] 9 loaded. (node:1536) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'x' of null at global.UpdateBizz3D (C:\Users\Vano\Desktop\gta5-ragemp-server-master\Server\packages\server\src\systems\business\index.js:101:24) at Business.forEach (C:\Users\Vano\Desktop\gta5-ragemp-server-master\Server\packages\server\src\systems\business\index.js:74:7) at Array.forEach (<anonymous>) at query.then (C:\Users\Vano\Desktop\gta5-ragemp-server-master\Server\packages\server\src\systems\business\index.js:73:14) at process._tickCallback (internal/process/next_tick.js:68:7) (node:1536) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:1536) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. [Houses] 5 loaded.
  10. Business] 9 loaded. (node:21292) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'x' of null at global.UpdateBizz3D (D:\ragemp\server-files\packages\server\src\systems\business\index.js:101:24) at Business.forEach (D:\ragemp\server-files\packages\server\src\systems\business\index.js:74:7) at Array.forEach (<anonymous>) at query.then (D:\ragemp\server-files\packages\server\src\systems\business\index.js:73:14) at process._tickCallback (internal/process/next_tick.js:68:7) (node:21292) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:21292) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. [Data] 5 loaded. [Houses] 5 loaded.
  11. Всем привет. В эвенте playerReady имеется следующий функционал: console.log("Отправляем запрос"); global.database.query(`SELECT * FROM accounts WHERE sc_name=?`, [player.socialClub], (err, rows) => { if(err) throw err; console.log("The accounts sc_name " + player.socialClub + " is: " + rows); if(rows.length > 0) { console.log("Аккаунт зарегистрирован"); } else { console.log("Аккаунт НЕ зарегистрирован"); } }); В итоге отправляется в консоль только это "Отправляем запрос", а сам запрос почему то не уходит... В index.js: global.database = require("./database"); А в database.js: var mysql = require('mysql'); var pool = undefined; module.exports.setup = function() { pool = mysql.createPool({ host: 'localhost', user: 'root', database: 'basename', password: '', }); } module.exports.query = function(query, callback){ return pool.getConnection(function(err, connection) { connection.query(query, function(err, result, fields) { connection.release(); callback(err, result, fields); }); }); } Помогите пожалуйста( Кстати если в index.js после подключения сделать: database.query('SELECT * FROM accounts WHERE 1', function(err, rows, fields) { if (err) throw err; console.log('The accounts is: ', rows); }); Как НИ странно запрос отправляется, о чем говорит приход сообщения в логи...
  12. Добрый вечер. Никак не могу подключится к БД, уже 6 час сижу, вообще ни в какую!!! Помогите пожалуйста(( Код в index.js: global.database = require("./database"); global.database.setup(); global.database.query("SELECT * FROM accounts WHERE ?", [1], (error, result) => { if (error) { console.log("Ошибка - " + error); } else { console.log("Все ок, подключение и тд есть"); } }); А вот код в database.js: var mysql = require('mysql'); var pool = undefined; module.exports.setup = function() { pool = mysql.createPool({ host : "127.0.0.1", user : "root", password : "", database : "mysql" }); } module.exports.query = function(query, callback){ return pool.getConnection(function(err, connection) { connection.query(query, function(err, result, fields) { connection.release(); callback(err, result, fields); }); }); } Ошибка, при запуске консоль думает-думает и выкидывает ошибку и закрывает консоль. Ошибка: Error: async hook stack has become corrupted (actual: 12, expected: 13) Подключался уже и к своей удаленной базе, думал в этом проблема, установил Denwer - ТА ЖЕ ситуация...
  13. I've posted a message on the discord server and followed the https://discordapp.com/channels/183979885788659713/379670365061775360/615468230294896640 tutorial, as instructed. Now I can actually create the db context, but I get an error when trying to use it: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.PlatformNotSupportedException: Microsoft.Data.SqlClient is not supported on this platform. at new Microsoft.Data.SqlClient.SqlConnection(string connectionString) at DbConnection Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerConnection.CreateDbConnection() at DbConnection Microsoft.EntityFrameworkCore.Storage.RelationalConnection.get_DbConnection() at DbCommand Microsoft.EntityFrameworkCore.Storage.RelationalCommand.CreateCommand(RelationalCommandParameterObject parameterObject, Guid commandId, DbCommandMethod commandMethod) at RelationalDataReader Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReader(RelationalCommandParameterObject parameterObject) at bool Microsoft.EntityFrameworkCore.Query.RelationalShapedQueryCompilingExpressionVisitor+QueryingEnumerable<T>+Enumerator.MoveNext() at TSource System.Linq.Enumerable.Single<TSource>(IEnumerable<TSource> source) at TResult Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.Execute<TResult>(Expression query) at TResult Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryProvider.Execute<TResult>(Expression expression) at int System.Linq.Queryable.Count<TSource>(IQueryable<TSource> source) at new TestResource.Main() in D:\Games\RageMP\server-files\bridge\resources\TestResource\Main.cs:line 15 --- End of inner exception stack trace --- at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean wrapExceptions, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& hasNoDefaultCtor) at System.RuntimeType.CreateInstanceDefaultCtorSlow(Boolean publicOnly, Boolean wrapExceptions, Boolean fillCache) at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, Boolean wrapExceptions) at System.Activator.CreateInstance(Type type, Boolean nonPublic, Boolean wrapExceptions) at GTANetworkInternals.GameServer.InstantiateScripts(Assembly targetAssembly, String resourceName)+MoveNext() at System.Linq.Enumerable.SelectEnumerableIterator`2.MoveNext() at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection) at GTANetworkInternals.GameServer.StartResource(String resourceName, String parent) using Database; using GTANetworkAPI; using System; using System.Linq; namespace TestResource { public class Main : Script { public Main() { Console.WriteLine("Hello World"); using (var dbContext = new ServerDbContext()) { Console.WriteLine($"There are {dbContext.Accounts.Count()} accounts in the database!"); } } } }
  14. Version 1.1.0

    92 downloads

    About this File I used this res to create my res: Shortcuts (Animations) on Numpad 1.0.0 Before first Startup: you import db.sql in your Database and change "Yourname" in the record or leave it. I used RPC in this example, install it. My node_modules are in the archive located. Do this on Login/Startup Serverside gm.mysql.handle.query("SELECT * FROM shortcuts WHERE name = ?", [player.name], function (err10,res10) { if (err10) console.log("Error in loadShortcuts: "+err10); if (res10.length > 0) { res10.forEach(function (shortcutData) { player.data.numpad1A = shortcutData.num1animA; player.data.numpad1B = shortcutData.num1animB; player.data.numpad1C = shortcutData.num1animC; player.data.numpad1D = shortcutData.num1animD; player.data.numpad1Name = shortcutData.num1name; player.data.numpad2A = shortcutData.num2animA; player.data.numpad2B = shortcutData.num2animB; player.data.numpad2C = shortcutData.num2animC; player.data.numpad2D = shortcutData.num2animD; player.data.numpad2Name = shortcutData.num2name; player.data.numpad3A = shortcutData.num3animA; player.data.numpad3B = shortcutData.num3animB; player.data.numpad3C = shortcutData.num3animC; player.data.numpad3D = shortcutData.num3animD; player.data.numpad3Name = shortcutData.num3name; player.data.numpad4A = shortcutData.num4animA; player.data.numpad4B = shortcutData.num4animB; player.data.numpad4C = shortcutData.num4animC; player.data.numpad4D = shortcutData.num4animD; player.data.numpad4Name = shortcutData.num4name; player.data.numpad5A = shortcutData.num5animA; player.data.numpad5B = shortcutData.num5animB; player.data.numpad5C = shortcutData.num5animC; player.data.numpad5D = shortcutData.num5animD; player.data.numpad5Name = shortcutData.num5name; player.data.numpad6A = shortcutData.num6animA; player.data.numpad6B = shortcutData.num6animB; player.data.numpad6C = shortcutData.num6animC; player.data.numpad6D = shortcutData.num6animD; player.data.numpad6Name = shortcutData.num6name; player.data.numpad7A = shortcutData.num7animA; player.data.numpad7B = shortcutData.num7animB; player.data.numpad7C = shortcutData.num7animC; player.data.numpad7D = shortcutData.num7animD; player.data.numpad7Name = shortcutData.num7name; player.data.numpad8A = shortcutData.num8animA; player.data.numpad8B = shortcutData.num8animB; player.data.numpad8C = shortcutData.num8animC; player.data.numpad8D = shortcutData.num8animD; player.data.numpad8Name = shortcutData.num8name; player.data.numpad9A = shortcutData.num9animA; player.data.numpad9B = shortcutData.num9animB; player.data.numpad9C = shortcutData.num9animC; player.data.numpad9D = shortcutData.num9animD; player.data.numpad9Name = shortcutData.num9name; }); }else{ gm.mysql.handle.query("INSERT INTO shortcuts SET name = ?", [player.name], function (insertError) { if (insertError) console.log(`[Shortcuts Init Error] ${err.message}`); if(!insertError){ gm.mysql.handle.query("SELECT * FROM shortcuts WHERE name = ?", [player.name], function (err10,res10) { if (err10) console.log("Error in loadShortcuts: "+err10); if (res10.length > 0) { res10.forEach(function (shortcutData) { player.data.numpad1A = shortcutData.num1animA; player.data.numpad1B = shortcutData.num1animB; player.data.numpad1C = shortcutData.num1animC; player.data.numpad1D = shortcutData.num1animD; player.data.numpad1Name = shortcutData.num1name; player.data.numpad2A = shortcutData.num2animA; player.data.numpad2B = shortcutData.num2animB; player.data.numpad2C = shortcutData.num2animC; player.data.numpad2D = shortcutData.num2animD; player.data.numpad2Name = shortcutData.num2name; player.data.numpad3A = shortcutData.num3animA; player.data.numpad3B = shortcutData.num3animB; player.data.numpad3C = shortcutData.num3animC; player.data.numpad3D = shortcutData.num3animD; player.data.numpad3Name = shortcutData.num3name; player.data.numpad4A = shortcutData.num4animA; player.data.numpad4B = shortcutData.num4animB; player.data.numpad4C = shortcutData.num4animC; player.data.numpad4D = shortcutData.num4animD; player.data.numpad4Name = shortcutData.num4name; player.data.numpad5A = shortcutData.num5animA; player.data.numpad5B = shortcutData.num5animB; player.data.numpad5C = shortcutData.num5animC; player.data.numpad5D = shortcutData.num5animD; player.data.numpad5Name = shortcutData.num5name; player.data.numpad6A = shortcutData.num6animA; player.data.numpad6B = shortcutData.num6animB; player.data.numpad6C = shortcutData.num6animC; player.data.numpad6D = shortcutData.num6animD; player.data.numpad6Name = shortcutData.num6name; player.data.numpad7A = shortcutData.num7animA; player.data.numpad7B = shortcutData.num7animB; player.data.numpad7C = shortcutData.num7animC; player.data.numpad7D = shortcutData.num7animD; player.data.numpad7Name = shortcutData.num7name; player.data.numpad8A = shortcutData.num8animA; player.data.numpad8B = shortcutData.num8animB; player.data.numpad8C = shortcutData.num8animC; player.data.numpad8D = shortcutData.num8animD; player.data.numpad8Name = shortcutData.num8name; player.data.numpad9A = shortcutData.num9animA; player.data.numpad9B = shortcutData.num9animB; player.data.numpad9C = shortcutData.num9animC; player.data.numpad9D = shortcutData.num9animD; player.data.numpad9Name = shortcutData.num9name; }); } }) } }) } }); if you need more contact me
  15. Und warum die Placeholder benutzen wenn man einfach das machen kann: misc.query(`INSERT INTO weapon_shops SET ShopX=${pos.x}, ShopY=${pos.y}, ShopZ=${pos.z}`, ...
  16. Try wrapping your whole code into a try catch like this: try { var mysql = require('mysql'); let mysqlc = mysql.createConnection({ host: '...', user: '...', password: '...', database: '...' }); mysqlc.connect(function(e) { console.log('Connecting ... '); if(e) { console.log("Error connecting to the database with error "+e); } else { console.log('Database connected!') } }); mp.events.add("CheckedLogin", (UserName, Password) => { console.log('Call ... '); mysqlc.query("SELECT * FROM `Player` WHERE `UserName`=", [UserName], function(e, r) { console.log('Load ... '); if(e) { console.log('Error on connection ... '); throw e; } else { console.log('Password is '); } }); mysqlc.end(); }); } catch(e) { console.log(e); }
  17. Sorry for the error, the only thing he writes to the console is: console.log ('Call ...'); At the very beginning of the event, and I put the message in the console after mysqlc.query, he also writes, but everything in mysqlc.query cohd something passes by.
  18. Good day, friends, help solve the problem. The fact is that MYSQL is connected, and the query is not executed at all. Does not write anything to the console. Help Sorry for my English var mysql = require('mysql'); let mysqlc = mysql.createConnection({ host: '...', user: '...', password: '...', database: '...' }); mysqlc.connect(function(e) { console.log('Connecting ... '); if(e) { console.log("Error connecting to the database with error "+e); } else { console.log('Database connected!') } }); mp.events.add("CheckedLogin", (UserName, Password) => { console.log('Call ... '); mysqlc.query("SELECT * FROM `Player` WHERE `UserName`=", [UserName], function(e, r) { console.log('Load ... '); if(e) { console.log('Error on connection ... '); throw e; } else { console.log('Password is '); } }); mysqlc.end(); }); The event call works, but after the query in the database, nothing works ... Thank!
  19. used: < npm update mysql > | < npm -g update mysql > and < npm update -g mysql > console.log("step 0"); var mysql = require('mysql'); var mysqlc = mysql.createConnection({ host:'localhost',// host of server user:'root',// MySQL user password:'',// MySQL password database:'rage_bados'// MySQL database }); mysqlc.connect(function(e) { if(e) { console.log("Error connecting to the database with error "+e); } else { console.log('Database connected!') } }); mysqlc.end(); mysqlc.query("SELECT * FROM `users` WHERE `nickname`=", [], function(e, r) { if(e) { console.log('Error on connection ... '); throw e; } else { console.log('Password is '+r[0].passcode); } }); ERROR: step 0 Error: Error: Cannot find module 'mysql' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15) at Function.Module._load (internal/modules/cjs/loader.js:507:25) at Module.require (internal/modules/cjs/loader.js:637:17) at require (internal/modules/cjs/helpers.js:20:18) at Object.<anonymous> (D:\RAGEMP\server-files\packages\freeroam\index.js:15:13) at Module._compile (internal/modules/cjs/loader.js:689:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10) at Module.load (internal/modules/cjs/loader.js:599:32) at tryModuleLoad (internal/modules/cjs/loader.js:538:12) at Function.Module._load (internal/modules/cjs/loader.js:530:3)
  20. Писал и < npm update mysql > и < npm -g update mysql > и < npm update -g mysql > console.log("step 0"); var mysql = require('mysql'); var mysqlc = mysql.createConnection({ host:'localhost',// host of server user:'root',// MySQL user password:'',// MySQL password database:'rage_bados'// MySQL database }); mysqlc.connect(function(e) { if(e) { console.log("Error connecting to the database with error "+e); } else { console.log('Database connected!') } }); mysqlc.end(); mysqlc.query("SELECT * FROM `users` WHERE `nickname`=", [], function(e, r) { if(e) { console.log('Error on connection ... '); throw e; } else { console.log('Password is '+r[0].passcode); } }); Error: Error: Cannot find module 'mysql' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15) at Function.Module._load (internal/modules/cjs/loader.js:507:25) at Module.require (internal/modules/cjs/loader.js:637:17) at require (internal/modules/cjs/helpers.js:20:18) at Object.<anonymous> (D:\RAGEMP\server-files\packages\freeroam\index.js:15:13) at Module._compile (internal/modules/cjs/loader.js:689:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10) at Module.load (internal/modules/cjs/loader.js:599:32) at tryModuleLoad (internal/modules/cjs/loader.js:538:12) at Function.Module._load (internal/modules/cjs/loader.js:530:3)
  21. https://github.com/mysqljs/mysql#escaping-query-values Les dir das mal durch. Dort siehst du das dort steht "Strings are safely escaped", und damit ist auch gemeint, dass die Apostrophe eingesetzt werden. Bitte verbreite hier kein Halbwissen, du redest hier nämlich einfach nur Schwachsinn, ohne dich zu informieren.
  22. Any idea to add "if statement" to check if the letters is not a-z or 0-9 then give them errors I find some function to check it but I don't know how to use it Sorry about this question I'm pretty new case 1: //Register State { if(username.length >= 3 && pass.length >= 5){ gm.mysql.handle.query('SELECT * FROM `accounts` WHERE `username` = ?', [username], function(err, res){ if(res.length > 0){ player.call("loginHandler", ["takeninfo"]); } else { bcrypt.hash(pass, null, null, function(err, hash) { if(!err){ gm.mysql.handle.query('INSERT INTO `accounts` SET username = ?, password = ?', [username, hash], function(err, res){ if(!err){ player.name = username; player.call("loginHandler", ["registered"]); gm.auth.registerAccount(player); console.log("\x1b[92m" + username + "\x1b[39m has just registered."); } else { console.log("\x1b[31m[ERROR] " + err) } }); } else { console.log("\x1b[31m[BCrypt]: " + err) } }); } }); } else { player.call("loginHandler", ["tooshort"]); } break; }
  23. There's a couple red flags with this whole projects - No credits have been given, you're using multiple resources which have come from RageMP (which is 100% fine, they're free and open) but you haven't taken the time to even credit those who made these. - According to comments, you've also ripped off sources that may not have been open source for the public, and so far you've avoided responded to anyone about this. - Looking briefly over the code, there's a lot of really bad code, you can easily see it has been copy/pasted as some functions have been developed really inefficiently (e.g you're calling multiple queries one after the other, imagine a lot of people using that function at the same time) and also if a query errors, your letting the code continue to run instead of ending the function when it errors. - This is all put together in 7 days. While it's good for new developers to come and release resources no matter if they're new or experienced, I feel like this has been very rushed, slapped together and pushed out. I really hope code hasn't been stolen from other private projects.
  24. Version 1.0.0

    326 downloads

    Load this Variables on Login: gm.mysql.handle.query("SELECT * FROM shortcuts WHERE charId = ?", [player.data.charId], function (err10,res10) { if (err10) console.log("Error in loadShortcuts: "+err10); if (res10.length > 0) { res10.forEach(function (shortcutData) { player.data.numpad1A = shortcutData.num1animA; player.data.numpad1B = shortcutData.num1animB; player.data.numpad1C = shortcutData.num1animC; player.data.numpad1D = shortcutData.num1animD; player.data.numpad1Name = shortcutData.num1name; player.data.numpad2A = shortcutData.num2animA; player.data.numpad2B = shortcutData.num2animB; player.data.numpad2C = shortcutData.num2animC; player.data.numpad2D = shortcutData.num2animD; player.data.numpad2Name = shortcutData.num2name; player.data.numpad3A = shortcutData.num3animA; player.data.numpad3B = shortcutData.num3animB; player.data.numpad3C = shortcutData.num3animC; player.data.numpad3D = shortcutData.num3animD; player.data.numpad3Name = shortcutData.num3name; player.data.numpad4A = shortcutData.num4animA; player.data.numpad4B = shortcutData.num4animB; player.data.numpad4C = shortcutData.num4animC; player.data.numpad4D = shortcutData.num4animD; player.data.numpad4Name = shortcutData.num4name; player.data.numpad5A = shortcutData.num5animA; player.data.numpad5B = shortcutData.num5animB; player.data.numpad5C = shortcutData.num5animC; player.data.numpad5D = shortcutData.num5animD; player.data.numpad5Name = shortcutData.num5name; player.data.numpad6A = shortcutData.num6animA; player.data.numpad6B = shortcutData.num6animB; player.data.numpad6C = shortcutData.num6animC; player.data.numpad6D = shortcutData.num6animD; player.data.numpad6Name = shortcutData.num6name; player.data.numpad7A = shortcutData.num7animA; player.data.numpad7B = shortcutData.num7animB; player.data.numpad7C = shortcutData.num7animC; player.data.numpad7D = shortcutData.num7animD; player.data.numpad7Name = shortcutData.num7name; player.data.numpad8A = shortcutData.num8animA; player.data.numpad8B = shortcutData.num8animB; player.data.numpad8C = shortcutData.num8animC; player.data.numpad8D = shortcutData.num8animD; player.data.numpad8Name = shortcutData.num8name; player.data.numpad9A = shortcutData.num9animA; player.data.numpad9B = shortcutData.num9animB; player.data.numpad9C = shortcutData.num9animC; player.data.numpad9D = shortcutData.num9animD; player.data.numpad9Name = shortcutData.num9name; }); } }); Contact: You can Contact me on Discord for Questions. https://discord.gg/epD7fsv I can make Scripts for you write me on Discord please German my english is so Bad : SnillocTV
  25. Hello,there is sth wrong with the started [Business] 9 loaded. (node:21292) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'x' of null at global.UpdateBizz3D (D:\ragemp\server-files\packages\server\src\systems\business\index.js:101:24) at Business.forEach (D:\ragemp\server-files\packages\server\src\systems\business\index.js:74:7) at Array.forEach (<anonymous>) at query.then (D:\ragemp\server-files\packages\server\src\systems\business\index.js:73:14) at process._tickCallback (internal/process/next_tick.js:68:7) (node:21292) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:21292) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. [Data] 5 loaded. [Houses] 5 loaded. What should I do?I googled it but I couldn't find anything helpful....