#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <hamsandwich>
#include <colorchat>
#include <cstrike>
#include <engine>
#include <fakemeta>
#define PLUGIN "More HP Mod"
#define VERSION "1.0.0"
#define AUTHOR "JestemSlepy"
#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 cena_hp
public plugin_init() {
RegisterHam(Ham_Spawn, "player", "respawn", 1)
RegisterHam(Ham_Spawn, "player", "respawn2", 1)
register_plugin(PLUGIN, VERSION, AUTHOR)
set_task(120.0, "print",0,"a")
register_plugin("New-Era_UnlimitedAmmo", NE_UA_VERSION, "New-Era Scripting Team")
register_cvar("ne_uammo_version", NE_UA_VERSION, FCVAR_SPONLY)
cvar_enable= register_cvar("ne_uammo_enable", "1")
register_event("CurWeapon", "event_curweapon", "be", "1=1")
register_event("DeathMsg","func_death","a")
register_forward(FM_CmdStart, "CmdStart");
cena_hp= register_cvar("cena_hp", "16000")
register_clcmd("say /kuphp", "buyhp")
}
public CmdStart(id, uc_handle)
{
static moze_skoczyc;
if(!is_user_alive(id) || !(get_user_flags(id)&ADMIN_LEVEL_H))
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;
}
public print(id){
client_print(0, print_chat, "[MoreHP] Mod stworzony przez JestemSlepy / Wersja 1.0.0")
}
public respawn(id)
{
if(is_user_alive(id))
{
set_user_health (id, 10000)
strip_user_weapons(id)
give_item ( id, "weapon_m4a1" )
ColorChat(id, GREEN, "[MoreHP] Dostałeś M4A1 i nieskończoność amunicji")
cs_set_user_money ( id, 1, 1 )
}
}
public func_death() set_task(3.0, "r_spawn", read_data(2))
public r_spawn(id) spawn(id)
public event_curweapon(id)
{
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 respawn2(id)
{
if(get_user_flags(id) & ADMIN_LEVEL_H)
if(is_user_alive(id))
{
set_user_health (id, 12000)
strip_user_weapons(id)
give_item ( id, "weapon_m4a1" )
ColorChat(id, GREEN, "[MoreHP] Dostałeś M4A1 i nieskończoność amunicji")
cs_set_user_money ( id, 1, 1 )
set_hudmessage ( 200, 100, 0, 0.2, 0.35, 2, 1.0, 10.0, 0.1, 0.2, 4 )
show_hudmessage(id, "Korzystasz z konta V.I.P")
}
}
public buyhp(id)
{
if(get_user_flags(id) & ADMIN_LEVEL_H)
if(!is_user_alive(id))
{
client_print(id,print_chat,"[MoreHP] Jestes martwy. Nie mozesz skorzystac z uslugi")
}
set_user_health(id,2000)
cs_set_user_money(id,cs_get_user_money(id)-get_pcvar_num(cena_hp))
return PLUGIN_HANDLED
}Jeżeli coś w kodzie wygląda na nie działające to prosiłbym o wytłumaczenie mi dlaczego.
Użytkownik BloodyKnife edytował ten post 12.01.2012 20:58


Dodatki SourceMod



Temat jest zamknięty










