[HELP] Rewriting/Porting .NET Script

port
help
server
lua
scripting

#1

I am currently researching sever-side scripting as I hope to port this script: https://www.gta5-mods.com/scripts/portal-gun-net to FiveM.

I was wondering if anyone with a ‘professional opinion’ could explain which language I should use and how I would go about doing this.


#2

your mod using scripthook and not CitizenFX.

and this script is made with .net , so if you really want to port it to Fivem you will have to change the code to adapt it to CitizenFX and for doing that you need the source code. Good luck


#3

The source code is available on GitHub for the script, I was just wondering if anyone could point out any tutorials that may help. Thanks


#4

i don’t think it will be any tutorial on how to convert script, because it’s hard to explain , it’s just question of replacing function and object by the one in fivem.


#5

Do you know where I could find the functions used by FiveM?


#6

yes of course , first you have the native who is universal for any gta framework , you just have to replace the native calling who can be different depending the framework. for the native : http://runtime.fivem.net/doc/reference.html

but it depend what language are you using , if it’s c# you have everything listed in the dll directly.
if you code with lua , you have most of function in your appdata/local/fivem/scripting/lua/

it’s not that hard , it’s just a question of analyse and logic , if the script you want to convert use Vehicle object who is in the ScriptHook.ddl , then you will have to change the code for using the one from CitizenFx.dll , but the object will certainly have different param name ect so you have to change and adapt all the calling. i don’t know if what i’m saying it’s enough clear.


#7

and sometime some function made for one framework will maybe not exist like this in another framework , so you will have to code a function who doing the same thing under fivem.