Hey,
im trying to make a plugin that gives certian admin flag hp when he get kills.
so how do i let he plugin know that he get a headshot kill or normal kill
Headshot , Normal kill (how to define)
-
atmax
Извън линия - Потребител
- Мнения: 492
- Регистриран на: 22 Мар 2018, 15:06
- Се отблагодари: 37 пъти
- Получена благодарност: 43 пъти
Headshot , Normal kill (how to define)
First register the function that will be called after someone dies.
Then you do this:
Код за потвърждение: Избери целия код
public plugin_init()
{
...
register_event("DeathMsg", "eventDeathMsg", "a")
}
Код за потвърждение: Избери целия код
public eventDeathMsg()
{
new iKiller = read_data(1), iVictim = read_data(2) //Here we got the Killer and Victim's Id
new iHeadshot = read_data(3) // This is for Headshot Kill
if(!is_user_connected(iKiller) || iKiller == iVictim) //This is mandatory! iKiller == iVictim with this you can check self kills/suicides
return PLUGIN_CONTINUE;
if(iHeadshot) //This is called on headshot kill
{
//do something
}
else //Thats my way to detect headshot and normal kill! :) (Thats the normal)
{
//do something
}
}
Rest in peace my friend I always will remember you!
-
BloodyPro
Извън линия - Foreigner
- Мнения: 26
- Регистриран на: 26 Юли 2020, 16:28
- Местоположение: Palestine
- Се отблагодари: 1 път
- Обратна връзка:
Headshot , Normal kill (how to define)
Thank you !!atmax написа: ↑13 Сеп 2020, 16:14 First register the function that will be called after someone dies.Then you do this:Код за потвърждение: Избери целия код
public plugin_init() { ... register_event("DeathMsg", "eventDeathMsg", "a") }
Код за потвърждение: Избери целия код
public eventDeathMsg() { new iKiller = read_data(1), iVictim = read_data(2) //Here we got the Killer and Victim's Id new iHeadshot = read_data(3) // This is for Headshot Kill if(!is_user_connected(iKiller) || iKiller == iVictim) //This is mandatory! iKiller == iVictim with this you can check self kills/suicides return PLUGIN_CONTINUE; if(iHeadshot) //This is called on headshot kill { //do something } else //Thats my way to detect headshot and normal kill! :) (Thats the normal) { //do something } }
-
- Подобни теми
- Отговори
- Преглеждания
- Последно мнение
-
- 2 Отговори
- 2115 Преглеждания
-
Последно мнение от TheRaiD
-
- 4 Отговори
- 2356 Преглеждания
-
Последно мнение от kifii
-
- 2 Отговори
- 1757 Преглеждания
-
Последно мнение от thoughtz
-
- 6 Отговори
- 1841 Преглеждания
-
Последно мнение от impossible
-
- 7 Отговори
- 2397 Преглеждания
-
Последно мнение от Siska
-
- 3 Отговори
- 2019 Преглеждания
-
Последно мнение от OciXCrom
-
- 2 Отговори
- 189 Преглеждания
-
Последно мнение от HeatoN
Кой е на линия
Потребители разглеждащи този форум: 0 регистрирани и 7 госта