Senior Member
|
01-09-2016
, 12:01
Re: [T] List of Modified + Requested Plugins
|
#1080
|
Quote:
Originally Posted by zmd94
My zombie class is better than Fry.
For you first request, just try below code:
Code:
/*
//////////////////////////////////////////////////////////////////
// OWNER CAN ACTIVE THE SPEED BOOST BY PRESSING [E] BUTTON //
//////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////
// ADMIN + OWNER //
// //
// JUST say /freehealth TO RECIEVE FREE HEALTH //
// JUST say /freearmor TO RECIEVE FREE ARMOR //
// //
//////////////////////////////////////////////////////////////////
*/
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <cstrike>
#include <fun>
//////////////////////////////////////////////////////////////////
// DEFINE FLAG //
//////////////////////////////////////////////////////////////////
#define OWNER_FLAG ADMIN_IMMUNITY
#define ADMIN_FLAG ADMIN_BAN
//////////////////////////////////////////////////////////////////
new g_bRecieveArmor[33], g_bRecieveHP[33]
new cvar_multijump, cvar_health, cvar_armor
new cvar_boost_amount, cvar_boost_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 g_UnlimitedC[33], g_JumpCount[33], g_iSpeed[33]
new g_iMaxPlayers
public plugin_init()
{
register_plugin("[ZP] Addon: Admin Ability", "1.0", "zmd94")
register_clcmd("say /freehealth", "iHealth")
register_clcmd("say_team /freehealth", "iHealth")
register_clcmd("say /freearmor", "iArmor")
register_clcmd("say_team /freearmor", "iArmor")
register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
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_Spawn, "player", "fw_PlayerRespawn", 1)
RegisterHam(Ham_Player_ResetMaxSpeed, "player", "fw_ResetMaxSpeed_Post", 1)
RegisterHam(Ham_Killed, "player", "fw_PlayerKilled")
register_forward(FM_CmdStart, "fw_Start")
//////////////////////////////////////////////////////////////////
// ADMIN + OWNER //
//////////////////////////////////////////////////////////////////
cvar_multijump = register_cvar("aa_multijump_amount", "5") // 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
//////////////////////////////////////////////////////////////////
// OWNER ONLY //
//////////////////////////////////////////////////////////////////
cvar_boost_amount = register_cvar("aa_boost_amount", "100.0") // Amount of speed boost
cvar_boost_duration = register_cvar("aa_boost_duration", "30.0") // Duration of speed boost
g_iMaxPlayers = get_maxplayers()
}
public current_weapon(id)
{
if(g_UnlimitedC[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_USE)
{
// 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, "You can't use this item when frozen!")
return PLUGIN_HANDLED;
}
// Enable speed boost
g_iSpeed[id] = true
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 enabled!")
// Set the restore speed task
set_task(get_pcvar_float(cvar_boost_duration), "restore_maxspeed", id + TASK_SPEED_BOOST)
// Update player's maxspeed
ExecuteHamB(Ham_Player_ResetMaxSpeed, id)
}
}
return PLUGIN_CONTINUE;
}
public restore_maxspeed(taskid)
{
// Disable speed boost
g_iSpeed[ID_SPEED_BOOST] = false
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, "Speed boost is over!")
// Update player's maxspeed
ExecuteHamB(Ham_Player_ResetMaxSpeed, ID_SPEED_BOOST)
}
public fw_PlayerKilled(victim)
{
g_iSpeed[victim] = false
remove_task(victim + TASK_SPEED_BOOST)
}
public client_disconnect(id)
{
g_iSpeed[id] = false
remove_task(id + TASK_SPEED_BOOST)
}
// Remove speed boost at round start
public event_round_start()
{
for (new id = 1; id <= g_iMaxPlayers; id++)
{
g_iSpeed[id] = false
g_bRecieveArmor[id] = false
g_bRecieveHP[id] = false
remove_task(id + TASK_SPEED_BOOST)
}
}
public fw_ResetMaxSpeed_Post(id)
{
if (!is_user_alive(id) || !g_iSpeed[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_PlayerRespawn(id)
{
if(is_user_alive(id) && get_user_flags(id) & ADMIN_FLAG)
{
g_UnlimitedC[id] = true
set_task(5.0, "iHealth", id)
set_task(6.0, "iArmor", id)
}
}
public iHealth(id)
{
if(is_user_alive(id) && get_user_flags(id) & ADMIN_FLAG)
{
if(g_bRecieveHP[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, "You already recieved free HP. Just wait until new round!")
}
else
{
set_user_health(id, get_user_health(id) + get_pcvar_num(cvar_health))
g_bRecieveHP[id] = true
}
}
}
public iArmor(id)
{
if(is_user_alive(id) && get_user_flags(id) & ADMIN_FLAG)
{
if(g_bRecieveArmor[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, "You already recieved free armor. Just wait until new round!")
}
else
{
set_user_armor(id, get_user_armor(id) + get_pcvar_num(cvar_armor))
g_bRecieveArmor[id] = true
}
}
}
public fw_PlayerJump( id )
{
if( is_user_alive(id) && get_user_flags(id) & ADMIN_FLAG )
{
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_UnlimitedC[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);
}
|
it didnt work, i could keep using the ability, and unlimited clip all the time, is it possible to make you only get these effects when you use ability? or even lets say ability for human 30 sec but for zombie only 5 sec or something like that, thanks.
Quote:
Originally Posted by zmd94
New update!
[ZP] Zombie Class: Leap.
This zombie can do leap.
What can you edit:
PHP Code:
g_iLeapForce = register_cvar("zp_leap_force", "500") // Amount of leap force g_iLeapHeight = register_cvar("zp_leap_height", "300") // Amount of leap height g_iLeapCooldown = register_cvar("zp_leap_cooldown", "10.0") // Amount of leap cooldown
|
https://forums.alliedmods.net/showpo...&postcount=396
this is compiler for this plugin:
Code:
//// leap_2.sma
// C:\Program Files (x86)\Steam\steamapps\common\Half-Life\cstrike\addons\amxmod
x\scripting\leap_2.sma(76) : warning 217: loose indentation
// C:\Program Files (x86)\Steam\steamapps\common\Half-Life\cstrike\addons\amxmod
x\scripting\leap_2.sma(97) : warning 217: loose indentation
// Header size: 688 bytes
// Code size: 2284 bytes
// Data size: 1252 bytes
// Stack/heap size: 16384 bytes; estimated max. usage=42 cells (168 bytes)
// Total requirements: 20608 bytes
//
// 2 Warnings.
// Done.
//
// Compilation Time: 0.17 sec
// ----------------------------------------
Last edited by New and Clueless; 01-09-2016 at 13:21.
|
|