Using Typescript

From RAGE Multiplayer Wiki
Revision as of 20:16, 12 July 2018 by Stuyk (talk | contribs) (Created page with "Typescript is a really great resource for C# users looking for a similar language for writing client-side resources. Luckily for us there are a few users out there who have cr...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Typescript is a really great resource for C# users looking for a similar language for writing client-side resources. Luckily for us there are a few users out there who have created Typescript definitions for the client-side code.

You may obtain them from:

https://github.com/CocaColaBear




Prerequisites

  • NodeJS Installed
  • General Server Setup Done




Setup

Open Visual Studio Code

Pressing ctrl + ` will open a terminal.

You can install typescript by running the following command:

npm install -g typescript

To verify that you have installed typescript correctly type:

tsc --version




Adding Typescript Definitions


Clientside

npm install -g --save-dev github:CocaColaBear/types-ragemp-c#master

or

npm install -g --save-dev https://github.com/CocaColaBear/types-ragemp-c/tarball/master

Serverside

npm install -g --save-dev github:CocaColaBear/types-ragemp-s#master

If neither of these happen to be working properly you can try removing -g. That's just a global install function.


You can verify if it's working properly by creating a new Typescript file. .ts

Then begin programming by typing:

mp.game

If working properly you will have auto-fill available.