Witamy w Nieoficjalnym polskim support'cie AMX Mod X
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.
|
HP za HS
#1
Napisano 03.09.2011 18:40
www.BartoIT.pl
- klikasz to, a dzięki temu rozwijam ten profil
Odwiedź strefę pobierania i pobierz wersję testową alfa Counter Strike: Global terror MOD
#2
Napisano 03.09.2011 19:02
#include <amxmodx>
#include <amxmisc>
#include <fun>
public plugin_init(){
register_plugin("HS Healer","1.0","naven")
register_event("DeathMsg", "DeathMsg", "a")
register_cvar("hshealer_hp", "20")
}
public DeathMsg()
{
new hs = read_data(3) // HeadShot (1 == true)
new kid = read_data(1) //zabojca
new hptoadd = get_cvar_num("hshealer_hp")
if(is_user_alive(kid))
{
if (hs > 0)
{
if(get_user_health(kid) + hptoadd > 100)
set_user_health(kid, 100)
client_print(kid, print_chat, "Dostales +%iHP za headshota", hptoadd)
set_user_health(kid , min (get_user_health(kid) + hptoadd))
}
}
}
Cvar: hshealer_hp <ilość hp> (np. hs_healer 33 dodaje 33 HP po headshocie)
Użytkownik Squady edytował ten post 03.09.2011 19:06
To co piszę się nie liczy...
#3
Napisano 03.09.2011 19:02
#include <amxmodx>
#include <cstrike>
#include <fun>
#define PLUGIN "HP za HS"
#define VERSION "1.0"
#define AUTHOR "Syczaj"
#define hpzahs 10
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR);
}
public client_damage( attacker, victim, damage, wpnindex, hitplace, TA ){
if(hitplace == HIT_HEAD){
new zycie = get_user_health(attacker);
set_user_health (attacker, zycie + hpzahs);
}
}
może tak zadziała?
Dopiero sie ucze i byłbym wdzięczny za wiadomość, czy plugin jest w miare poprawny i jak nie zadziała to dlaczego.
Użytkownik Syczaj edytował ten post 03.09.2011 19:13
#4
Napisano 04.09.2011 12:23
Syczaj - Twój się skompilował i działa , ale jedna wada - za każde trafienie w głowe dostaje bonus HP , a nie za zabicie HS
www.BartoIT.pl
- klikasz to, a dzięki temu rozwijam ten profil
Odwiedź strefę pobierania i pobierz wersję testową alfa Counter Strike: Global terror MOD
#6
Napisano 04.09.2011 12:42
amx_vip_hp - ile hp za normalne zabósjtwo
amx_vip_hp_hs - ile za heada
amx_vip_max_hp - ile max
Cvary z vipa dlatego taka nazwa ale zmieniłem ze działa dla każdego ;]
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <fun>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "Administrator"
new health_add
new health_hs_add
new health_max
new nKiller
new nKiller_hp
new nHp_add
new nHp_max
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
health_add = register_cvar("amx_vip_hp", "10")
health_hs_add = register_cvar("amx_vip_hp_hs", "25")
health_max = register_cvar("amx_vip_max_hp", "100")
register_event("DeathMsg", "hook_death", "a", "1>0")
}
public hook_death()
{
nKiller = read_data(1)
if ( (read_data(3) == 1) && (read_data(5) == 0) )
{
nHp_add = get_pcvar_num (health_hs_add)
}
else
nHp_add = get_pcvar_num (health_add)
nHp_max = get_pcvar_num (health_max)
nKiller_hp = get_user_health(nKiller)
nKiller_hp += nHp_add
if (nKiller_hp > nHp_max) nKiller_hp = nHp_max
set_user_health(nKiller, nKiller_hp)
}
If you can dream it, you can do it.
#7
Napisano 04.09.2011 12:50
www.BartoIT.pl
- klikasz to, a dzięki temu rozwijam ten profil
Odwiedź strefę pobierania i pobierz wersję testową alfa Counter Strike: Global terror MOD
Użytkownicy przeglądający ten temat: 0
0 użytkowników, 0 gości, 0 anonimowych


Dodatki SourceMod



Temat jest zamknięty









