DeadSwimek / cs2-vip

VIP System
26 stars 8 forks source link

[help] I am getting error when trying to add VIP #10

Closed y3request closed 12 months ago

y3request commented 12 months ago
02:28:32 [EROR] (cssharp:Core) Error invoking callback
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at VIP.VIP.CommandAddVIP(CCSPlayerController player, CommandInfo info) in **C:\Users\ondra\Desktop\CS2 Pluginy\VIPGUNS Public\Commands.cs:line 242**
   at CounterStrikeSharp.API.Core.BasePlugin.<>c__DisplayClass35_0.<AddCommand>b__0(Int32 i, IntPtr ptr) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/BasePlugin.cs:line 220
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
   --- End of inner exception stack trace ---
   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at CounterStrikeSharp.API.Core.FunctionReference.<>c__DisplayClass3_0.<.ctor>b__0(fxScriptContext* context) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/FunctionReference.cs:line 82

not sure how to fix. Its when I try to add a VIP.

y3request commented 12 months ago

Also this error too - 02:32:25 [EROR] (cssharp:Core) Error invoking callback System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> MySqlConnector.MySqlException (0x80004005): Unknown column 'group' in 'field list' at MySqlConnector.Core.ServerSession.ReceiveReplyAsync(IOBehavior ioBehavior, CancellationToken cancellationToken) in /_/src/MySqlConnector/Core/ServerSession.cs:line 936 at MySqlConnector.Core.ResultSet.ReadResultSetHeaderAsync(IOBehavior ioBehavior) in /_/src/MySqlConnector/Core/ResultSet.cs:line 37 at MySqlConnector.MySqlDataReader.ActivateResultSet(CancellationToken cancellationToken) in /_/src/MySqlConnector/MySqlDataReader.cs:line 130 at MySqlConnector.MySqlDataReader.InitAsync(CommandListPosition commandListPosition, ICommandPayloadCreator payloadCreator, IDictionary2 cachedProcedures, IMySqlCommand command, CommandBehavior behavior, Activity activity, IOBehavior ioBehavior, CancellationToken cancellationToken) in //src/MySqlConnector/MySqlDataReader.cs:line 483 at MySqlConnector.Core.CommandExecutor.ExecuteReaderAsync(CommandListPosition commandListPosition, ICommandPayloadCreator payloadCreator, CommandBehavior behavior, Activity activity, IOBehavior ioBehavior, CancellationToken cancellationToken) in //src/MySqlConnector/Core/CommandExecutor.cs:line 56 at MySqlConnector.MySqlCommand.ExecuteReaderAsync(CommandBehavior behavior, IOBehavior ioBehavior, CancellationToken cancellationToken) in //src/MySqlConnector/MySqlCommand.cs:line 357 at MySqlConnector.MySqlCommand.ExecuteReader() in //src/MySqlConnector/MySqlCommand.cs:line 112 at Nexd.MySQL.MySqlDb.<>cDisplayClass36_0.b0(MySqlConnection connection) at Nexd.MySQL.MySqlDb.CreateContext[T](Func`2 context) at Nexd.MySQL.MySqlDb.Insert(MySqlQueryValue data) at VIP.VIP.CommandGenerateVIP(CCSPlayerController player, CommandInfo info) in C:\Users\ondra\Desktop\CS2 Pluginy\VIPGUNS Public\Commands.cs:line 204 at CounterStrikeSharp.API.Core.BasePlugin.<>cDisplayClass35_0.b0(Int32 i, IntPtr ptr) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/BasePlugin.cs:line 220 at InvokeStub_Action2.Invoke(Object, Object, IntPtr*) at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr) --- End of inner exception stack trace --- at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Delegate.DynamicInvokeImpl(Object[] args) at CounterStrikeSharp.API.Core.FunctionReference.<>c__DisplayClass3_0.<.ctor>b__0(fxScriptContext* context) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/FunctionReference.cs:line 82

I have tried making a whole new database

"DBDatabase": "s2777_XXXXX", "DBUser": "u2777_XXXXXX", "DBPassword": "XXXXXXXX", "DBHost": "mysql.XXXX.com", "DBPort": 3306,

this is my database config inside the VIPJSon. I have double checked, made new databases. It doesnt seem to work.

DeadSwimek commented 12 months ago

Hello, u must added in mysql new column with name 'group' and int11. Must be added in table users and users_key_vip image

y3request commented 12 months ago

hmm, i am pretty new to this. I am not hosting the database locally. It is provided by my server rental company. I just have access to a control panel. How do I force a database to be created?

y3request commented 12 months ago

Screenshot 2023-12-01 025507 I got this far. hahaha.

DeadSwimek commented 12 months ago

image Generating good, iam create new database and working.

y3request commented 12 months ago

when i try to create a table

Executing: CREATE TABLE s2659_adminrank.users_key_vip ( );

Operation failed: There was an error while applying the SQL script to the database. ERROR 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 2

edit im ganna try to learn how to use MariaDB client really quick.

DeadSwimek commented 12 months ago

Try create tables by you. U maybe use old mysql version.

y3request commented 12 months ago

I dunno if i can figure this out. I have never done this. I have other plugins like the k4system and its connected to mysql database and I didnt have to do this.

I am trying though.

DeadSwimek commented 12 months ago

I can't help with that, its problem on your way. U must maybe create all tables by our own.

y3request commented 12 months ago

yeah I understand that. I just dont understand why only this plugin I have to do this, but other ones it just works.

I am trying to learn.

DeadSwimek commented 12 months ago

Bcs we using the newest version of mysql.

y3request commented 12 months ago

ok. i gotta learn how to connect to database and create table. trying. thanks

y3request commented 12 months ago

I got it, Screenshot 2023-12-01 033237 Screenshot 2023-12-01 025507

ahh i figured it out. i just made the "tag" a blank space.

thanks btw for the help. good plugin. no crash atm.