MYSQL FiveM Scripting C#

I’m beginner the scripting in fivem

My Question is how to add mysql library in my c# script ?

There is my code

Finally /savepos cmd not respose in game. Then i pressed F8 for debug. Error is here

How i use MySql.Data.MySqlClient; ? And how to import my c# file ?

Make sure you have copied all .dll's in your output folder to the folder of your resource.

Remember that you cannot connect to anything external on client side! You can only connect to MySQL on the server side

Okey, how i insert a query ? Can you show a example for mysql connection and insert some values ?

I wants current xyz position insert the database when a player entered /savepos command

in c# :slight_smile:

You need to trigger an event on the server from the client with the coordinates, then insert it from the server

how can I do it ? Can you show a example ?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.