Witam . Podam tu pare przydatnych poradnikow do tworzenie klas.
Nieskonczonosc MultiJump
Spoiler
dodac do include;
#include <fakemeta>
Nad plugin_init() dopisujemy
new bool:ma_klase[33]
new skoki[33];
Do plugin_init dopisujemy
register_forward(FM_CmdStart, "fwCmdStart_MultiJump");
Dodajemy
cod class enabled i disabled o tak ;
public cod_class_enabled(id, wartosc)
{
skoki[id] = -1
ma_klase[id] = true;
}
public cod_class_disabled(id)
{
skoki[id] = 0
ma_klase[id] = false;
}
I na sam dól dodajemy
public fwCmdStart_MultiJump(id, uc_handle)
{
if(!is_user_alive(id) || !ma_klase[id])
return FMRES_IGNORED;
new flags = pev(id, pev_flags);
if((get_uc(uc_handle, UC_Buttons) & IN_JUMP) && !(flags & FL_ONGROUND) && !(pev(id, pev_oldbuttons) & IN_JUMP) && skoki[id])
{
skoki[id]--;
new Float:velocity[3];
pev(id, pev_velocity,velocity);
velocity[2] = random_float(265.0,285.0);
set_pev(id, pev_velocity,velocity);
}
else if(flags & FL_ONGROUND)
skoki[id] = -1;
return FMRES_IGNORED;
}
Nie otrzymywanie dmg za upadek z wysokosci;
Spoiler
Dodajesz do include ;
#include <engine>
pod includami dodajesz ;
#define FALL_VELOCITY 350.0
nad plugin_init() dodajemy;
new bool:ma_klase[33];
new bool:falling[33];
i dodajemy
public cod_class_enabled(id)
{
ma_klase[id] = true;
}
public cod_class_disabled(id)
ma_klase[id] = false;
public client_PreThink(id) {
if(ma_klase[id] && is_user_alive(id) && is_user_connected(id))
{
if(entity_get_float(id, EV_FL_flFallVelocity) >= FALL_VELOCITY) {
falling[id] = true;
}
else
{
falling[id] = false;
}
}
}
public client_PostThink(id) {
if(ma_klase[id] && is_user_alive(id) && is_user_connected(id))
{
if(falling[id]) {
entity_set_int(id, EV_INT_watertype, -3);
}
}
Regeneracja hp podczas kucania z dana bronia
Spoiler
Dodajemy do include;
#include <engine>
#include <fakemeta>
#include <fun>
Nad plugin_init dodajemy
new bool:ma_klase[33]
Do plugin_init dodajemy;
register_forward(FM_PlayerPreThink, "regeneration_health", 1);
Pod plugin_init dodajemy
public cod_class_enabled(id)
{
ma_klase[id] = true;
}
public cod_class_disabled(id)
{
ma_klase[id] = false;
}
//Przy kucaniu
public regeneration_health(id)
{
if((!ma_klase[id]) && is_user_alive(id))
return;
new button = get_user_button(id);
if( button & IN_DUCK && get_user_weapon(id) == CSW_[color=#0000cd][size=4]X[/size][/color])
{
if(get_user_health(id) > 100+cod_get_user_health( id, 1, 1, 1 ))
return;
else give_max_hp(id)
}
}
public give_max_hp(id) set_user_health(id,get_user_health(id)+1)
Tam gdzie jest X podajecie bron z ktora chcecie miec regeneracje na kucaniu.
Niewidzialność gdy nie poruszasz sie i stoisz w miejscu , Tylko wtedy!
Spoiler
Dodajemy do include;
#include <fakemeta>
#include <engine>
Nad plugin_init dodajemy;
new ma_klase[33];
I dodajemy pod plugin_init
public cod_class_enabled(id)
{
ma_klase[id] = true;
}
public cod_class_disabled(id)
{
ma_klase[id] = false;
}
public client_PreThink ( id )
{
new button2 = get_user_button(id);
//USE Button actives forward\backward\left\right
if (ma_klase[id] && get_entity_flags(id) & FL_ONGROUND && (!(button2 & (IN_FORWARD+IN_BACK+IN_MOVELEFT+IN_MOVERIGHT)) && is_user_alive(id)))
{
set_rendering(id,kRenderFxNone, 0, 0, 0, kRenderTransAlpha, X);
}
else set_rendering(id,kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 255);
///////////////////////////////////////////////////
return PLUGIN_CONTINUE
}
Tam gdzie jest X dodajemy ile chcemy niewidzialnosci gdy stoimy. 0 - calkowita niewidzialnosc , 255 , pelna (0-255)
Jak dodać cichy bieg
Tut bedzie aktualizowany.Dodam ze jest to nawet mój 1 post na amxx proszę o łagodną krytyke