I am making my own server in vcmp. I know javascript so I understand squirrel a little. Due to lack of squirrel knowledge, I am unable to perform some tasks. Plz, help me.
My questions are:
how to install client side script?(I don't know so I am unable to add registration system)
Whenever I use dofile option, the file doesn't attach and give an error that script load not executed. How to correctly use the option and where to the file to be attached?
You need to place your client-side scripts in store/script and name your entry script (the script that is loaded first) main.nut.
Quote from: EK.IceFlake on Aug 09, 2017, 06:00 PMYou need to place your client-side scripts in store/script and name your entry script (the script that is loaded first) main.nut.
Thank you. My first question is answered. Now plz tell me that where to put the file which is going to be loaded by dofile. I have many server and client sided scripts to be installed. Should I merge all files into main.nut in store/script or these can be link? if can then how?
Quote from: umar4911 on Aug 10, 2017, 02:07 PMQuote from: EK.IceFlake on Aug 09, 2017, 06:00 PMYou need to place your client-side scripts in store/script and name your entry script (the script that is loaded first) main.nut.
Thank you. My first question is answered. Now plz tell me that where to put the file which is going to be loaded by dofile. I have many server and client sided scripts to be installed. Should I merge all files into main.nut in store/script or these can be link? if can then how?
Place all those files in store\script.
For ex: This are files in store\script:-
main.nut
hello.nut
smd.nut
In your main.nut, you can simply use dofile("hello.nut") or dofile("smd.nut"); to load the respective files.
Quote from: KAKAN on Aug 10, 2017, 04:00 PMQuote from: umar4911 on Aug 10, 2017, 02:07 PMQuote from: EK.IceFlake on Aug 09, 2017, 06:00 PMYou need to place your client-side scripts in store/script and name your entry script (the script that is loaded first) main.nut.
Thank you. My first question is answered. Now plz tell me that where to put the file which is going to be loaded by dofile. I have many server and client sided scripts to be installed. Should I merge all files into main.nut in store/script or these can be link? if can then how?
Place all those files in store\script.
For ex: This are files in store\script:-
main.nut
hello.nut
smd.nut
In your main.nut, you can simply use dofile("hello.nut") or dofile("smd.nut"); to load the respective files.
In which main.nut we have to dofile. The client sided or server sided. I have another question. How to add delay such as in most of the servers, there is delay in heal cmd that he have to wait 5 second to heal
This applies to where you want to load the file, also for the delay, use the NewTimer function @server side
For server scripts, use server's main.nut.
For client, use client's main.nut.
Both are different.
Also, for timers and everything else, check the Unmaintained wiki (http://wiki.vc-mp.org/wiki/Main_Page)
Thank you. Problem solved