JailBreak needs no introduction, hundreds of servers are running some sort of a JailBreak plugin and it's quite a fun mod. I am not going to waste my time explaining what the mod does and its purpose, however I am going to give you a small history about my plugin.
I started out by using nikhilgupta345's JailBreak plugin and found it was great. However, he went inactive and there were a few bugs I wanted to fix myself. I started fixing and adding several features to it. It got to a point where his code consisted of around 10% of the plugin. I added so many features from so many other plugins that I honestly lost count.
I never figured I would be posting this publicly for several reasons. First is that there are plenty of stuff that are hardcoded in the source code, and yes I now know this is a bad thing. Second is that I was writing this plugin for someone, however that someone lost interest in CS and moved to other games.
So here I am posting this plugin for everyone. Yes there are hardcoded things out there, and yes I will push updates to make this plugin user friendly.
Days restriction (voting only) to prevent several days being played a lot.
Shop with several options.
Spoiler
Code:
new strOptionsShopMenu[ ][ ] = {
"HE Grenade [explosive]",
"FLASH Grenade [blinding shit]",
"SMOKE Grenade [foggy atmosphere]",
"Health Kit [here take 50 HP]",
"Advanced Health Kit [here take 100 HP]",
"Armor Jacket [here take 100 AP]",
"Prison Knife [prison made knife]",
"One Bullet Deagle [get that headshot]",
"One Bullet Scout [get that headshot]",
"Assassin Steps [sound reducing choose]"
};
Player time spent on server is saved.
Special points system to use in the shop.
Points reward system for the Prisoners.
Gun menu for the Guards and Days.
Commander Menu that allows the Commander to do several things.
Spoiler
Code:
new strOptions[ ][ ] = {
"Open Cells",
"Split Prisoners in two teams [nb. Prisoners pair]",
"Start a timer [10 seconds]",
"Open the game book [NOOB CT? not anymore]",
"Pick a random Prisoner [we'll pick for you]",
"Give a Prisoner an empty Deagle",
"Give/Remove a Prisoner's mic access [one round]",
"Heal all Prisoners [100 HP]",
"Glow a Prisoner [choose color]",
"Ask a random math question [we already have the answers]",
"Enable/Disable Free For All [let them kill each others]",
"Enable/Disable Dodgeball [hit to kill]",
"Enable/Disable Spray Meter [how high can you spray?]"
};
Ability for players to shoot buttons to use them (CVAR controlled)
Unlimited ammo on some days.
User specific freedays.
VIP system that gives VIPs unique skins and player models.
Gameplay book for the less creative Guards out there.
Minimum played time restriction for Guards (you have to play more than x minutes to be able to join the Guards team.
Banning players from the Guards team is doable.
Players are allowed to donate points to each others.
Mic usage system automatically controls the mics.
So many more features that cannot be listed due to time limitations.
NOTE: all chat commands are applicable through 'say' and 'say_team' except the ones that do not start with a '/'.
Code:
COMMAND COMMAND_DESCRIPTION
/health - Display the health HUD meter.
/credits - Display the credits of the plugin.
/freeday - Opens up the freeday menu to hand out personnel freedays.
/lr - Opens up the Last Request Menu for the last Prisoner.
/race - Start the race countdown timer (LR).
/showdown - Start the showdown countdown timer (LR).
/hotpotato - Start the hotpotato countdown timer (LR).
/commander - Take control of the current Cage Day.
/nadewar - Start the nadewar day when all Prisoners are gathered together.
/commandermenu - Opens the commander menu with several interesting options.
/guns - Opens the gun menu to choose Primary and Secondary weapons.
/rules - Display a webpage as motd generally containing the rules.
/help - Display a webpage as motd generally containing the rules.
/day - Open the admin menu to start a specific Day.
/jbmenu - Open the main menu where everything else is accessible.
/ffa - Enable/Disable Free For All on the server.
/shop - Opens the shop menu where special items can be purchased.
/points - Display how many points you have.
/fun - Open the gambling menu where you can gamble with your points.
/time - Display how much time you have spent on the server.
/vip - Open the VIP menu where special skins are present.
/voteday - Force start a day vote.
/book - Open the gameplay book for the commander, so he can choose a game.
/pot - Check how much points there is in the raffle pot.
+paint - Start drawing on the walls with paint.
set_paint <R> <G> <B> - Set the RGB color of the paint color.
Admin Commands:
Format:
Code:
COMMAND COMMAND_DESCRIPTION
COMMAND_EXAMPLES
Code:
/open - Open the cell doors.
amx_allowmic <name | authid | userid> <1 | 0> - Set a player's talk power.
amx_give_points <name | authid | userid> #points - Give a player points.
amx_remove_points <name | authid | userid> #points - Give a player points.
amx_reset_points <name | authid | userid> - Reset a player's points.
amx_get_points <name | authid | userid> - Get a player's points.
amx_banct <name | authid | userid> <0 | 1> - Ban a player from joiing CT.
amx_give_vip <name | authid | userid> - Add a player to the VIP list.
amx_remove_vip <name | authid | userid> - Remove a player from the VIP list.
amx_playedtime <name | authid | userid> - Get the ammount of time user has played.
amx_set_button - Set the button for the cell doors"
amx_donate <name | authid | userid> <#> - Donate points to other users.
amx_donate_points <name | authid | userid> <#> - Donate points to other users.
uj_vote "10"
// Default: 1
// 0: Disable | 1: Enable every round | #: Enable when # minutes left of the map
uj_vote_players "2"
// Default: 2
// 1: Terrorists can vote | 2: Counter Terrorists can vote | 3: All players can vote
uj_vote_opposite "7"
// Default: 7
// Every x rounds, the opposite team is allowed to vote. Will only work when uj_vote_players is 1 or 2
// Example: If only Terrorists can vote, then every x rounds Counter Terrorists are given chance to vote
uj_vote_min_guards "1"
// Default: 1
// Minimum number of guards to start the vote
uj_vote_min_prisoners "2"
// Default: 2
// Minimum number of prisoners to start the vote
uj_vote_primary "15"
// Default: 15
// Time of the main vote in seconds
uj_vote_secondary "7"
// Default: 7
// Time of the extra vote in seconds
// Extra votes means the regular or reverse votes (+ restricted and unrestricted votes)
uj_vote_display_name "1"
// Default: 1
// Display or hide what each person has voted for
uj_vote_freezetime "1"
// Default: 1
// Set the freezetime to the primary vote time
// That means when they need to vote for a day, they are frozen
uj_open_auto "1"
// Default: 1
// Automatically open the cells on some days when it starts
uj_open_command "1"
// Default: 1
// Allow or disallow admins from opening the cells using a command
uj_wallclimb "1"
// Default: 1
// Allow or disallow nightcrawlers to climb walls
uj_shootbuttons "1"
// Default: 1
// 0: No one can shoot buttons | 1: Terrorists can shoot buttons | 2: Counter Terrorists can shoot buttons | 3: Everyone can shoot buttons
uj_lr_mic "1"
// Default: 1
// Allow or disallow last alive prisoner to talk on the mic
uj_revive_players "1"
// Default: 1
// Whether or not to revive players before day starts
uj_lr_auto "1"
// Default: 1
// Whether or not to automatically open the lr menu when he is able to
uj_block_flashlight "1"
// Default: 1
// 0: Everyone can use flashlight | 1: Block for Terrorists | 2: Block for Counter Terrorists | 3: Block for everybody
NOTE: these are the defines that you can customize to your liking. After editing them, you will need to recompile the plugin for it to take effect (you need to edit these in the source file a.k.a. '.sma')
Code:
/*
Below is the section where normal people can safely edit
its values.
Please if you don't know how to code, refrain from editing
anything outside the safety zone.
Experienced coders are free to edit what they want, but I
will not reply to any private messages nor emails about hel-
ping you with it.
SAFETY ZONE STARTS HERE
*/// #define MAX_PLAYERS 32#define NOCLIP_SPEED Float:10.0#define TIME_HOTPOTATO Float:30.0#define KAMIKAZE_CT_COUNT 3#define PROXIMITY_DISTANCE Float:300.0#define NC_HEALTH1_CT 30#define NC_ARMOR1_CT 150#define NC_ARMOR1_T 100#define NC_HEALTH2_CT 45#define NC_ARMOR2_CT 150#define NC_ARMOR2_T 100#define ZOMBIE_HEALTH1_T 600#define ZOMBIE_ARMOR1_T 100#define ZOMBIE_ARMOR1_CT 100#define ZOMBIE_HEALTH2_CT 900#define ZOMBIE_ARMOR2_CT 100#define ZOMBIE_ARMOR2_T 100#define PRESIDENT_USP_BP 100#define PRESIDENT_HEALTH 125#define PRESIDENT_ARMOR 300#define PRESIDENT_GUARD_HEALTH 75#define PRESIDENT_GUARD_ARMOR 150#define USP_NINJA_HEALTH_CT 25#define USP_NINJA_BP_CT 112#define USP_NINJA_BP_T 24#define USP_NINJA_GRAVITY 600#define HULK_AMMO_P90_CT 100#define HULK_AMMO_FIVESEVEN_CT 100#define HULK_ARMOR_CT 100#define HULK_HEALTH_T 100#define HULK_ARMOR_T 100#define HULK_SMASH_INTERVAL Float:20.0#define SPACE_ARMOR_CT 100#define SPACE_ARMOR_T 100#define SPACE_GRAVITY 250#define SPACE_HEALTH_T 100#define SPACE_HEALTH_CT 200#define SHARK_HEALTH_CT 300#define SHARK_HEALTH1_CT 300#define COWBOY_HEALTH_CT 175#define KNIFE_HEALTH_CT 65#define KNIFE_HEALTH_T 35#define LMS_HEALTH_T 250#define LMS_ARMOR_T 100#define LMS_WEAPON_INTERVAL Float:45.0#define MARIO_GRAVITY 250#define HNS_DANGER_METER Float:0.5#define NADEWAR_GIVENADES Float:150.0#define KAMIKAZE_HEALTH_T 200#define KAMIKAZE_ARMOR_T 200#define KAMIKAZE_HEALTH_CT 100#define KAMIKAZE_ARMOR_CT 100#define DEAGLE_MANIAC_ARMOR_CT 100#define DEAGLE_MANIAC_ARMOR_T 100#define DEAGLE_MANIAC_CT_COUNT 3#define DEAGLE_MANIAC_HEALTH_CT 100#define DEAGLE_MANIAC_HEALTH_T 1#define DEAGLE_MANIAC_INV_T 10#define UBER_GLOCKER_HEALTH_T 500#define UBER_GLOCKER_ARMOR_T 200#define UBER_GLOCKER_HEALTH_CT 100#define UBER_GLOCKER_ARMOR_CT 100#define UBER_GLOCKER_CT_COUNT 3#define VOTE_PRIM_MIN 10#define VOTE_PRIM_MAX 30#define VOTE_SEC_MIN 5#define VOTE_SEC_MAX 15#define TIME_COUNTDOWN_NC 16#define TIME_COUNTDOWN_SHARK 16#define TIME_COUNTDOWN_MARIO 31#define TIME_COUNTDOWN_SAMURAI 61#define TIME_COUNTDOWN_HNS 61#define TIME_COUNTDOWN_RACE 11#define TIME_COUNTDOWN_HOTPOTATO 11#define TIME_COUNTDOWN_COMMANDER 11#define BEAM_LIFE 40#define BEAM_WIDTH 10#define BEAM_BRIGHT 195#define POINTS_KILL 3#define POINTS_KILL_HS 5#define POINTS_LR 5#define POINTS_ROUND_START 1#define POINTS_ROUND_END 2#define POINTS_MIN_PLAYERS 7#define RANDOM_PLAYER_GLOW Float:3.0#define TEAMJOIN_TEAM "1"#define TEAMJOIN_CLASS "2"#define FUN_ROULETTE_CHANCE 10#define FUN_ROULETTE_POINTS 100#define FUN_LOTTERY_POINTS 750000#define FUN_LOTTERY_NUMBERS 6#define RAFFLE_TICKET_COST 50#define TEAM_RATIO 3#define MINIMUM_TIME_TO_CT 10/*
This is where you stop. Editing anything below this point
might lead to some serious errors, and you will not get any
support if you do.
SAFETY ZONE ENDS HERE
*/
I would like to terribly apologize for the missing list of credits that should be given to all those who deserve it out there. Since this plugin grew so fast, I lost track of all the plugins/code that I used. I would like to thank the entire open source community of AlliedMods for the vaste array of helping tutorials and pieces of code.
Yes the blackjack is indeed the blackjack plugin made by joaquim, which I edited it to work with the point system in this plugin. Whoever I could not find the plugin, so I will be editing it again and posting it here if there is no problem about it.
Also the sounds you are referring to is the katana knife sound if I am not mistaken. Will dig into that soon.
Well its never called from anywhere ... but after using a program to transcribe it "amxmodx.wad" ... I must say you've got me confused lol.
Anyway, I've started reviewing this and I've got quite a long list of to do's. Will post sometime soon.
Oh yes indeed, I did remove the code that registers this but I forgot to remove it
Anyway I am pretty sure I already know what some of your todos include. Here are the ones that I could think of as of right now:
1. Hook/Unhook Ham forwards only to when they are being used.
2. Remove hardcoded values.
3. Constants that are decalred global but only used in certain functions should be static inside that function.
4. Trying not to use 1.8.3 dev build but go for 1.8.2 compatibility.
5. Try to save different informations into different vaults.
6. Using charsmax instead of hardcoded string length.
Many many more stuff that I have probably missed. But yes I get your point. And I will fix them.