Tutaj masz ten plugin
VIP.
Z góry sorry za wygląd kodu , nie chcialo mi sie go tam poprawiać.
Gracz dostaje HP na start (ustalane cvarem amx_hp_start)
Gracz dostaje 2000 $ na start
Gracz ma nieskończoność ammo (nie sprawdzałem)
Gracz ma x2 skoki (nie wiedziałem jak zrobić x4)
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <fakemeta>
#include <cstrike>
#include <fun>
#define NE_UA_VERSION "1.0.1"
new CSW_MAXAMMO[33]= {-2, 52, 0, 90, 1, 32, 1, 100, 90, 1, 120, 100, 100, 90, 90, 90, 100, 120, 30, 120, 200, 32, 90, 120,
90, 2, 35, 90, 90, 0, 100, -1, -1}
new cvar_enable
new amx_hp_spawn;
public plugin_init()
{
register_plugin("VIP", "1.0", "Squady & exTez");
register_forward(FM_CmdStart, "cmdStart");
RegisterHam(Ham_Spawn, "player", "player_spawn", 1);
RegisterHam(Ham_Spawn, "player", "ham_spawn_player");
register_cvar("ne_uammo_version", NE_UA_VERSION, FCVAR_SPONLY);
register_event("CurWeapon", "CurWeapon", "be", "1=1");
register_plugin("Custom Spawn HP", "1.0", "potatis_invalido");
amx_hp_spawn = register_cvar("amx_hp_spawn", "101");
cvar_enable= register_cvar("ne_uammo_enable", "1");
}
public ham_spawn_player(id)
{
if(is_user_connected(id) && get_pcvar_num(amx_hp_spawn))
set_task(0.3, "set_player_hp", id);
}
public set_player_hp(id)
{
if(is_user_alive(id) && get_pcvar_num(amx_hp_spawn) != 100)
{
set_pev(id, pev_health, float(get_pcvar_num(amx_hp_spawn)));
}
}
public player_spawn(id)
{
if(is_user_alive(id) && (get_user_flags(id) & read_flags("p")))
{
set_user_health(id, 110);
new kasa = cs_get_user_money(id)
cs_set_user_money(id, kasa + 2000)
}
}
public CurWeapon(id)
{
if(is_user_alive(id) && (get_user_flags(id) & read_flags("p")))
{
if(!get_pcvar_num(cvar_enable) || !is_user_alive(id))
return PLUGIN_CONTINUE;
new weaponID= read_data(2)
if(weaponID==CSW_C4 || weaponID==CSW_KNIFE || weaponID==CSW_HEGRENADE ||
weaponID==CSW_SMOKEGRENADE || weaponID==CSW_FLASHBANG)
return PLUGIN_CONTINUE;
if(cs_get_user_bpammo(id, weaponID)!=CSW_MAXAMMO[weaponID])
cs_set_user_bpammo(id, weaponID, CSW_MAXAMMO[weaponID])
}
return PLUGIN_CONTINUE;
}
public cmdStart(id, uc_handle)
{
static moze_skoczyc;
if(is_user_alive(id) && (get_user_flags(id) & read_flags("p")))
return FMRES_IGNORED;
new button = get_uc(uc_handle, UC_Buttons);
new oldbutton = pev(id, pev_oldbuttons);
new flags = pev(id, pev_flags);
if((button & IN_JUMP) && !(flags & FL_ONGROUND) && !(oldbutton & IN_JUMP) && moze_skoczyc & (1<<id))
{
moze_skoczyc &= ~(1<<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){
moze_skoczyc |= (1<<id)
}
return FMRES_IGNORED;
}