AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Approved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=8)
-   -   JailMod++ (https://forums.alliedmods.net/showthread.php?t=16596)

MistaGee 08-16-2005 08:04

JailMod++
 
3 Attachment(s)
I've grabbed the Idea of MyStIcSsJgOkU4 @ http://forums.alliedmods.net/showthread.php?t=16031 and wrote my own version of this script (from scratch) which has a bit more functionality than the original one.

There's the following CVars:
Code:

amx_jail_time
This is the default time ppl are sent to jail if none is given.
amx_jail_allow
Guess what..? :P this cvar is set automatically to 1|0 according to whether a jail was found for this map or not but can be changed of course.
amx_jail_returnweapons
Sets if ppl who are released from jail are returned their weapons.
amx_jail_godmode
this defines if the inmates are provided with godmode to not be able to get killed by other inmates / ppl who can shoot from the outside into the jail (like, on cs_militia).

Then there's a couple of commands:
Code:

amx_jail <name> [<-1|0|time>] [<jail #>]
Puts ppl into jail. If time is not specified or -1, the default value from the cvar is used. if time equals 0, the victim will be put into jail until round end.

amx_unjail <name> - use to get ppl out of jail
amx_readjail - use to read the coordinates file once again
amx_viewjail [jail #] - use to see who is in that jail / in all jails
amx_listjail - use to get a list of all jail coordinates
amx_jailmenu - use to get a menu with further options allowing you to config the whole script and save the config.
In the menu, you can delete jail coordinates, add new ones, and toggle noclip mode to reach the positions you want as jail &quot;spawnpoints&quot;.

In the Menu, you will be shown all the coordinates that have yet been set. Pressing the corresponding key deletes a set of coordinates, pressing key 6 will add the ones you are currently located at. Pressing 7 toggles noclip. Key 8 is for reading the config once again (which makes all your changes null and void), 9 writes the current data to the config file (saving your settings 4ever) and key 0 closes the menu, disabling noclip if enabled.

The default admin level is ADMIN_SLAY but can be changed by changing a #define in the sma. This one adminlevel is used for ALL commands.

This script is only tested on CS but should work on other mods as well.

Requirements:
- Amxx (how come :P)
- fun module for godmode & noclip

THX to:
MyStIcSsJgOkU4 for the basic idea
f117bomb & T(+)rget for amx_atac 5.2.3 from where I leadned how to strip weapons

Parts of the Idea, Coding & Testing by MistaGee

Enjoy!
Greetz MGee

Blitz 08-16-2005 13:14

Nice, this one is well written. :)
Good job.

Oulalabobo 08-16-2005 15:16

Don't seem works for dod or i forgot something :/

Quote:

AMXX] Failed to open dictionary file: dod/addons/amxmodx/data/lang/jailmod.txt
[AMXX] Invalid event (name "SendAudio") (plugin "jailmod.amxx")
[AMXX] Run time error 10 (native)
[AMXX] Debug is not enabled (plugin "dod/addons/amxmodx/plugins/jailmod.amxx")

MistaGee 08-17-2005 07:22

Quote:

Originally Posted by Oulalabobo
AMXX] Failed to open dictionary file: dod/addons/amxmodx/data/lang/jailmod.txt

This means the needed dictionary file was not found. Did you DL it and put it into the right directory?

Quote:

Originally Posted by Oulalabobo
[AMXX] Invalid event (name "SendAudio") (plugin "jailmod.amxx")

This is a problem...
I used this event to determine round end, as cstrike seends the sounds "(Counter) Terrorists win". How is that round end notified in dod? If anyone knows that, change the sma to recognize round end correctly and everything should work then, I'd do it if I knew how :P


Greetz MGee

mysticssjgoku4 08-17-2005 08:53

Damn dude nice job, I wish I could say i did this lol :D
Do you think you could also tell me how I would add the functionality for checking what map it is, and then reading from the file for the correct coordinates like yours does. It would be great if I could add this into mine for my server :-D

MistaGee 08-17-2005 10:54

Quote:

Originally Posted by mysticssjgoku4
Damn dude nice job, I wish I could say i did this

thx man :)

Quote:

Originally Posted by mysticssjgoku4
Do you think you could also tell me how I would add the functionality for checking what map it is, and then reading from the file for the correct coordinates like yours does. It would be great if I could add this into mine for my server

well, you could simply use mine... 8)

if you have a closer look at the functions readjail() and writejail(), you'll see how I did that... just read the config file line by line, search for a map name and if you found the right one, parse the coordinates which are located in the following lines.

you basically have to keep all the functions dynamic so the jail the users are sent to can vary, that's it. you hardcoded the origins in your script and used different functions for the jails, that is what I avoided.


Greetz MGee

EKS 08-29-2005 03:01

How is this plugin diffrent from all the other jailmod plugins?

MistaGee 09-02-2005 10:39

Quote:

Originally Posted by EKS
How is this plugin diffrent from all the other jailmod plugins?

sry but I don't know since I yet didn't know there are any :p

I think the one plus of mine is the config file for the origins...


Greetz MGee

darkcloud9sgl 09-04-2005 10:43

well written :) and fun to do to people sometimes

The Free Man00 01-07-2007 14:54

Re: JailMod++
 
Three things, One in TS when you hit any button on the menu it will just exit out Two also in ts it doesnt detect any jails and I forgot three ...


All times are GMT -4. The time now is 10:32.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.