GangstaSunny Posted July 15, 2018 Posted July 15, 2018 (edited) Hello, since I'm from sa-mp i obviously only know the server-side scripting. I already did some stuff like MySQL-connection, different disconnecting messages (depending on exitType) and so on. To get all the abilities from RageMP I (of course) also want to use the client-side scripting. First, I just want to get myself in and do stuff like mp.gui.chat.colors = true; mp.game.player.setHealthRechargeMultiplier(0.0); Both things are client-side functions. So, how to start with client-side scripting, which file(s) do I need to create and where to put them? Thanks a lot. //edit Oh wow! It's simple as that. Just need to create .js files inside the server-files/client-packages/ directory. That's it. Edited July 15, 2018 by GangstaSunny
MrPancakers Posted July 15, 2018 Posted July 15, 2018 Yep glad you worked in out, check out the wiki, there is also a guide on getting started https://wiki.rage.mp
Captien Posted July 15, 2018 Posted July 15, 2018 Here's a simple tutorial for you to be organized in Client-side scripting: 1) Create a index.js in client_packages folder 2) Create a folder in client_packages called lets say gamemode. 3) Add the index.js require('gamemode/index'); 4) After that enter the folder you created and add another index.js 5) Inside the gamemode folder you can add as much as files you want with client side scripting stuff as Mr.Pancake said.Client-side Scripting 6) Don't forget to link every file you create to the index.js inside gamemode folder it'll simply be like that require('./gamemode/file.js') That's all you need to know about Client side scripting for now... 1
GangstaSunny Posted July 16, 2018 Author Posted July 16, 2018 (edited) Since i do require those files this is only to get a clear view about my stuff, am i right? Which basicly mean i could also add everything just inside my index.js. Am i right again? Also i would like to know whetever ragemp is specially looking for an index.js or am I able to use any file name even if there may as mentioned above is only one file. // smartphone - bad english possible Edited July 16, 2018 by GangstaSunny
Captien Posted July 16, 2018 Posted July 16, 2018 Yes, RAGE does look for the specific file index.js. that's the first file where your client side initalize from
GangstaSunny Posted July 16, 2018 Author Posted July 16, 2018 (edited) vor 5 Stunden schrieb Captien: Yes, RAGE does look for the specific file index.js. that's the first file where your client side initalize from I guess this counts for server-side too then? // smartphone - bad english possible Edited July 16, 2018 by GangstaSunny
Captien Posted July 17, 2018 Posted July 17, 2018 yeah same way, but other than doing ./gamemode_folder/file you'll do ./file
GangstaSunny Posted July 17, 2018 Author Posted July 17, 2018 Thanks, guys. All my questions have been answered
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now