Veteran Member
Join Date: Dec 2009
Location: Belgium
|
03-30-2020
, 12:24
Re: [REQ] Simple jailbreak fun mod.
|
#2
|
By reading your post I see you have knowledge about programming,
so here is the code I used for my Funday API system: One in the Chamber
I bet you have to knowledge to use and edit the code to get it working the way you want,
PHP Code:
#include <amxmodx> #include <fakemeta> #include <cstrike> #include <fun> #include <fakemeta> #include <hamsandwich> #include <colorchat>
#include <jb-main>
const XO_CBASEPLAYERITEM = 4 const m_pPlayer = 41
// Funday defaults #define FUNDAY_Name "One In The Chamber" #define FUNDAY_Type TYPE_FFA #define FUNDAY_Maxplays 2 #define FUNDAY_Startdelay 10 #define FUNDAY_Maxtime 240 #define FUNDAY_Flags (bit(FLAG_FFA) | bit(FLAG_COMBINATETEAMS) | bit(FLAG_FAKECT) | bit(FLAG_WEAPONRESTRICT) | bit(FLAG_STRIPWEAPON) | bit(FLAG_GOD) | bit(FLAG_ANTICAMP) | bit(FLAG_WALLHACK)) #define FUNDAY_Descshort "One person, one deagle with only one bullet" #define FUNDAY_Description "Everyone got one deagle,^n with only one bullet.^n For each kill, you get an extra bullet^n Who will survive, who will still be standing?"
new FUNDAY_RESTRICTED_WEAPONS[] = { /* T-Team */ (bit(CSW_DEAGLE)), /* CT-TEAM */(bit(CSW_DEAGLE)) }
// Gameplay new g_intFunday, bool:g_boolFunday, bool:g_blockdrop_bool new g_listClientdeagle[33]
public plugin_init() { register_plugin("JB Funday: Chamber", "Xalus", "1.1")
// Register: Funday g_intFunday = jb_funday(FUNDAY_Name, FUNDAY_Type, FUNDAY_Maxplays, FUNDAY_Startdelay, FUNDAY_Maxtime, FUNDAY_Flags, FUNDAY_Descshort, FUNDAY_Description) // Change specific activeflag for FLAG_ jb_funday_flagactive(g_intFunday, FLAG_GOD, FLAGACTIVE_PRESTART) // Set a restriction of weapons for certain teams jb_funday_weaponrestrict(g_intFunday, FUNDAY_RESTRICTED_WEAPONS)
// Register: Ham RegisterHam(Ham_Killed, "player", "Ham_PlayerKilled_Post", 1) RegisterHam(Ham_TakeDamage, "player", "Ham_PlayerTakeDamage", 0) RegisterHam(Ham_Item_Deploy, "weapon_deagle", "HookDeagle_postDeploy", 1) RegisterHam(Ham_CS_Item_CanDrop, "weapon_deagle", "HookDeagle_preDrop")
// Pause the plugin until funday starts. pause("a") }
public jb_funday_start(client, funday) { if(g_intFunday == funday) { g_boolFunday = true
new listPlayers[32], intPlayers get_players(listPlayers, intPlayers, "a")
for(new i = 0; i < intPlayers; i++) { if(user_has_weapon(listPlayers[i], CSW_DEAGLE)) { strip_user_weapons(listPlayers[i]) give_item(listPlayers[i], "weapon_knife") }
g_listClientdeagle[listPlayers[i]] = give_item(listPlayers[i], "weapon_deagle") if(pev_valid(g_listClientdeagle[listPlayers[i]])) { cs_set_weapon_ammo(g_listClientdeagle[listPlayers[i]], 1) } } } }
public jb_funday_prestart(client, funday, countdown) { if(g_intFunday == funday) { g_blockdrop_bool = true } }
public jb_funday_stop(roundendtype, funday, client) { g_boolFunday = false g_blockdrop_bool = false
if(g_intFunday == funday) { if((roundendtype == ROUNDEND_Twin || roundendtype == ROUNDEND_CTwin) && client > 0) { new stringName[32] get_user_name(client, stringName, charsmax(stringName))
ColorChat(0, (roundendtype == ROUNDEND_Twin) ? RED : BLUE, "^4[Funday]^1 Survivor^3 %s^1 proved to be the best with a deagle and knife!", stringName) } } }
// Ham: Player take damage // - When player is hit by deagle, set damage to 100.0 (Instant kill) public Ham_PlayerTakeDamage(victim, idinflictor, attacker, Float:damage, damagebits) { if(g_boolFunday && is_user_connected(attacker) //&& damagebits & DMG_BULLET && get_user_weapon(attacker) == CSW_DEAGLE) { // Deagle is deadly SetHamParamFloat(4, 200.0) } }
// Ham: Killed // - Give the killer a bullet! public Ham_PlayerKilled_Post(client, killer, gib) { if(g_boolFunday && is_user_alive(killer)) { new entityWeapon, intClip = 0 // See if the killer still got his deagle if(pev_valid(g_listClientdeagle[killer]) && user_has_weapon(killer, CSW_DEAGLE)) { new stringClassname[32] pev(g_listClientdeagle[killer], pev_classname, stringClassname, charsmax(stringClassname))
if(equal(stringClassname, "weapon_deagle")) { entityWeapon = g_listClientdeagle[killer]
if(pev_valid(entityWeapon)) { intClip = cs_get_weapon_ammo(entityWeapon) } } } // Client doesn't have his deagle anymore if(!entityWeapon) { entityWeapon = give_item(killer, "weapon_deagle") g_listClientdeagle[killer] = entityWeapon intClip = 0 }
if(pev_valid(entityWeapon)) { client_print(killer, print_center, "You've been rewarded with an extra bullet!") cs_set_weapon_ammo(entityWeapon, (intClip + 1))
user_has_weapon(killer, CSW_DEAGLE, 1) } } }
public HookDeagle_postDeploy(entity) { if(g_boolFunday) { static client client = get_pdata_cbase(entity, m_pPlayer, XO_CBASEPLAYERITEM)
if(is_user_alive(client)) { g_listClientdeagle[client] = entity
//client_print(0, print_chat, "Pickedup a deagle with %i clip", cs_get_weapon_ammo(entity))
// If the number of the deagle is higher then 1, reset it back to 1. if(cs_get_weapon_ammo(entity) > 1) { cs_set_weapon_ammo(entity, 1) } cs_set_user_bpammo(client, CSW_DEAGLE, 0) } } }
public HookDeagle_preDrop(entity) { if(g_blockdrop_bool) { SetHamReturnInteger(0) return HAM_SUPERCEDE } return HAM_IGNORED }
__________________
Retired.
|
|