Senior Member
|
01-30-2016
, 09:32
Re: [T] List of Modified + Requested Plugins
|
#1100
|
Quote:
Originally Posted by zmd94
You can find IN_USE code and change it into IN_RELOAD. Then, if the player what to use the ability, they have to press reload button.
Next, for the unlimited infection bomb, just change below:
Code:
public current_weapon(id)
{
if(g_bAbility[id])
{
new iWeapon = get_user_weapon(id)
if(iWeapon == CSW_HEGRENADE)
{
give_item(id, "weapon_hegrenade")
cs_set_user_bpammo(id, CSW_HEGRENADE, 245)
}
if(iWeapon == CSW_HEGRENADE)
{
give_item( id, "weapon_flashbang" )
cs_set_user_bpammo(id, CSW_FLASHBANG, 245)
}
if(iWeapon == CSW_HEGRENADE)
{
give_item( id, "weapon_smokegrenade" )
cs_set_user_bpammo(id, CSW_SMOKEGRENADE, 245)
}
}
}
-->
Code:
public current_weapon(id)
{
if(!zp_get_user_zombie(id) && g_bAbility[id])
{
new iWeapon = get_user_weapon(id)
if(iWeapon == CSW_HEGRENADE)
{
give_item(id, "weapon_hegrenade")
cs_set_user_bpammo(id, CSW_HEGRENADE, 245)
}
if(iWeapon == CSW_HEGRENADE)
{
give_item( id, "weapon_flashbang" )
cs_set_user_bpammo(id, CSW_FLASHBANG, 245)
}
if(iWeapon == CSW_HEGRENADE)
{
give_item( id, "weapon_smokegrenade" )
cs_set_user_bpammo(id, CSW_SMOKEGRENADE, 245)
}
}
}
|
Code:
//// zp_zadmin_ability.sma
// C:\Program Files (x86)\Steam\steamapps\common\Half-Life\cstrike\addons\amxmod
x\scripting\zp_zadmin_ability.sma(61) : error 017: undefined symbol "zp_get_user
_zombie"
//
// 1 Error.
// Could not locate output file compiled\zp_zadmin_ability.amx (compile failed).
//
// Compilation Time: 0.16 sec
// ----------------------------------------
ok i only had to go to inlcudes and add this:
Code:
#include <zombieplague>
so here is the updated code if you want to put it beside original admin ability, the button is on R now
Code:
#include <amxmodx>
#include <zombieplague>
#include <fakemeta>
#include <hamsandwich>
#include <cstrike>
#include <fun>
//////////////////////////////////////////////////////////////////
// DEFINE FLAG //
//////////////////////////////////////////////////////////////////
#define OWNER_FLAG ADMIN_IMMUNITY
#define ADMIN_FLAG ADMIN_BAN
//////////////////////////////////////////////////////////////////
new cvar_multijump, cvar_health, cvar_armor
new cvar_boost_amount, cvar_ability_duration
const TASK_SPEED_BOOST = 100
#define ID_SPEED_BOOST (taskid - TASK_SPEED_BOOST)
new Ham:Ham_Player_ResetMaxSpeed = Ham_Item_PreFrame
// CS Offsets
#if cellbits == 32
const OFFSET_CLIPAMMO = 51
#else
const OFFSET_CLIPAMMO = 65
#endif
const OFFSET_LINUX_WEAPONS = 4
// Max Clip for weapons
new const MAXCLIP[] = { -1, 13, -1, 10, 1, 7, -1, 30, 30, 1, 30, 20, 25, 30, 35, 25, 12, 20,
10, 30, 100, 8, 30, 30, 20, 2, 7, 30, 30, -1, 50 }
new bool:g_bAbility[33], bool:g_bTempAbility[33]
new g_JumpCount[33]
public plugin_init()
{
register_plugin("[ZP] Admin Ability", "1.0", "zmd94")
register_logevent("round_start", 2, "1=Round_Start")
register_event("CurWeapon", "current_weapon", "be", "1=1")
register_message(get_user_msgid("CurWeapon"), "message_cur_weapon")
RegisterHam(Ham_Player_Jump, "player", "fw_PlayerJump", 0)
RegisterHam(Ham_Player_ResetMaxSpeed, "player", "fw_ResetMaxSpeed_Post", 1)
RegisterHam(Ham_Killed, "player", "fw_PlayerKilled")
register_forward(FM_CmdStart, "fw_Start")
cvar_multijump = register_cvar("aa_multijump_amount", "0") // Amount of multi-jump given
cvar_health = register_cvar("aa_health_amount", "100") // Amount of health given
cvar_armor = register_cvar("aa_armor_amount", "50") // Amount of armor given
cvar_boost_amount = register_cvar("aa_boost_amount", "100.0") // Amount of speed boost
cvar_ability_duration = register_cvar("aa_ability_duration", "30.0") // Duration of all abilities
}
public current_weapon(id)
{
if(!zp_get_user_zombie(id) && g_bAbility[id])
{
new iWeapon = get_user_weapon(id)
if(iWeapon == CSW_HEGRENADE)
{
give_item(id, "weapon_hegrenade")
cs_set_user_bpammo(id, CSW_HEGRENADE, 245)
}
if(iWeapon == CSW_HEGRENADE)
{
give_item( id, "weapon_flashbang" )
cs_set_user_bpammo(id, CSW_FLASHBANG, 245)
}
if(iWeapon == CSW_HEGRENADE)
{
give_item( id, "weapon_smokegrenade" )
cs_set_user_bpammo(id, CSW_SMOKEGRENADE, 245)
}
}
}
public fw_Start(id)
{
if(is_user_alive(id) && get_user_flags(id) & OWNER_FLAG)
{
if( pev(id, pev_button) & IN_RELOAD)
{
if(g_bTempAbility[id])
{
set_hudmessage(random_num(10,255), random(256), random(256), -1.0, 0.20, 0, 6.0, 12.0, 0.0, 0.0, -1)
show_hudmessage(id, "")
}
else
{
// Player frozen (or CS freezetime)
if (pev(id, pev_maxspeed) <= 1)
{
set_hudmessage(random_num(10,255), random(256), random(256), -1.0, 0.20, 0, 6.0, 12.0, 0.0, 0.0, -1)
show_hudmessage(id, "Relax, you're frozen!")
return PLUGIN_HANDLED;
}
g_bTempAbility[id] = true
g_bAbility[id] = true
set_user_health(id, get_user_health(id) + get_pcvar_num(cvar_health))
set_user_armor(id, get_user_armor(id) + get_pcvar_num(cvar_armor))
set_hudmessage(random_num(10,255), random(256), random(256), -1.0, 0.20, 0, 6.0, 12.0, 0.0, 0.0, -1)
show_hudmessage(id, "AAAAAAAWWWWWWWWWW YEEEEEEAAAAAHHHHH FEEL IT RUSHING THROUGH MY VAINS.....")
// Set the restore speed task
set_task(get_pcvar_float(cvar_ability_duration), "restore_maxspeed", id + TASK_SPEED_BOOST)
// Update player's maxspeed
ExecuteHamB(Ham_Player_ResetMaxSpeed, id)
}
}
}
return PLUGIN_CONTINUE;
}
public restore_maxspeed(taskid)
{
set_hudmessage(random_num(10,255), random(256), random(256), -1.0, 0.20, 0, 6.0, 12.0, 0.0, 0.0, -1)
show_hudmessage(ID_SPEED_BOOST, "")
g_bAbility[ID_SPEED_BOOST] = false
// Update player's maxspeed
ExecuteHamB(Ham_Player_ResetMaxSpeed, ID_SPEED_BOOST)
}
public fw_PlayerKilled(victim)
{
remove_task(victim + TASK_SPEED_BOOST)
}
public client_disconnect(id)
{
g_bAbility[id] = false
g_bTempAbility[id] = false
remove_task(id + TASK_SPEED_BOOST)
}
public round_start()
{
new iPlayers[32], iPlayerCount, i, id
get_players(iPlayers, iPlayerCount, "a")
for(i = 0; i < iPlayerCount; i++)
{
id = iPlayers[i]
g_bAbility[id] = false
g_bTempAbility[id] = false
remove_task(id + TASK_SPEED_BOOST)
}
}
public fw_ResetMaxSpeed_Post(id)
{
if (!is_user_alive(id) || !g_bAbility[id])
return;
// Apply speed boost
new Float:current_maxspeed
pev(id, pev_maxspeed, current_maxspeed)
set_pev(id, pev_maxspeed, current_maxspeed + get_pcvar_float(cvar_boost_amount))
}
public fw_PlayerJump( id )
{
if( is_user_alive(id) && get_user_flags(id) & ADMIN_FLAG && g_bAbility[id])
{
new Flags = pev( id, pev_flags )
if( Flags & FL_WATERJUMP || pev(id, pev_waterlevel) >= 2 || !(get_pdata_int(id, 246) & IN_JUMP) )
{
return HAM_IGNORED
}
if( Flags & FL_ONGROUND )
{
g_JumpCount[ id ] = 0
return HAM_IGNORED
}
new Multi = get_pcvar_num(cvar_multijump)
if( Multi )
{
if( get_pdata_float(id, 251) < 500 && ++ g_JumpCount[id] <= Multi )
{
new Float:fVelocity[ 3 ]
pev( id, pev_velocity, fVelocity )
fVelocity[ 2 ] = 268.328157
set_pev( id, pev_velocity, fVelocity )
return HAM_HANDLED
}
}
}
return HAM_IGNORED
}
public message_cur_weapon(msg_id, msg_dest, msg_entity)
{
// Player doesn't have the unlimited clip upgrade
if (!g_bAbility[msg_entity])
return;
// Player not alive or not an active weapon
if (!is_user_alive(msg_entity) || get_msg_arg_int(1) != 1)
return;
static weapon, clip
weapon = get_msg_arg_int(2) // get weapon ID
clip = get_msg_arg_int(3) // get weapon clip
// Unlimited Clip Ammo
if (MAXCLIP[weapon] > 1) // skip grenades
{
set_msg_arg_int(3, get_msg_argtype(3), MAXCLIP[weapon]) // HUD should show full clip all the time
if (clip < 2) // refill when clip is nearly empty
{
// Get the weapon entity
static wname[32], weapon_ent
get_weaponname(weapon, wname, sizeof wname - 1)
weapon_ent = fm_find_ent_by_owner(-1, wname, msg_entity)
// Set max clip on weapon
fm_set_weapon_ammo(weapon_ent, MAXCLIP[weapon])
}
}
}
// Find entity by its owner (from fakemeta_util)
stock fm_find_ent_by_owner(entity, const classname[], owner)
{
while ((entity = engfunc(EngFunc_FindEntityByString, entity, "classname", classname)) && pev(entity, pev_owner) != owner) {}
return entity;
}
// Set Weapon Clip Ammo
stock fm_set_weapon_ammo(entity, amount)
{
set_pdata_int(entity, OFFSET_CLIPAMMO, amount, OFFSET_LINUX_WEAPONS);
}
__________________
ANY SCRIPTER ON THIS FORUM HAS FREE VIP/ADMIN IN MY SERVER!
Last edited by New and Clueless; 01-30-2016 at 10:33.
|
|