1. sayfa (Toplam 3 sayfa)

Reapi Armor Görunmuyor

Gönderilme zamanı: Cmt Ağu 04, 2018 7:05 pm
gönderen ShooTeR
gençler reapiciler bi bakarsa...

Kod: Tümünü seç

#include <amxmodx>
#include <zombieplague>
#include <reapi>

public plugin_init() {
	register_plugin("ZP: Show Victim HP On Damage", "1.0", "<VeCo>")
	//register_event("Damage", "event_damage", "b", "2!0", "3=0", "4!0")	
	//RegisterHam(Ham_TakeDamage, "player", "armortest", 0);
	RegisterHookChain(RG_CBasePlayer_TakeDamage,"armortest", .post=true);
}


public event_damage(id)
{
	static attacker; attacker = get_user_attacker(id)
	static hp; hp = get_user_health(id)
	
	new name[33]
	get_user_name(id,name,32)
	if(zp_get_user_zombie(id))
	{
		client_print(attacker,print_center,"HP: %i",hp)
	}
	else if(!zp_get_user_zombie(id) && get_user_armor(id) > 0)
	{
		client_print(attacker,print_center,"%s AP: %i",name ,armor)
	}
	else 
	{
		client_print(attacker,print_center,"%s HP: %i",name ,hp)
	}
}
söyle bi eklenti var elimdede humana vurunca armor gorunmuyo armor bitincede hp vs. armor hariç digerleri gorunuyo ama bi bakiverin yav cıldırcam :D register_event bağladım gene aynı ama niyeyse registerham bağlayınca armorda gorunuyo kafa yandı.

Reapi Armor Görunmuyor

Gönderilme zamanı: Cmt Ağu 04, 2018 7:11 pm
gönderen PaZee

Kod: Tümünü seç

#include <amxmodx>
#include <zombieplague>
#include <reapi>

public plugin_init() {
	register_plugin("ZP: Show Victim HP On Damage", "1.0", "<VeCo>")
	//register_event("Damage", "event_damage", "b", "2!0", "3=0", "4!0")	
	
	RegisterHookChain(RG_CBasePlayer_TakeDamage,"event_damage", .post=true);
	
}


public event_damage(id, inflictorEntIndex, attacker, Float:damage, damageType) {

	static hp; hp = get_entvar(id, var_health)
	static armor; armor = get_entvar(id, var_armorvalue)
	new name[33]
	get_user_name(id,name,32)
	if(zp_get_user_zombie(id))
	{
		client_print(attacker,print_center,"HP: %i",hp)
	}
	else if(!zp_get_user_zombie(id) && armor > 0)
	{
		client_print(attacker,print_center,"%s AP: %i",name ,armor)
	}
	else 
	{
		client_print(attacker,print_center,"%s HP: %i",name ,hp)
	}
}

Reapi Armor Görunmuyor

Gönderilme zamanı: Cmt Ağu 04, 2018 7:14 pm
gönderen ShooTeR
PaZee yazdı: Cmt Ağu 04, 2018 7:11 pm

Kod: Tümünü seç

#include <amxmodx>
#include <zombieplague>
#include <reapi>

public plugin_init() {
	register_plugin("ZP: Show Victim HP On Damage", "1.0", "<VeCo>")
	//register_event("Damage", "event_damage", "b", "2!0", "3=0", "4!0")	
	
	RegisterHookChain(RG_CBasePlayer_TakeDamage,"event_damage", .post=true);
	
}


public event_damage(id, inflictorEntIndex, attacker, Float:damage, damageType) {

	static hp; hp = get_entvar(id, var_health)
	static armor; armor = get_entvar(id, var_armorvalue)
	new name[33]
	get_user_name(id,name,32)
	if(zp_get_user_zombie(id))
	{
		client_print(attacker,print_center,"HP: %i",hp)
	}
	else if(!zp_get_user_zombie(id) && armor > 0)
	{
		client_print(attacker,print_center,"%s AP: %i",name ,armor)
	}
	else 
	{
		client_print(attacker,print_center,"%s HP: %i",name ,hp)
	}
}
hala aynı kerim hatta armor bitince hp değeri 123489125 sayılarında oluyo

Reapi Armor Görunmuyor

Gönderilme zamanı: Cmt Ağu 04, 2018 7:14 pm
gönderen ShooTeR
armor gorunmuyo yani hala.

Reapi Armor Görunmuyor

Gönderilme zamanı: Cmt Ağu 04, 2018 7:32 pm
gönderen PaZee

Kod: Tümünü seç

#include <amxmodx>
#include <zombieplague>
#include <reapi>

public plugin_init() {
	register_plugin("ZP: Show Victim HP On Damage", "1.0", "<VeCo>")
	//register_event("Damage", "event_damage", "b", "2!0", "3=0", "4!0")	
	
	RegisterHookChain(RG_CBasePlayer_TakeDamage,"event_damage", .post=true);
	
}


public event_damage(id, inflictorEntIndex, attacker, Float:damage, damageType) {

	static Float:hp; hp = get_entvar(id, var_health)
	static Float:armor; armor = get_entvar(id, var_armorvalue)
	new name[33]
	get_user_name(id,name,32)
	if(zp_get_user_zombie(id))
	{
		client_print(attacker,print_center,"HP: %i",floatround(hp))
	}
	else
	{
		client_print(attacker,print_center,"%s HP: %i AP: %i",name,floatround(hp),floatround(armor))
	}
}

Reapi Armor Görunmuyor

Gönderilme zamanı: Cmt Ağu 04, 2018 7:37 pm
gönderen ShooTeR
hala aynı armor olunca gorunmuyor

Reapi Armor Görunmuyor

Gönderilme zamanı: Cmt Ağu 04, 2018 7:39 pm
gönderen Colditz
Buyur;

Kod: Tümünü seç

#include <amxmodx>
#include <zombieplague>
#include <reapi>

public plugin_init() {
	register_plugin("ZP: Show Victim HP On Damage", "1.0", "<VeCo>");

	RegisterHookChain(RG_CBasePlayer_TakeDamage,"event_damage", .post=true);
}


public event_damage(const victim, weapon, attacker, Float:damage, type)
{
	static name[32], health, armor;
	health = get_user_health(victim);
	armor = get_user_armor(victim);
	get_user_name(victim,name,charsmax(name));

	if(zp_get_user_zombie(victim))
	{
		static const text[] = "HP: %d";
		client_print(attacker,print_center,text,health);
	}
	else if(!zp_get_user_zombie(victim) && armor > 0)
	{
		static const text2[] = "%s AP: %d";
		client_print(attacker,print_center,text2,name ,armor)
	}
	else 
	{
		static const text3[] = "%s HP+: %d";
		client_print(attacker,print_center,text3,name ,health)
	}
}

Reapi Armor Görunmuyor

Gönderilme zamanı: Cmt Ağu 04, 2018 7:42 pm
gönderen PaZee
@Colditz reapi sormuş arkadaş bu arada consta ne gerek var ?
hazir el atmışken tamamen reapi çevirmek varken :D

Reapi Armor Görunmuyor

Gönderilme zamanı: Cmt Ağu 04, 2018 7:45 pm
gönderen Colditz
PaZee yazdı: Cmt Ağu 04, 2018 7:42 pm @Colditz reapi sormuş arkadaş bu arada consta ne gerek var ?
hazir el atmışken tamamen reapi çevirmek varken :D
Reapi'nin amacı diğer kütüphanedeki komutların yerine geçmek değildir. En azından bu komut amxmodx kütüphanesi için geçerli.
Bildiğim üzere; get_user_health ve get_user_armor komutu set_entvar ile canını kontrol etmekten daha hızlı çalışır. Bunun için Reapi kullanmaya gerek bile yok. "register_event" ile de hızlı çalışacaktır. Boş yere reapi kullanılmamalı.

Kod: Tümünü seç


//#include <reapi>

register_event("Damage", "event_damage", "b", "2!0", "3=0", "4!0");

Reapi Armor Görunmuyor

Gönderilme zamanı: Cmt Ağu 04, 2018 7:48 pm
gönderen Natre
@Colditz hocam senin bu bilgine hayran kaldım doğrusu keşke bende bu kadar bilgili olabilsem.