PDA

View Full Version : JailMod++


MistaGee
02-07-2008, 17:48
This is a Source port of my AMXX plugin JailMod++. It allows to put people in a jail on the map by stripping all weapons from them and teleporting them to a set of previously stored coordinates.

For each map, there can be up to five jails. The jail coordinates are configured using an admin menu, allowing to add or edit jails quite easily.


Commands:
jail <player>
Puts a player in jail.
unjail <player>
Sets a player free.
jail_reload
Reloads the jail database (neccessary if you changed jails via the admin menu.)CVars:
jail_strip <0|1>
If 0, Weapons are not stripped from players when they are put in jail (that way, you can re-use jails in surf maps, for example)
jail_fill <0|1>
Changes the way jails are chosen, when a player is to be jailed.
If 0, a random jail is picked.
If 1, the first jail which has room left will be used.
jail_tkpunish <0|1>
If 1, team killers will be jailed automatically.Requirements:
This plugin uses a database to store the jail coordinates in, so you need to have a named database config "jailmod" or "default" for this to work. The table will be created automatically.

Attached, you will find a MySQL and SQLite database containing sample Jail coordinates for CS:Source.


I'm currently testing on various mods. It was developed with CS:Source, but there isn't any mod-specific code in there as far as I can tell, so it should work on any mod.

Changes:
1.1: Bugfix - forgot to call GetClientOfUserId in events, that's why console got spammed with "Array index out of bounds" and TK punish didn't work...



Have fun,
Gee

Rebell
02-10-2008, 03:54
Sounds nice - perhap you can add a cvar for mapper that uses teleport_detinations.
I will try out - cya

Mosalar
02-15-2008, 11:49
Since no one has done a "llamacage" for sm, I thought this would make a good alternative for out DoDS server. "Get plugin" returns a failed to compile. And trying to compile it here locally returns //SourceMod Batch Compiler
// by the SourceMod Dev Team


//// jailmod.sp
// C:\Documents and Settings\Mosalar\Desktop\scripting\jailmod.sp (36) : error 01
7: undefined symbol "INVALdod"
//
// 1 Error.
//
// Compilation Time: 0.58 sec
// ----------------------------------------

Press enter to exit ...

Any help?

MistaGee
02-15-2008, 12:32
I'm not exactly sure how that happened, but I've fixed the problem. The plugin now compiles.

symphyle
03-09-2008, 14:17
Hi MistaGee (http://forums.alliedmods.net/member.php?u=2131)

May you explain how to install JailMod++ ? Thank you so much ^^

What is jailmod.sq3 (http://forums.alliedmods.net/attachment.php?attachmentid=23460&d=1202424489) ?! .sq3 ?! how install that ?

Symph

noodleboy347
09-27-2009, 19:01
I know this is a bit old... but does it still work? And does it work with TF2? Can people kill themselves to get out of the jail?

toughdog6789
01-20-2010, 20:33
I know this is a bit old... but does it still work? And does it work with TF2? Can people kill themselves to get out of the jail?

lol its noodleboy

deriggs007
04-16-2010, 01:13
Better instructions on how to set this up would be nice.

Otherwise it's not worth a download

Eternal Rebel
05-25-2010, 17:59
Where do u put the sq3 and the my.sql files? When I try to use the /jail command it tells me the database is not connected.

MistaGee
05-26-2010, 04:24
You have to configure a database in configs/databases.cfg for JailMod to store its jail data in. If you want to use MySQL, you can import a bit of initial data from jailmod_my.sql, and jailmod.sq3 is an SQLite database that contains the same initial data which is ready to use.

If you want to use the sq3 file, put it under addons/sourcemod/data/sqlite and create a database config as such:


"jailmod"
{
"driver" "sqlite"
"database" "jailmod"
}
If JailMod does not find a config section named "jailmod", it will try "default" next, so you can just import the jailmod tables in you SourceMod database (if you have any).

Eternal Rebel
05-26-2010, 20:38
I did everything you said to do but it still says database not connected in game. Any ideas?

ocbigriver
05-27-2010, 14:43
I got this working on my dods server last night after reading the posts very closely. The simplest way to do this is with sqlite, so that is what I did. I edited configs/database.cfg

"jailmod"
{
"driver" "sqlite"
"database" "jailmod"
}
Then I uploaded jailmod_my.sql to /configs/sql-init-scripts/sqlite. Then I recompiled jailmod.sp and uploaded. You don't have to recompile. I recompile only to make sure the plugin is compiled on the same version of sourcemod that I am running which is 1.3.2. Done and everything is working great.

Eternal Rebel
05-27-2010, 19:35
Thanks so much for the input. I will test it out tonight hopefully.

Eternal Rebel
05-27-2010, 23:29
Is there anyway that u could add like a setspawn to this script so that when people in jail die they respawn there until unjailed? Also it strips weapons in tf2 but leaves the melee weapon.

ocbigriver
06-03-2010, 18:26
Is there anyway that u could add like a setspawn to this script so that when people in jail die they respawn there until unjailed? Also it strips weapons in tf2 but leaves the melee weapon.
I agree its too easy for the players to type 'kill' in the console when they are jailed so they could respawn like normal. Or players in the same jail can kill each other with the melee weapons. If those 2 features could be added this plugin would be complete imo.

Snaggle
03-09-2011, 17:45
Can you update this to fix the players killing themselves problem please?

WhosAsking
05-19-2011, 12:41
I notice a cosmetic bug with the jail and unjail commands. I think it boils down to a syntax fault involving ShowActivity2. Basically, you forgot the Tag parameter.

Original text:
ShowActivity2( client, "[JAIL] Put %s in jail.", target_name );What it should be:
ShowActivity2( client, "[JAIL] ", "Put %s in jail.", target_name );The exact same problem is in unjail.

Original text:
ShowActivity2( client, "[JAIL] Freed %s from jail.", target_name );What it should be:
ShowActivity2( client, "[JAIL] ","Freed %s from jail.", target_name );

databomb
09-10-2011, 12:59
Can you update this to fix the players killing themselves problem please?

This was my attempt at editing this to fix this problem:

http://forums.alliedmods.net/showthread.php?t=152408

Werewolf_UK
05-30-2012, 20:40
We use this on our servers, and the only way to escape jail is to disconnect from the server. In fact we have some players who simply use retry and escape without effort.
Therefore would it be possible to add a ban function, whereby if a player leaves the server before they have been properly unjailed a ban is automatically issued? As a side function, I'd ask that there be a cvar that admins can use to adjust the automatic ban length to what they want.

zyncool99
06-14-2013, 16:55
can any one help me pls!!!!
it said
[JAIL] : Sorry, no jail are availeible

Werewolf_UK
02-18-2015, 12:48
OK this might be a very dead plugin now, but is there any chance for an update to this plugin? It's not worked for a while now but our servers enjoy the use of this plugin.

kgbproject
09-23-2015, 04:19
Sourcemod plz

kgbproject
09-23-2015, 04:20
How u make for tf2 ?