Zrobiłbyś na flagę t. ![:ok:](https://amxx.pl/public/style_emoticons/default/ok.gif)
Sprawdź:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <codmod>
#include <fakemeta>
#include <hamsandwich>
#define PLUGIN "[Perk] Increase jump"
#define VERSION "1.0"
#define AUTHOR "Fili:P"
new bool:ma_perk[33];
new bool:g_playerUseJump[33];
new g_trail;
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_forward(FM_CmdStart, "fw_CmdStart");
cod_register_perk("Increase jump", "Wyzej skaczesz");
RegisterHam(Ham_TakeDamage, "player", "ham_preTakeDamage");
}
public plugin_precache()
{
g_trail = precache_model("sprites/smoke.spr");
}
public cod_perk_enabled(id)
{
if(get_user_flags(id) & ADMIN_LEVEL_H)
return COD_STOP;
ma_perk[id]=true;
}
public cod_perk_disabled(id)
{
ma_perk[id]=false;
}
public ham_preTakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)
{
if(damagebits == (1<<5) && ma_perk[this] && g_playerUseJump[this])
{
SetHamParamFloat(4, 0.0);
g_playerUseJump[this]=false;
}
}
public fw_CmdStart(id, uc_handle)
{
if(get_uc(uc_handle, UC_Buttons) & IN_JUMP && !(pev(id, pev_oldbuttons) & IN_JUMP) && ma_perk[id] && !g_playerUseJump[id])
{
new Float:fVelocity[3];
pev(id, pev_velocity, fVelocity);
fVelocity[2]+=random_float(250.0, 350.0);
set_pev(id, pev_velocity, fVelocity);
new Float:fPunchangle[3];
fPunchangle[0] = random_float(1.0, 10.0);
fPunchangle[1] = random_float(1.0, 10.0);
fPunchangle[2] = random_float(1.0, 10.0);
set_pev(id, pev_punchangle, fPunchangle);
message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
write_byte(TE_BEAMFOLLOW);
write_short(id);
write_short(g_trail);
write_byte(3);
write_byte(5);
write_byte(random_num(0,255));
write_byte(random_num(0,255));
write_byte(random_num(0,255));
write_byte(120);
message_end();
g_playerUseJump[id]=true;
set_task(0.1, "IsOnGround", id, _, _, "b");
}
}
public IsOnGround(id)
{
if(pev(id, pev_flags) & FL_ONGROUND)
{
g_playerUseJump[id]=false;
if(task_exists(id))
remove_task(id);
}
}