Spoiler
#include <amxmodx>
#include <codmod>
#include <hamsandwich>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <fakemeta>
#include <engine>
#define DMG_BULLET (1<<1)
#define TIME 2.0
#define UNIKAT 2013
new const TXT[] = "Zmieniles sie w rekina - noclip ON";
new msgBarTime;
new bool:ma_klase[33];
new const nazwa[] = "Shark";
new const opis[] = "po naladowaniu spada widocznosc i dostajesz noclipa, tylko noz";
new const bronie = 1<<CSW_KNIFE;
new const zdrowie = 25;
new const kondycja = 50;
new const inteligencja = 0;
new const wytrzymalosc = 50;
public plugin_init()
{
cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc);
RegisterHam(Ham_Spawn, "player", "Spawn", 1);
RegisterHam(Ham_TakeDamage, "player", "TakeDamage");
msgBarTime = get_user_msgid("BarTime");
}
public cod_class_enabled(id)
{
ma_klase[id] = true;
set_user_noclip(id, 1);
}
public cod_class_disabled(id)
{
ma_klase[id] = false;
set_user_noclip(id, 0);
}
public Spawn(id)
{
if(ma_klase[id])
{
strip_user_weapons(id);
give_item(id, "weapon_knife");
}
}
public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)
{
if(!is_user_connected(idattacker))
return HAM_IGNORED;
if(!ma_klase[idattacker])
return HAM_IGNORED;
if(get_user_weapon(idattacker) == CSW_KNIFE && damagebits & DMG_BULLET)
cod_inflict_damage(idattacker, this, 30.0, 0.20, idinflictor, damagebits);
return HAM_IGNORED;
}
public client_PreThink(id)
{
new clip, ammo
new weapon = get_user_weapon(id, clip, ammo)
new button2 = get_user_button(id);
if(!(is_user_moving(id)) && get_entity_flags(id) & FL_ONGROUND && (!(button2 & (IN_FORWARD+IN_BACK+IN_MOVELEFT+IN_MOVERIGHT)) && weapon == 29))
{
if(!task_exists(id+UNIKAT))
{
new data[1];
data[0] = id;
bartime(id, floatround(TIME))
set_task(TIME, "set_invisible", id+UNIKAT, data, 1)
}
}
else
{
if(task_exists(id+UNIKAT))
{
remove_task(id+UNIKAT);
bartime(id, 0);
}
set_rendering(id,kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 255);
set_user_noclip(id, 0);
}
}
public set_invisible(data[])
{
new id = data[0];
set_rendering(id,kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 10);
set_user_noclip(id, 1);
set_hudmessage(255, 255, 0, -1.0, 0.2, 0, 6.0, 3.0)
show_hudmessage(id, TXT)
}
stock bartime(id, czas) {
message_begin(MSG_ONE_UNRELIABLE, msgBarTime, .player = id);
write_short(czas);
message_end();
}
stock bool:is_user_moving(id){
new Float:fVelocity[3];
pev(id, pev_velocity, fVelocity);
if(fVelocity[ 0 ] != 0.0 || fVelocity[ 1 ] != 0.0 || fVelocity[ 2 ] != 0.0)
return true;
return false;
}
lecz pasek po naladowaniu laduje sie od poczatku, noclip nie dziala, a jak widocznosc nie wiem (nie mam jak sprawdzic)
moglby ktos naprawic ten blad?
ref : )
ref ( :


Dodatki SourceMod













