Jump to content

Xabi

Moderators
  • Posts

    1444
  • Joined

  • Last visited

  • Days Won

    83

Posts posted by Xabi

  1. 18 hours ago, FedexRight said:

    Fix bugs with inventory.

    Currently i have other projects on mind, so you can always fix it yourself if you need it done quick.

     

    19 hours ago, Geekbee said:
    
    private static String connectionString = "SERVER=" + host + "Port="+ port + "; DATABASE=" + database + "; UID=" + user + "; PASSWORD=" + pass + "; SSLMODE=none;";
    
    and
      
    private static String connectionString = "SERVER=" + host + "Port="+ port + "; DATABASE=" + database + "; UID=" + user + "; PASSWORD=" + pass + "; SSLMODE=required;";
    
    same error from last Pic
      
      
      https://imgur.com/a/amU5hKT

     

    After setting SSLMODE=none you compiled the project?

  2. 4 hours ago, Geekbee said:
    
    -> SERVER STARTED AT 21.07.2018 17:19:18
    Loaded 498 entries from vehicleData.json
    Loading resources..
    -> Starting WiredPlayers resource..
    WiredPlayers: setting as Gamemode resource
    WiredPlayers: loading scripts.. found 1 script(s)
    WiredPlayers: instantiating WiredPlayers.weazelNews.WeazelNews..
    WiredPlayers: instantiating WiredPlayers.weapons.Weapons..
    WiredPlayers: instantiating WiredPlayers.vehicles.Vehicles..
    WiredPlayers: instantiating WiredPlayers.TownHall.TownHall..
    WiredPlayers: instantiating WiredPlayers.thief.Thief..
    WiredPlayers: instantiating WiredPlayers.telephone.Telephone..
    WiredPlayers: instantiating WiredPlayers.police.Police..
    WiredPlayers: instantiating WiredPlayers.parking.Parking..
    WiredPlayers: instantiating WiredPlayers.mechanic.Mechanic..
    WiredPlayers: instantiating WiredPlayers.login.Login..
    WiredPlayers: instantiating WiredPlayers.house.House..
    WiredPlayers: instantiating WiredPlayers.furniture.Furniture..
    WiredPlayers: instantiating WiredPlayers.hooker.Hooker..
    WiredPlayers: instantiating WiredPlayers.globals.Globals..
    WiredPlayers: instantiating WiredPlayers.garbage.Garbage..
    WiredPlayers: instantiating WiredPlayers.fishing.Fishing..
    WiredPlayers: instantiating WiredPlayers.fastfood.FastFood..
    WiredPlayers: instantiating WiredPlayers.faction.Faction..
    WiredPlayers: instantiating WiredPlayers.faction.Job..
    WiredPlayers: instantiating WiredPlayers.emergency.Emergency..
    WiredPlayers: instantiating WiredPlayers.drivingschool.DrivingSchool..
    WiredPlayers: instantiating WiredPlayers.database.Database..
    WiredPlayers: instantiating WiredPlayers.chat.Chat..
    WiredPlayers: instantiating WiredPlayers.carshop.CarShop..
    WiredPlayers: instantiating WiredPlayers.business.Business..
    WiredPlayers: instantiating WiredPlayers.bank.Bank..
    WiredPlayers: instantiating WiredPlayers.Animations.Animations..
    WiredPlayers: instantiating WiredPlayers.admin.Admin..
    WiredPlayers: loading server events.. found 5 server event(s)
    WiredPlayers: loading server events.. found 4 server event(s)
    WiredPlayers: loading server events.. found 1 server event(s)
    WiredPlayers: loading server events.. found 2 server event(s)
    WiredPlayers: loading server events.. found 1 server event(s)
    WiredPlayers: loading server events.. found 1 server event(s)
    WiredPlayers: loading server events.. found 3 server event(s)
    WiredPlayers: loading server events.. found 3 server event(s)
    WiredPlayers: loading server events.. found 3 server event(s)
    WiredPlayers: loading server events.. found 2 server event(s)
    WiredPlayers: loading server events.. found 1 server event(s)
    WiredPlayers: loading server events.. found 1 server event(s)
    WiredPlayers: loading server events.. found 5 server event(s)
    WiredPlayers: loading server events.. found 1 server event(s)
    WiredPlayers: loading server events.. found 1 server event(s)
    WiredPlayers: loading server events.. found 2 server event(s)
    WiredPlayers: loaded 36 server events(s)
    WiredPlayers: loading commands.. found 5 command(s)
    WiredPlayers: loading commands.. found 1 command(s)
    WiredPlayers: loading commands.. found 9 command(s)
    WiredPlayers: loading commands.. found 1 command(s)
    WiredPlayers: loading commands.. found 4 command(s)
    WiredPlayers: loading commands.. found 5 command(s)
    WiredPlayers: loading commands.. found 12 command(s)
    WiredPlayers: loading commands.. found 2 command(s)
    WiredPlayers: loading commands.. found 3 command(s)
    WiredPlayers: loading commands.. found 3 command(s)
    WiredPlayers: loading commands.. found 1 command(s)
    WiredPlayers: loading commands.. found 1 command(s)
    WiredPlayers: loading commands.. found 18 command(s)
    WiredPlayers: loading commands.. found 1 command(s)
    WiredPlayers: loading commands.. found 1 command(s)
    WiredPlayers: loading commands.. found 1 command(s)
    WiredPlayers: loading commands.. found 13 command(s)
    WiredPlayers: loading commands.. found 2 command(s)
    WiredPlayers: loading commands.. found 4 command(s)
    WiredPlayers: loading commands.. found 2 command(s)
    WiredPlayers: loading commands.. found 10 command(s)
    WiredPlayers: loading commands.. found 1 command(s)
    WiredPlayers: loading commands.. found 56 command(s)
    WiredPlayers: loading commands.. found 29 command(s)
    WiredPlayers: loaded 185 commands(s)
    WiredPlayers: loading remote events.. found 1 remote event(s)
    WiredPlayers: loading remote events.. found 3 remote event(s)
    WiredPlayers: loading remote events.. found 2 remote event(s)
    WiredPlayers: loading remote events.. found 4 remote event(s)
    WiredPlayers: loading remote events.. found 3 remote event(s)
    WiredPlayers: loading remote events.. found 6 remote event(s)
    WiredPlayers: loading remote events.. found 6 remote event(s)
    WiredPlayers: loading remote events.. found 2 remote event(s)
    WiredPlayers: loading remote events.. found 6 remote event(s)
    WiredPlayers: loading remote events.. found 4 remote event(s)
    WiredPlayers: loading remote events.. found 1 remote event(s)
    WiredPlayers: loading remote events.. found 1 remote event(s)
    WiredPlayers: loading remote events.. found 2 remote event(s)
    WiredPlayers: loading remote events.. found 8 remote event(s)
    WiredPlayers: loading remote events.. found 2 remote event(s)
    WiredPlayers: loaded 51 remote event(s)
    -> Error starting 'WiredPlayers'
    System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> MySql.Data.MySqlClient.MySqlException: The host 127.0.0.1 does not support SSL connections.
       at void MySql.Data.MySqlClient.NativeDriver.Open()
       at void MySql.Data.MySqlClient.Driver.Open()
       at Driver MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder settings)
       at Driver MySql.Data.MySqlClient.MySqlPool.CreateNewPooledConnection()
       at Driver MySql.Data.MySqlClient.MySqlPool.GetPooledConnection()
       at Driver MySql.Data.MySqlClient.MySqlPool.TryToGetDriver()
       at Driver MySql.Data.MySqlClient.MySqlPool.GetConnection()
       at void MySql.Data.MySqlClient.MySqlConnection.Open()
       at List<BusinessModel> WiredPlayers.database.Database.LoadAllBusiness() in E:\RageMP\server-files\bridge\resources\WiredPlayers\database\Database.cs:line 1204
       at void WiredPlayers.business.Business.LoadDatabaseBusiness() in E:\RageMP\server-files\bridge\resources\WiredPlayers\business\Business.cs:line 18
       at void WiredPlayers.database.Database.OnResourceStart() in E:\RageMP\server-files\bridge\resources\WiredPlayers\database\Database.cs:line 40
       --- End of inner exception stack trace ---
       at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
       at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
       at GTANetworkInternals.ScriptingEngine.InvokeVoidMethod(String method, Object[] args)
       at System.Collections.Generic.List`1.ForEach(Action`1 action)
       at GTANetworkInternals.EventHandler.ParseEx(Event _event, ScriptingEngine engine, Object[] arguments)
       at System.Collections.Generic.List`1.ForEach(Action`1 action)
       at GTANetworkInternals.GameServer.StartResource(String resourceName, String parent)
    
    Started! Waiting for connections..

    Okay Fixxed 

    Maybe your fix Database.cs on line 1204, and 40 and last one Business.cs on line 18 ;) have a nice day :P

    That's the same error above, you have an older MySQL version that doesn't support SSL.

  3. 1 hour ago, Roven said:

    Thank you!

    Here are two methods

    InitializePlayerData(player);
    Initialize Player Skin(player);

    Since the skin of the player is given by the method

    
    Task.Factory.StartNew(() =>
                {
                    AccountModel account = DataBase.GetAccount(player.Name);
    
                    switch (account.Status)
                    {
                        case -1:
                            NAPI.Chat.SendChatMessageToPlayer(player, Constants.COLOR_INFO + Messages.INF_ACCOUNT_DISABLED);
                            NAPI.Player.KickPlayer(player, Messages.INF_ACCOUNT_DISABLED);
                            break;
                        case 0:
                            NAPI.Chat.SendChatMessageToPlayer(player, Constants.COLOR_INFO + Messages.INF_ACCOUNT_NEW);
                            NAPI.Player.KickPlayer(player, Messages.INF_ACCOUNT_NEW);
                            break;
                        default:
                            // Welcome message
                            String welcomeMessage = String.Format(Messages.GEN_WELCOME_MESSAGE, player.Name);
                            NAPI.Chat.SendChatMessageToPlayer(player, welcomeMessage);
                            NAPI.Chat.SendChatMessageToPlayer(player, Messages.GEN_WELCOME_HINT);
                            NAPI.Chat.SendChatMessageToPlayer(player, Messages.GEN_HELP_HINT);
                            NAPI.Chat.SendChatMessageToPlayer(player, Messages.GEN_TICKET_HINT);
    
                            if (account.Skin > 0)
                            {
                                // Load selected character
                                PlayerModel character = DataBase.LoadCharacterInformationById(account.Skin);
                                SkinModel skin = DataBase.GetCharacterSkin(account.Skin);
    
                                NAPI.Player.SetPlayerName(player, character.RealName);
                                NAPI.Player.SetPlayerSkin(player, character.Sex == 0 ? PedHash.FreemodeMale01 : PedHash.FreemodeFemale01);
    
                                LoadCharacterData(player, character);
    
                                PopulateCharacterSkin(player, skin);
                            }
                            else
                            {
                                // Set the default skin a_c_coyote
                                NAPI.Player.SetPlayerSkin(player, PedHash.Strperf01SMM);
                            }
    
                            // Make the player invisible
                            NAPI.Entity.SetEntityTransparency(player, 255);
    
                            // Activate the login window
                            NAPI.Data.SetEntitySharedData(player, EntityData.SERVER_TIME, DateTime.Now.ToString("HH:mm:ss"));
    
                            break;
                    }
                });


    // Set the default skin a_c_coyote
     NAPI.Player.SetPlayerSkin(player, PedHash.Strperf01SMM);

    Can you tell what they do
    I why ask, just studying this project

    If you have questions about the API, you have them documented on the wiki:

    https://wiki.gtanet.work/index.php?title=Main_Page

    https://wiki.rage.mp/index.php?title=Main_Page

  4. 15 minutes ago, Roven said:
    
    mp.events.add('guiReady', () => 
    {
        // Remove health regeneration
        mp.game.player.setHealthRechargeMultiplier(0.0);
    
    	// Remove weapons from the vehicles
    	mp.game.player.disableVehicleRewards();
    
    	// Freeze the player until he logs in
    	mp.players.local.freezePosition(true);
    
        // Show the login panel when all is loaded
        /*loginTimer = setInterval(function() 
        {
            // Get the time from the server
            let serverTime = mp.players.local.getVariable('SERVER_TIME');
            if(serverTime !== undefined)
            {
                // Clear the timer
                clearInterval(loginTimer);
                loginTimer = undefined;
                
                // Set the hour from the server
                let time = serverTime.split(':');
                let hours = parseInt(time[0]);
                let minutes = parseInt(time[1]);
                let seconds = parseInt(time[2]);
                mp.game.time.setClockTime(hours, minutes, seconds);
            }
            // Show the login window
            mp.events.call('accountLoginForm');
        }, 100);*/
    	// Show the login window
    	mp.events.call('accountLoginForm');
    });

    Good.
    I still wonder...
    Why is the accountLoginForm method executed when I don't call the guiReady method?

    I call the method guiReady in the backend, but he's here in the client side is invoked itself

    It's not a method, it's an event that gets called when the player has fully loaded the client scripts.

  5. 20 hours ago, Roven said:
    
    mp.events.add('requestPlayerLogin', (userName, userPassword, status) => {
    	setTimeout(function()
    	{
    		// Check for the credentials
    		mp.events.callRemote('loginAccount', userName, userPassword, status);
    	}, 100);
    });

    Server: Login
     

    
    [RemoteEvent("loginAccount")]
            public void LoginAccountEvent(Client player, String password)
            {
                Task.Factory.StartNew(() =>
                {
                    bool login = Database.LoginAccount(player.SocialClubName, password);
                    NAPI.ClientEvent.TriggerClientEvent(player, login ? "clearLoginWindow" : "showLoginError");
                });
                
            }


    Server: database

     

    
    public static bool LoginAccount(String socialName, String password)
            {
                bool login = false;
    
                using (MySqlConnection connection = new MySqlConnection(connectionString))
                {
                    connection.Open();
                    MySqlCommand command = connection.CreateCommand();
                    command.CommandText = "SELECT status FROM accounts WHERE socialName = @socialName AND password = md5(@password) LIMIT 1";
                    command.Parameters.AddWithValue("@socialName", socialName);
                    command.Parameters.AddWithValue("@password", password);
    
                    using (MySqlDataReader reader = command.ExecuteReader())
                    {
                        login = reader.HasRows;
                    }
                }
    
                return login;
            }


    You can find out what makes this function?
     

    
    mp.events.add('executeFunction', (arguments) => {
    	// Check for the parameters
    	let input = '';
    	
    	for(let i = 1; i < arguments.length; i++) {
    		if(input.length > 0) {
    			input += ', \'' + arguments[i] + '\'';
    		} else {
    			input = '\'' + arguments[i] + '\'';
    		}
    	}
    	
    	// Call the function with the parameters
    	customBrowser.execute(`${arguments[0]}(${input});`);
    });

     

    That event is used to call functions when CEF is loaded.

  6. 15 minutes ago, Roven said:

    Hello dears! And how do you use the registration system for players? After all, there is a check on the name in the social club. Do all players have to be registered in the social club?

    Why enter a name in the rage client in the settings then?

    Obviously you need to have a Social Club account, piracy is not supported.

  7. 17 hours ago, KINGVDK said:

    I use the Denwer database

    As I see, it uses MySQL 5.1 so just edit that connectionString variable into Database.cs file, and change SSLMODE=required to SSLMODE=none.

    After that make sure you compile the solution in order to apply the new changes.

  8. 7 minutes ago, KINGVDK said:
    
    WiredPlayers: loaded 51 remote event(s)
    -> Error starting 'WiredPlayers'
    System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> MySql.Data.MySqlClient.MySqlException: The host 127.0.0.1 does not support SSL connections.
       at void MySql.Data.MySqlClient.NativeDriver.Open()
       at void MySql.Data.MySqlClient.Driver.Open()
       at Driver MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder settings)
       at Driver MySql.Data.MySqlClient.MySqlPool.CreateNewPooledConnection()
       at Driver MySql.Data.MySqlClient.MySqlPool.GetPooledConnection()
       at Driver MySql.Data.MySqlClient.MySqlPool.TryToGetDriver()
       at Driver MySql.Data.MySqlClient.MySqlPool.GetConnection()
       at void MySql.Data.MySqlClient.MySqlConnection.Open()
       at List<BusinessModel> WiredPlayers.database.Database.LoadAllBusiness() in D:\RAGEMP\server-files\bridge\resources\WiredPlayers\database\Database.cs:line 1204
       at void WiredPlayers.business.Business.LoadDatabaseBusiness() in D:\RAGEMP\server-files\bridge\resources\WiredPlayers\business\Business.cs:line 18
       at void WiredPlayers.database.Database.OnResourceStart() in D:\RAGEMP\server-files\bridge\resources\WiredPlayers\database\Database.cs:line 40
       --- End of inner exception stack trace ---
       at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
       at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
       at GTANetworkInternals.ScriptingEngine.InvokeVoidMethod(String method, Object[] args)
       at System.Collections.Generic.List`1.ForEach(Action`1 action)
       at GTANetworkInternals.EventHandler.ParseEx(Event _event, ScriptingEngine engine, Object[] arguments)
       at System.Collections.Generic.List`1.ForEach(Action`1 action)
       at GTANetworkInternals.GameServer.StartResource(String resourceName, String parent)

    Tell me what's wrong?

    Set SSLMode=none on the database connection string, located on Database.cs file or upgrade MySQL server to 8.0 version.

  9. 1 hour ago, Roven said:

    Thanks so much

    So I just need to put it in a folder and leave it where the server files and the itself server.exe?

    The whole gamemode should be under server-files folder, keeping the same structure it already has.

  10. 1 minute ago, kappi said:

    Hey awesome work ! ❤️ 

    Unluckily i have problems to save the characterinformation to the "users" table in db

    Someone here had i too 

    
    MySql.Data.MySqlClient.MySqlException (0x80004005): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'rank = 0, duty = 0, phone = 0, carKeys = '0,0,0,0,0', documentation = 0, license' at line 1
       at MySqlPacket MySql.Data.MySqlClient.MySqlStream.ReadPacket()
       at int MySql.Data.MySqlClient.NativeDriver.GetResult(ref int affectedRow, ref long insertedId)
       at ResultSet MySql.Data.MySqlClient.Driver.NextResult(int statementId, bool force)
       at bool MySql.Data.MySqlClient.MySqlDataReader.NextResult()
       at MySqlDataReader MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)

     

    You're using MySQL 8.0, right? If so, try with 5.6 or so, still have to test that with 8.0 to know where the bug could be. Maybe it's a new reserved word or something like that.

    • Like 1
×
×
  • Create New...