WItam serdecznie,
Otóż prosiłbym o modyfikacje poniższej klasy w ten sposób aby mogła się ona tylko raz w rundzie odrodzić.
Z góry dziękuje i daje +
#include <amxmodx>
#include <amxmisc>
#include <codmod>
#include <engine>
#include <hamsandwich>
#include <fun>
#include <cstrike>
#include <fakemeta>
#define ZADANIE_WSKRZES 6240
#define TASK_WYSZKOLENIE_SANITARNE 736
new const maxClip[31] = { -1, 13, -1, 10,  1,  7,  1,  30, 30,  1,  30,  20,  25, 30, 35, 25,  12,  20, 
10,  30, 100,  8, 30,  30, 20,  2,  7, 30, 30, -1,  50 };
        
new const nazwa[]   = "Bruce Lee";
new const opis[]    = "Dostaje full magazynek za fraga, regeneruje mu sie utracone hp";
new const bronie    = (1<<CSW_HEGRENADE)|(1<<CSW_P90)|(1<<CSW_FLASHBANG)|(1<<CSW_DEAGLE);
new const zdrowie   = 20;
new const kondycja  = 25;
new const inteligencja = 0;
new const wytrzymalosc = 0;
new bool:ma_klase[33];
    
public plugin_init()
{
	register_plugin(nazwa, "1.0", "FA1M");
	cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc);
	register_event("DeathMsg", "DeathMsg", "ade");
	RegisterHam(Ham_Killed, "player", "Killed", 1);
}
public cod_class_enabled(id)
{
	ma_klase[id] = true;
	umiejetnosc_uzyta[id] = false;
	give_item(id, "weapon_hegrenade");
	give_item(id, "weapon_flashbang");
	give_item(id, "weapon_flashbang");
	set_task(1.0, "WyszkolenieSanitarne", id+TASK_WYSZKOLENIE_SANITARNE); /// w Miejsce X wpisz czas
	ma_klase[id] = true;
	
	return COD_CONTINUE;
}
public cod_class_disabled(id)
	ma_klase[id] = false;
	
	
public DeathMsg()
{
        new killer = read_data(1);
        
        if(!is_user_connected(killer))
                return PLUGIN_CONTINUE;
        
        if(ma_klase[killer])
        {
                new cur_health = pev(killer, pev_health);
                new Float:max_health = 100.0+cod_get_user_health(killer);
                new Float:new_health = cur_health+20.0<max_health? cur_health+20.0: max_health;
                set_pev(killer, pev_health, new_health);
                
                new weapon = get_user_weapon(killer);
                if(maxClip[weapon] != -1)
                        set_user_clip(killer, maxClip[weapon]);
        }
        
        
        return PLUGIN_CONTINUE;
}
stock set_user_clip(id, ammo)
{
        new weaponname[32], weaponid = -1, weapon = get_user_weapon(id, _, _);
        get_weaponname(weapon, weaponname, 31);
        while ((weaponid = engfunc(EngFunc_FindEntityByString, weaponid, "classname", weaponname)) != 0)
                if (pev(weaponid, pev_owner) == id) {
                set_pdata_int(weaponid, 51, ammo, 4);
                return weaponid;
        }
        return 0;
}
public WyszkolenieSanitarne(id)
{
id -= TASK_WYSZKOLENIE_SANITARNE;
if(!is_user_connected(id))
return PLUGIN_CONTINUE;
if(ma_klase[id])
{
set_task(1.0, "WyszkolenieSanitarne", id+TASK_WYSZKOLENIE_SANITARNE); /// w miejsce X wpisz czas
if(is_user_alive(id))
{
new cur_health = get_user_health(id);
new max_health = 100+cod_get_user_health(id);
new new_health = cur_health+1<max_health? cur_health+1: max_health; // w miejsce Z wpisz ilosc HP
set_user_health(id, new_health);
}
}
return PLUGIN_CONTINUE;
}  
public Killed(id)
{
    if(ma_klase[id])
        set_task(0.1, "Wskrzes", id+ZADANIE_WSKRZES);
   
}
public Wskrzes(id)
    ExecuteHamB(Ham_CS_RoundRespawn, id-ZADANIE_WSKRZES);
    


 Forum
 
Forum
 Użytkownicy
 
Użytkownicy
 Kalendarz
 
Kalendarz
 Dodatki SourceMod
 
Dodatki SourceMod



 
	 Temat jest zamknięty
 Temat jest zamknięty![[KOSZ] proszę o modyfikacje klasy Bruce Lee: post #1](https://amxx.pl/public/style_images/tctc91_luminous/icon_share.png) 
					

 
				
				 
				
				








 
  
		
 
		 
		 
		