Author Topic: How to simply put a script in  (Read 2079 times)

0 Members and 1 Guest are viewing this topic.

Offline Underworld

  • Camper
  • ***
  • Posts: 338
  • Mapper
How to simply put a script in
« on: March 08, 2007, 05:59:55 pm »
yah sorry but i think some people sell allot of bullshit around scripting various cool thinks can be done whit it but almost nobody knows how to add them cous there aint no explaining how to. yes ive read the sticky's and i dont call that a turtorial at all 3 websites links 1 that doesnt work and 1 that clearly got nothing to do whit soldat at all.

all i want to know how to add a script is it that hard to ask for?

what i think i need to do,i copy the script someone made in a text file then i give it a name like "Killspree" and put .pas after it so it becomes "Killspree.pas" then i save it and compile my server but nothing happens.script doesnt work and doesmnt show up in compile screen now can somebody tell me how to add a script whitout combining.
I don't understand
do you mean that there is a /faceplam commmand ?
and this command should drop a random item ?

Offline Avarax

  • Veteran
  • *****
  • Posts: 1529
    • Official Hexer & MMod site
Re: How to simply put a script in
« Reply #1 on: March 09, 2007, 04:04:07 am »
all you have to do is to copy the scripts .pas files into your "Scripts" folder of your soldatserver (version 2.5.3 or higher required) and then modify your includes.txt

for example if a script contains "Mofo.pas" and "Sextoys.pas", then you have to copy those into the script folder, open the includes.txt and replace the entrys "Core.pas", NetworkCore.pas" and "Admincore.pas" with "Mofo.pas" and "Sextoys.pas"
I like to have one Martini
Two at the very most
Three I'm under the table
Four I'm under the host

Offline Underworld

  • Camper
  • ***
  • Posts: 338
  • Mapper
Re: How to simply put a script in
« Reply #2 on: March 09, 2007, 06:37:33 pm »
well thats what i do but i always get a runtime error
I don't understand
do you mean that there is a /faceplam commmand ?
and this command should drop a random item ?

Offline mikembm

  • Soldier
  • **
  • Posts: 210
Re: How to simply put a script in
« Reply #3 on: March 10, 2007, 12:22:02 pm »
Something I wrote up for another forum... hope this helps somebody...



Scripts are found in your Scripts folder in you server.
You must have ftp access to the server or the server must be on your own computer.
(Or some servers may have an online control panel where you can edit the scripts)

When you first view the scripts you will have 4 files:
* Includes.txt
* NetworkCore.pas
* Core.pas
* AdminCore.pas

I recommend that you combine the NetworkCore.pas and the Core.pas files into one by copying the contents of Core.pas into the top of NetworkCore.pas. And then removing Core.pas line from your Includes.txt file. (Most of my scripts will require this to be done)

To add a script, just find the procedures in the script and replace/add to your existing code in your own files. And then save/upload your new script files.

One you have changed the code you can either restart the server or in game you can type /recompile if you have admin.

Things to keep in mind:
* You cannot have 2 of the same procedure
* You can add new script files but you must add it to Includes.txt
* If you have a bad script, /recompile will crash the server
* Global variables cannot be used in a different script file.


More script help can be found at: http://enesce.com/help/

Offline chase is my name

  • Major(1)
  • Posts: 19
Re: How to simply put a script in
« Reply #4 on: March 14, 2007, 02:22:02 am »
if you are still getting errors even after mikembm's answer, please post in here what the error the computer is telling you. most likely it's something to do with asking the server to make the same procedure twice (such as OnCommand).

I personally cut and pasted all my .pas files into the networkcore.pas file. Saved me a lot of running back and forth.

If you are going to do this though, make sure that when you cut and paste the "var" and "const" section, that you put it in the top of the file and not INSIDE of a function or a procedure event.