ALe jest problem! Predator ma caly czas full hp, dosłownie co oberwie po chwili ma full hp

A powinno byc 15 hp na 5 sekund

Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
|
Napisano 05.02.2012 20:20
Napisano 05.02.2012 21:13
add_hp[id] = maks[1] - get_user_health(id)
add_hp[id] = 15
Napisano 05.02.2012 22:16
#include <amxmodx> #include <cstrike> #include <fun> #define PLUGIN "Terro_HP" #define VERSION "1.1" #define AUTHOR "speedkill & Nakupenda." new gracze_w_ct = 0 new maks[2], add_hp[33], max_hp[33] public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_logevent("Start", 2, "1=Round_Start") register_logevent("Koniec", 2, "1=Round_End") } public Start() { for(new i=1;i<33;i++) { if(is_user_alive(i)) { if(cs_get_user_team(i) == CS_TEAM_CT) { gracze_w_ct++ } else if(cs_get_user_team(i) == CS_TEAM_T) { set_task(2.0,"daj_hp",i) } } } } public Koniec() { gracze_w_ct = 0 } public daj_hp(id) { maks[0] = id switch(gracze_w_ct) { case 1..3: maks[1] = 300 case 4..5: maks[1] = 400 case 6..7: maks[1] = 500 case 8..9: maks[1] = 600 case 10..11: maks[1] = 700 case 12..14: maks[1] = 800 } recovery(maks) set_task(5.0, "recovery", 6, maks, 2, "b") } public recovery(maks[]) { new id = maks[0] max_hp[id] = maks[1] add_hp[id] = 15 if(cs_get_user_team(id) == CS_TEAM_CT) { add_hp[id] = 0 max_hp[id] = 100 } set_user_health(id, get_user_health(id) + add_hp[id]) }
public recovery(maks[])?? Nie powinno byc public recovery(maks[1]) czy coś?
Użytkownik Soulbane edytował ten post 05.02.2012 22:20
Napisano 05.02.2012 22:32
#include <amxmodx>
#include <cstrike>
#include <fun>
#define PLUGIN "Terro_HP"
#define VERSION "1.1"
#define AUTHOR "speedkill & Nakupenda."
new gracze_w_ct = 0
new maks[2], add_hp[33], max_hp[33]
new bool:used
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_logevent("Start", 2, "1=Round_Start")
register_logevent("Koniec", 2, "1=Round_End")
}
public Start()
{
for(new i=1;i<33;i++)
{
if(is_user_alive(i))
{
if(cs_get_user_team(i) == CS_TEAM_CT)
{
gracze_w_ct++
}
else if(cs_get_user_team(i) == CS_TEAM_T)
{
set_task(2.0,"daj_hp",i)
}
}
}
}
public Koniec()
{
gracze_w_ct = 0
}
public daj_hp(id)
{
maks[0] = id
switch(gracze_w_ct)
{
case 1..3:
maks[1] = 300
case 4..5:
maks[1] = 400
case 6..7:
maks[1] = 500
case 8..9:
maks[1] = 600
case 10..11:
maks[1] = 700
case 12..14:
maks[1] = 800
}
used = false
recovery(maks)
set_task(5.0, "recovery", 6, maks, 2, "b")
}
public recovery(maks[])
{
new id = maks[0]
max_hp[id] = maks[1]
add_hp[id] = 15
if(cs_get_user_team(id) == CS_TEAM_CT)
{
add_hp[id] = 0
max_hp[id] = 100
}
if(!used)
{
set_user_health(id, max_hp[id])
used = true
}
else if(max_hp[id] - get_user_health(id) >= add_hp[id])
set_user_health(id, get_user_health(id) + add_hp[id])
}
Użytkownik Nakupenda. edytował ten post 05.02.2012 22:38
Napisano 05.02.2012 23:20
Napisano 05.02.2012 23:25
speedkill:I za to, że pomagałeś tak jesteś w moim pliku 1'm autorem, teraz to już 89.1515252152512% kodu twoje
Użytkownik Nakupenda. edytował ten post 05.02.2012 23:25
Napisano 06.02.2012 00:32
0 użytkowników, 0 gości, 0 anonimowych