Senior Member
|
01-11-2016
, 17:32
Re: [T] List of Modified + Requested Plugins
|
#1084
|
Quote:
Originally Posted by zmd94
This plugin ( https://forums.alliedmods.net/showpo...&postcount=188) will allow player to know their rank via chat. Just write /rank or rank in chat. It also has "Kill per Death" ratio feature. Yet, it hud color will be fixed.
Then, for this plugin ( https://forums.alliedmods.net/showpo...&postcount=157), it have random hud color with host name. However, player cannot write anything to know their rank. The rank only will be displayed automatically at their first connect to the server.
Next, just use below code for the powerful knife:
Code:
#include <amxmodx>
#include <engine>
#include <zombieplague>
#include <hamsandwich>
#include <fakemeta>
#include <cstrike>
#include <fun>
new Float:g_Leap[33]
new iHumanS[33]
new g_JumpCount[33], g_Right[33]
new g_iLight, g_iSmo
new g_iSpecial
new g_iFrag, g_iAPBonus, g_iJump, g_iLeapForce, g_iLeapHeight, g_iLeapCooldown, g_iHealth, g_iArmor
new g_iMaxPlayers
public plugin_init()
{
register_plugin( "[ZP] Human Class: Special", "0.1", "zmd94" );
register_clcmd("chooseteam", "clcmd_changeteam")
g_iSpecial = zp_register_extra_item("Special Human", 30, ZP_TEAM_HUMAN)
register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")
RegisterHam(Ham_Killed, "player", "fw_PlayerKilled", 1)
RegisterHam(Ham_Player_Jump, "player", "fw_PlayerJump", 0)
RegisterHam(Ham_Touch, "weaponbox", "fw_TouchWeapon")
RegisterHam(Ham_Touch, "armoury_entity", "fw_TouchWeapon")
RegisterHam(Ham_Touch, "weapon_shield", "fw_TouchWeapon")
register_forward(FM_CmdStart, "fw_Start")
register_forward(FM_PlayerPreThink, "fw_PlayerPreThink")
g_iAPBonus = register_cvar("zp_AP_bonus", "1") // Amount of AP bonus
g_iFrag = register_cvar("zp_frag_bonus", "1") // Amount of frag bonus
g_iHealth = register_cvar("zp_health_bonus", "150") // Amount of health bonus
g_iArmor = register_cvar("zp_armor_bonus", "50") // Amount of armor bonus
g_iJump = register_cvar("zp_multi_jump_amount", "3") // Amount of multi-jump given
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
g_iMaxPlayers = get_maxplayers()
}
public plugin_precache()
{
g_iLight = precache_model( "sprites/lgtning.spr" );
g_iSmo = precache_model( "sprites/steam1.spr" );
}
public clcmd_changeteam(id)
{
if(is_user_alive(id) && iHumanS[id])
{
client_print(id, print_chat, "[ZP] The menu is disabled!")
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}
public event_round_start()
{
for (new id = 1; id <= g_iMaxPlayers; id++)
{
iHumanS[id] = false
}
}
public fw_Start(id)
{
if(!is_user_alive(id) || !iHumanS[id])
return
if( pev(id, pev_button) & IN_ATTACK2)
{
g_Right[id] = true
}
}
public fw_PlayerPreThink(id)
{
if (!is_user_alive(id) || !iHumanS[id])
return FMRES_IGNORED
if (allowed_Leap(id))
{
static Float:velocity[3]
velocity_by_aim(id, get_pcvar_num(g_iLeapForce), velocity)
velocity[2] = get_pcvar_float(g_iLeapHeight)
set_pev(id, pev_velocity, velocity)
g_Leap[id] = get_gametime()
}
return FMRES_IGNORED
}
allowed_Leap(id)
{
if (!is_user_alive(id) || !iHumanS[id])
return false
static buttons
buttons = pev(id, pev_button)
if (!(pev(id, pev_flags) & FL_ONGROUND) || fm_get_speed(id) < 20 || !(buttons & IN_JUMP) || !(buttons & IN_DUCK))
return false
if (get_gametime() - g_Leap[id] < get_pcvar_float(g_iLeapCooldown))
return false
return true
}
public fw_TouchWeapon(weapon, id)
{
if (is_user_alive(id) && iHumanS[id])
{
return HAM_SUPERCEDE;
}
return HAM_IGNORED;
}
public zp_extra_item_selected(id, itemid)
{
if (itemid == g_iSpecial)
{
strip_user_weapons(id)
give_item(id, "weapon_knife")
set_user_health(id, get_user_health(id) + get_pcvar_num(g_iHealth))
set_user_armor(id, get_user_armor(id) + get_pcvar_num(g_iArmor))
client_print(id, print_chat, "[ZP] You are now Special Human!")
iHumanS[id] = true
}
}
public zp_user_infected_post(id, infector)
{
if (is_user_alive(id) && iHumanS[id])
{
iHumanS[id] = false
}
}
public fw_PlayerJump(id)
{
if(is_user_alive(id) && iHumanS[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
}
if(get_pcvar_num(g_iJump))
{
if( get_pdata_float(id, 251) < 500 && ++g_JumpCount[id] <= get_pcvar_num(g_iJump))
{
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 fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type)
{
if (!is_user_alive(attacker) || victim == attacker)
return
if (!zp_get_user_zombie(attacker) && g_Right[attacker])
{
if(get_user_weapon(attacker) == CSW_KNIFE)
{
if(zp_get_user_zombie(victim))
{
new vorigin[ 3 ], pos[ 3 ];
get_user_origin( victim, vorigin );
vorigin[ 2 ] -= 26;
pos[ 0 ] = vorigin[ 0 ] + 150;
pos[ 1 ] = vorigin[ 1 ] + 150;
pos[ 2 ] = vorigin[ 2 ] + 800;
user_kill(victim)
bThunder( pos, vorigin );
bSmo( vorigin, 10, 10 );
ExecuteHam(Ham_AddPoints, attacker, get_pcvar_num(g_iFrag), true)
g_Right[attacker] = false
}
}
}
}
public fw_PlayerKilled(victim, attacker)
{
if (!is_user_alive(attacker) || victim == attacker)
return
if (!zp_get_user_zombie(attacker) && g_Right[attacker])
{
if(get_user_weapon(attacker) == CSW_KNIFE)
{
zp_set_user_ammo_packs(attacker, zp_get_user_ammo_packs(attacker) + get_pcvar_num(g_iAPBonus))
}
}
}
bThunder( start[ 3 ], end[ 3 ] )
{
message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
write_byte( TE_BEAMPOINTS );
write_coord( start[ 0 ] );
write_coord( start[ 1 ] );
write_coord( start[ 2 ] );
write_coord( end[ 0 ] );
write_coord( end[ 1 ] );
write_coord( end[ 2 ] );
write_short( g_iLight );
write_byte( 1 );
write_byte( 5 );
write_byte( 7 );
write_byte( 150 );
write_byte( 30 );
write_byte( 200 );
write_byte( 200 );
write_byte( 200 );
write_byte( 200 );
write_byte( 200 );
message_end();
message_begin( MSG_PVS, SVC_TEMPENTITY, end );
write_byte( TE_SPARKS );
write_coord( end[ 0 ] );
write_coord( end[ 1 ]);
write_coord( end[ 2 ] );
message_end();
}
bSmo( iorigin[ 3 ], scale, framerate )
{
message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
write_byte( TE_SMOKE );
write_coord( iorigin[ 0 ] );
write_coord( iorigin[ 1 ] );
write_coord( iorigin[ 2 ] );
write_short( g_iSmo );
write_byte( scale );
write_byte( framerate );
message_end();
}
stock fm_get_speed(entity)
{
static Float:velocity[3]
pev(entity, pev_velocity, velocity)
return floatround(vector_length(velocity))
}
Lastly, for the ability cooldown, just try below:
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", "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
//////////////////////////////////////////////////////////////////
// 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)
{
if(g_iSpeed[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 use this ability for this round. Just wait until next round!")
}
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, "You can't use this ability 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);
}
|
alright, so for super human or first code it still didnt give ammo packs to killer or even frag (there was bug, when i bought super human i lost my weapons and i couldnt pick any weapon back up from the ground, but i could buy from extra menu and then use it, very weird bug) and for code number 2 or admin ability, when i spawn or start the game i got the extra hp and armor and unlimited ammo before i use the ability, and when i use the ability i get movement speed and message "you already use this ability for this round, wait next round" but i could still use the ability more than one time per round, if it is possible for you to do, i want no abilities for admin before he use the ability, so no hp no armor no unlimited clip when spawn, only when he use the ability he gets those things, thanks for trying dude!
|
|