My code is on thousands of lines and tons of cmds. Can playercmds and function divided into other .nut files or not
why not
Yes you can.
put it in your on script load
dofile( "NUT 1.nut" );
dofile( "NUT 2.nut" );
Quote from: Zone_Killer on Sep 17, 2017, 02:43 PMYes you can.
put it in your on script load
dofile( "NUT 1.nut" );
dofile( "NUT 2.nut" );
It says cannot open file
Use the full relative location to the server. Example: "scripts/your script.nut" .
Function On script load
dofile( "script/commands.nut" );
Quote from: Rampages Killers on Sep 17, 2017, 09:52 PMFunction On script load
dofile( "script/commands.nut" );
Quote from: NicusorN5 on Sep 17, 2017, 06:25 PMUse the full relative location to the server. Example: "scripts/your script.nut" .
still no
Guys he is newbie give him example snippet
Quote from: Cool on Sep 18, 2017, 03:11 PMGuys he is newbie give him example snippet
Make a file in server_directory/scripts/cmds.nut
Now cut all commands and paste in cmds.nut
Your cmds.nut file will be something like this
function onPlayerCommand( player, commands, text )
{
bla bla bla
nub nub nub
bla bla bla
nub nub nub
}
Now open main.nut and add this line
//add in function onServerStart()
dofile( "scripts/Cmds.nut" );
Video Tutorial
(https://alexlehmpost.files.wordpress.com/2012/09/2d0b8-twirler.gif)
Quote from: zeus on Sep 18, 2017, 03:51 PMQuote from: Cool on Sep 18, 2017, 03:11 PMGuys he is newbie give him example snippet
Make a file in server_directory/scripts/cmds.nut
Now cut all commands and paste in cmds.nut
Your cmds.nut file will be something like this
function onPlayerCommand( player, commands, text )
{
bla bla bla
nub nub nub
bla bla bla
nub nub nub
}
Now open main.nut and add this line
//add in function onServerStart()
dofile( "scripts/Cmds.nut" );
Video Tutorial
(https://alexlehmpost.files.wordpress.com/2012/09/2d0b8-twirler.gif)
Ahh!!
I was using it on scriptload. My mistake. xD
Problem Solved.