Sitemap

 - news
 - newsarchive
 - overview
 - faq
 - installation
 - help
 - commands
 - scripting
 - plugins
 - fun
 - the team
 - credits
 
 - AM online store
 - SourceForge
 

Download

 - Linux v.2.50.60
 - Win v.2.50.60
 - older versions
 - tools
 

Support us


Support us

Community

 - forum
 - support
 - suggestions
 - mailinglists
 - irc channel
 

Choice


Get Firefox!
   

Scripting FAQ


1. What does SC tell me invalid line continuation?
2. How do I edit this sma file? It looks very strange.
3. How do I allow my script to read/write files?
4. Why does sc just flash on the screen?
5. Can I change the This server is using admin mod Message?
6. How do I compile a script?
7. How do I get the scripts working?
8. What is this scripting stuff anyway?

1. What does SC tell me invalid line continuation?top

This message is so misunderstood. Most AM users will tell you to convert all of the // comments in the plugin to /* */ pairs.

Yes this fixes the problem, but in my opinion, the wrong way. The plugin files on this site are currently in WIN32 format. Now if you just read the above FAQ Q/A then you already know what I am going to tell you.

WIN32 and Linux (unix really) use different formats to store text files. For the AdminMod this usually is not a problem since it has been designed to handle both formats of text files.

The problem is in the SC compiler. No it's not a bug. It is a native application doing what it should do. When SC reads a file in Linux, it expects a Linux file. Period. If you give the Linux SC a WIN32 file, it will probably work just fine, unless the sma file contains the characters //.

The best solution is to convert the file to the OS's native format. I suggest you get The Wraith, converters.


2. How do I edit this sma file? It looks very strange.top

Depending on your OS, you may have a problems editing or compiling your sma files.

WIN32 users may see files that do not have the correct carrage return and line feed combinations. This is because the sma file is in linux format.

Linux users may see files that do not compile with an error message of invalid line continuation. This is because the sma file is in WIN32 format.

Since both operating systems are fully supported by AdminMod, sma files may be in either format.

There are two possible solutions to the problem.

One is to use an editor that supports the reading and conversion of both formats. For Windows I like UltraEdit-32 because it supports the conversion between Linux and Win32 files. Another suggestion that has been made is the Programmers File Editor. Since I don't do Linux, I can't recommend any editors, sorry.

The second solution is to convert the files into the correct format for the OS. You can use d2u (dos2unix) or grab The Wraith, converters that will do the job nicely.


3. How do I allow my script to read/write files?top

You need to set file_access_read and file_access_write to 1 in your adminmod.cfg to enable file reads/writes.


4. Why does sc just flash on the screen?top

You cannot run sc.exe directly by double-clicking on its icon in windows. SC should be run from a command prompt (remember DOS?).


5. Can I change the This server is using admin mod Message?top

Our first tutorial is on just that!

Check out the Tutorials section.


6. How do I compile a script?top

See manual


7. How do I get the scripts working?top

If you installed the Admin Mod, the default scripts are already compiled and installed for you. There is no need to touch them, unless you want to.


8. What is this scripting stuff anyway?top

The scripting engine was added to the Admin Mod in version 2. With this engine, server operators can add to the growing list of commands that are avaiable to Admins and players without having to dive into C++.

The scripting language is similar to C, but you don't need to know C to get things done.



 

AScript

 - news
 - news archive
 - plugins
 - submitting
 - faq
 - functions
 - helpers
 - tutorials
 
 - Small Site
 

Affiliates

 - AScript
 - MetaMod
 - Adminmod.de
 

Sponsors


OzForces.com


www.boomtown.net


SourceForge.net Logo

Freedom


 
 

Get Halflife Admin Mod at SourceForge.net. Fast, secure and Free Open Source software downloads.    CS Server     ||    

  [ Half-Life Admin Mod Alfred Reynolds 2000-2017 ] - [ site design and programming by Jägermeister ]