/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <codmod>
#include <engine>
#include <fun>
#include <fakemeta>
new const perk_name[] = "Hipnoza";
new const perk_desc[] = "Po wcisnieciu klawisza E na wrogu, zostaje zahipnotyzowany i nie moze poruszac sie przez 5sec.";
new bool:ma_perk[33]
new ilosc_uzyc[33] = 1
new bool:attack[33] = false
new bool:hipnoza[33]
public plugin_init()
{
register_plugin(perk_name, "1.0", ".:Vitek:.");
cod_register_perk(perk_name, perk_desc);
register_forward(FM_PlayerPreThink, "PlayerPreThink")
register_forward(FM_UpdateClientData, "UpdateClientData_Post", 1)
}
public cod_perk_enabled(id)
{
ma_perk[id] = true
}
public cod_perk_disabled(id)
{
ma_perk[id] = false
}
public client_PreThink(id)
{
new cel, body, dystans = get_user_aiming(id, cel, body, dystans)
new Float:stara_grawitacja = get_user_gravity(cel)
new Float:stary_speed = get_user_maxspeed(cel)
if(cel != 0 && cel != id && get_user_button(id) & IN_USE && !(get_user_oldbutton(id) & IN_USE) && ma_perk[id] == true && ilosc_uzyc[id] > 0 && hipnoza[cel] == false && dystans <= 80)
{
set_user_gravity(cel, 3.0)
set_user_maxspeed(cel, 0.1)
hipnoza[id] = true
new czas_trwania = 5;
czas_trwania --
if(czas_trwania == 0)
{
set_user_gravity(cel, stara_grawitacja)
set_user_maxspeed(cel, stary_speed)
hipnoza[id] = false
}
}
return PLUGIN_HANDLED
}
public PlayerPreThink(id)
{
if(!attack[id] || !is_user_alive(id) || !(hipnoza[id] == true))
return FMRES_IGNORED
set_pev(id, pev_button, pev(id,pev_button) & ~IN_ATTACK)
return FMRES_HANDLED
}
public UpdateClientData_Post(id, sendweapons, cd_handle)
{
if(!attack[id] || !is_user_alive(id) || !(hipnoza[id] == true))
return FMRES_IGNORED
set_cd(cd_handle, CD_ID, 0)
return FMRES_HANDLED
}
Użytkownik MarWit edytował ten post 14.06.2011 19:30