client side script, dofile

Started by umar4911, Aug 09, 2017, 03:06 PM

Previous topic - Next topic

umar4911

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?

RT Member | Asian City Scripter | CTB Contributor | VKs Contributor | European City Contributor | EAD Scripter

EK.IceFlake

You need to place your client-side scripts in store/script and name your entry script (the script that is loaded first) main.nut.

umar4911

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?
RT Member | Asian City Scripter | CTB Contributor | VKs Contributor | European City Contributor | EAD Scripter

KAKAN

Quote from: umar4911 on Aug 10, 2017, 02:07 PM
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?
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.
oh no

umar4911

Quote from: KAKAN on Aug 10, 2017, 04:00 PM
Quote from: umar4911 on Aug 10, 2017, 02:07 PM
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?
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
RT Member | Asian City Scripter | CTB Contributor | VKs Contributor | European City Contributor | EAD Scripter

Xmair

This applies to where you want to load the file, also for the delay, use the NewTimer function @server side

Credits to Boystang!

VU Full Member | VCDC 6 Coordinator & Scripter | EG A/D Contributor | Developer of VCCNR | Developer of KTB | Ex-Scripter of EAD

KAKAN

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
oh no

umar4911

RT Member | Asian City Scripter | CTB Contributor | VKs Contributor | European City Contributor | EAD Scripter