1. sayfa (Toplam 1 sayfa)

Zp Aim Info Country Ekleme

Gönderilme zamanı: Cum Ara 31, 2021 1:03 pm
gönderen Serpentraz
Eklenti oyuncuya nişan alındığında bilgilerini gösteriyor buna hangi ülkeden olduğunu da ekleyebilir miyiz ?

Hp: xx | Lira: xx | Ülke: xx

Şu şekilde olursa güzel olur

Zp Aim Info Country Ekleme

Gönderilme zamanı: Cum Ara 31, 2021 4:30 pm
gönderen orucoglukayra
Buyur ;

Kod: Tümünü seç

#include <amxmodx>
#include <zombieplague>
#include <geoip>

#define PLUGIN "Zp Aim Info"
#define VERSION "1.0"
#define AUTHOR "@bdul!+Sn!ff3r"

new g_status_sync

public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR)
	register_event("StatusValue", "showStatus", "be", "1=2", "2!0")
	register_event("StatusValue", "hideStatus", "be", "1=1", "2=0")
    
	g_status_sync = CreateHudSyncObj()
}

public showStatus(id)
{
	if(!is_user_bot(id) && is_user_connected(id)) 
	{
		new name[32], pid = read_data(2)
    
		get_user_name(pid, name, 31)
		new color1 = 0, color2 = 0, color3 = 0
    
		new team1 = zp_get_user_zombie(id), team2 = zp_get_user_zombie(pid)

		static Country[45]; static IP[16];
		get_user_ip(id, IP, charsmax(IP), 1);
		geoip_country_ex(IP, Country, charsmax(Country));

		if(containi(Country, "Turkey") != -1)
		{
			formatex(Country, charsmax(Country), "Turkiye");
		}
    
		if (team2 == 1)
			color1 = 255, color2 = 000, color3 = 000
			
		else
			color1 = 000, color2 = 255, color3 = 255
                
		if (team1 == team2)    // friend
		{
			set_hudmessage(color1, color2, color3, -1.0, 0.60, 1, _, 7.0, _, _, -1)
			ShowSyncHudMsg(id, g_status_sync,"%s^n[Hp: %d | Lira: %d | Ulke: %s]", name, get_user_health(pid), zp_get_user_ammo_packs(pid), Country);
		}
	}
}

public hideStatus(id)
{
	ClearSyncHud(id, g_status_sync)
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ ansicpg1252\\ deff0\\ deflang1033{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ f0\\ fs16 \n\\ par }
*/