Scripting I need help can you help me please

Hello I want to make my own scripts but not sure how I have searched the internet and stuff but found only 1 tutorial and it doesn’t help me I just don’t know how to start off scripting if you can help me then thanks because I am really stuck.

So the thing is: What kind of script do you want to do? It generally helps me a lot to just break up my great idea into veeeery small babysteps to actually create a little script. You can start with something simple as showing a notification or a welcome message (“hello world”). Also think about the language you want to use (Lua or C# - i prefer C# but only because I’m a little more advanced in it and as far as i know both languages have the same possibilities

I have followed the hello world tutorial but I would like to start off with a simple script that would freeze a player like for admins can freeze a player if like they are in trouble there is probably scripts like that out there but I want to make my own but no idea how to.
I would prefer to use c # as I don’t know lua really I kinda know very very small amount of lua but know more of c#.

Would I be able to make a gta v mod like with c# and use that code for five m scripts like for example a simple give weapon mod then put it in to five m script or would it not work.

Alright let’s take that example. You want to Freeze a Player. The easiest way to do test a function like that is using a dedicated button for it. There are tutorials (for c#) which activate scripts and functions on the click of a button.

You cannot just copy-paste a ScriptHook Mod. But you can for example use NativeUI (which is pretty nice) to create your own interaction menu etc.

But you can always look at how the Scripthook-Modder did it and find your own way to do it with the CitizenFX.Core module. The native functions stay the same.

it’s a thing to want to make mod into c# , it’s another things to learn how to dev.

i advice you first if you don’t have any knowledge in dev to look at some tuto about basic programming .
and depending on how you are good to understand it , to start on lua or c#.

then you have a tons of example on the forum just take the time to look at it.
and as @Payzman said , start by simple thing to do , just for see how it’s working and get use to it.
and if your simple script are working , naturaly you will have idea for improve it.

good luck to you.

Say I am using c# how would I make a script with it like if you know a language then how do I take that knowledge and use it. For scripting

I want a tutorial on how to script five m with c# but none. For gtav there is tutorial but not for five m

i didn’t unsterdand what you mean in your message, so you have the basic knowledge in c# ?

if yes then you have few link who could help you :

https://forum.cfx.re/t/only-c-developing/37772

https://wiki.fivem.net/wiki/Main_Page

https://forum.cfx.re/t/scripting-in-fivem-using-c-where-to-start/7741

good luck

Thanks this should help me I have the basics of c# yes

fine , then it should be ok.
don’t mistaken the dlls , the one in your appdata/fivem is for client side and the one provide with your server file is for server side.

and prefer use the framework 4.5 instead of the 4.6.

Where are the tutorials for that then

This shows how to create a simple script with a notification (you can exchange that with anything else) on the click of a button (including setting up the Integrated Development Environment:

The difficult part is the actual freezing of a character:
You might want to find a native function which disables the player controls for example.

EDIT: You can call native Functions via tthe Function.Call command

EDIT2: for the native function look for SET_PLAYER_CONTROL or DISABLE/ENABLE_CONTROL_ACTION

Native Functions:

http://www.dev-c.com/nativedb/

Ok thanks this will help me a lot

How do I make it into a resource for five m?

You read that link I gave you? It’s completely described there. Where are you stuck?

I done that and there are a lot of files ill show you image

your .net.dll is missing

From the Github Repo:

Preparation

  • Create a resource
  • We will create a resource named example.
  • Make a resource folder inside C:\FiveReborn\server\resources with a nameexample.
  • Then create a __resource.lua file in it with content:
  • client_script “example.net.dll”

additionally: you shouldnt have the Project files in the resources folder. It wont do any harm but it will clutter up with stuff