N?K
C O N T R A
- 23/7/03
- 1,814
- 24
uh thì quên :)PHP:public even_deathmsg() { new killer, victim, headshot killer = read_data(1) victim = read_data(2) headshot = read_data(3) read_data(4, weapon, charsmax(weapon)) // Biến weapon đã khai báo chưa????????
PHP:
public even_deathmsg()
{
new killer, victim, headshot, weapon[32], wpnid
killer = read_data(1)
victim = read_data(2)
headshot = read_data(3)
read_data(4, weapon, charsmax(weapon))
---------- Post added at 10:29 ---------- Previous post was at 10:06 ----------
Ok nếu không còn gì sai sót thì túm lại code cuối cùng sẽ thế này
PHP:
#define IsPlayer(%1) (1<= %1 <= g_iMaxPlayers)
new g_iMaxPlayers;
public plugin_init()
{
g_iMaxPlayers = get_maxplayers();
}
public even_deathmsg()
{
new killer, victim, headshot, weapon[32], wpnid
killer = read_data(1)
victim = read_data(2)
headshot = read_data(3)
read_data(4, weapon, charsmax(weapon))
if (equali(weapon, "grenade"))
format(weapon, charsmax(weapon), "hegrenade")
format(weapon, charsmax(weapon), "weapon_%s", weapon)
wpnid = get_weaponid(weapon)
if (victim == killer || !IsPlayer(killer) || !IsPlayer(victim))
{
return;
}
if (headshot && wpnid)
{
client_print(killer, print_chat, "HEADSHOT")
}
else if (wpnid == CSW_KNIFE)
{
client_print(killer, print_chat, "KNIFE")
}
else if (wpnid == CSW_HEGRENADE)
{
client_print(killer, print_chat, "HEGRENADE")
}
else if (!headshot && wpnid)
{
client_print(killer, print_chat, "NORMAL KILL")
}
}

. string chứ có phải int hay float đâu mà return
:soldier_baby14:


bạn trẻ suy nghĩ đơn giản quá