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
 - Inoffical version
 - tools
 

Support us


Support us

Community

 - forum
 - support
 - suggestions
 - mailinglists
 - irc channel
 

Choice


Get Firefox!
   

Helper Functions


1. IP address helper function library
2. Yet another way to locate one string within another. (updated)
3. Start a Clan War on your server. (updated)
4. AdminMod Script for Invisibility Cheat Detection
5. A load of snippets nicely packaged.
6. A force team change for TFC.
7. Finds first occurence of str2 in str1.
8. Force players to change to your team of choice
9. Extract the user from a command string
10. Locate a character within a string
11. Extract segments of a string

IP address helper function libraryView

This include file contains a function to convert IP addresses supplied by adminmod into 32-Bit integers so they can be manipulated using bit-wise arithmatic e.g. for subnet masking.

It also converts the numeric IP address back into dotted string representation.

-[ Ravenous Bugblatter Beast ]-


Yet another way to locate one string within another. (updated)View

Here is a snippet that is based on the helper functions in Jag's script. It will find one string within another.

-[ KaReL ]-


Start a Clan War on your server. (updated)View

This command is usefull when beginning a clan war on your server. It kicks anyone not having the specified clan tags or not having immunity and puts a password on the server.

usage: admin_war (clantag1) (clantag2) (password)

-[ KaReL ]-


AdminMod Script for Invisibility Cheat DetectionView

AdminMod provides the server admin with the possibility to protect certain models with a password. The Invisibility Cheat uses the models orange, oranget, arcticorange or arcticoranget. The use of the first two can be blocked by setting a password for them. If you set a password for the latter two, people will be unable to use the terror model arctic and get kicked from your server. This script detects the use of any of the above four models and displays a warning on the screen to all players that a player is trying to make himself invisible.

The view link contains a modified standard admin.sma with the cheat detection. If you want the whole package, try this link . The zip contains both Alfreds and Jags modified scripts.

-[ Da Rope ]-


A load of snippets nicely packaged.View

Here is a nice way to take care of your helper functions. This includes the original funcs from Alfreds script and a few others thrown in like:


  1. number_array - take a number and split it into an array of digits.
  2. execute_all - execute a command on all clients.
  3. speaktimeleft - say with an audible voice how much time is left on the map to all clients.
  4. usersearch - find the user name that most closely matches a string.


-[ [WHO]Them ]-



A force team change for TFC.View

Here is team change script for TFC based on the admin_t and admin_ct by Gremlin. They are designed to work with Jags script.

There are four commands in this one:
admin_red(player)
admin_blue(player)
admin_yellow(player)
admin_green(player)

-[ r3ap3r ]-


Finds first occurence of str2 in str1.View

Here is a little helper function I wrote in order to have some sort of AI type interface to people talking to the server. It should follow the same i/o format as ansi-C's strstr function.

In the client_command function, I added these two lines (for example) to detect if someone was asking about friendly fire:

code:

// If we think user is asking about friendly fire, we should answer
if ( (strstr(data, "ff on") != 0) || (strstr(data, "ff is on") != 0) )
if (getvar("mp_friendlyfire") == 1)
say("Friendly fire is ON");
else
say("Friendly fire is OFF");


-[ Sank ]-



Force players to change to your team of choiceView

Two nice little Counter-Strike commands from Gremlin. With admin_ct and admin_t you can balance the teams yourself.

-[ Gremlin ]-


Extract the user from a command stringView

I just don't like using numbers to address people so I use their quoted names. This function will extract the name as long as it is the first parameter in the admin_ command.

parseuser(RawStr[],UserStr[],Msg[])

The parameters are as follows:
RawStr[] - is the raw data from the admin_ command.
UserStr[] - is the string to hold the parsed username.
MsgStr[] - is the string to hold remainder of the raw data from the admin_ command.
The result of the function is the result of check_user based on the parsed name or zero if no user.

This function does require the strnsplit snippet to work.

If you want to see this command in action, check out my second tutorial that will give you a private message system for admins.

-[ Dio ]-


Locate a character within a stringView

This function will find the occurance of a character within a string.

pos(cWhat[],cWhere[],nStart=0)

The parameters are simple:

cWhat[] is the the character to find. You can pass an entire string but only the first character of the string will be searched for.

cWhere[] is the string to be searched. Enough said.

nStart=0 is the character position in cWhere to start searching. This parameter is optional due to the Small Compiler's ability to have default values in parameters.

-[ Dio ]-


Extract segments of a stringView

If you need to parse strings, this is a helper function you might like.

strnsplit(a[],b[],n,m)

The strnsplit function will copy characters from b to a starting at the nth character and stoping at character m.
Enjoy

-[ Dio ]-



 

AScript

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

Affiliates

 - AScript
 - MetaMod
 - Adminmod.de
 

Sponsors


SourceForge.net Logo
 
 

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

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