Инфо из amxmodx.inc:
/* If player is not attacked function returns 0, in other
* case returns index of attacking player. On second and third
* parameter you may get info about weapon and body hit place.
* As of 1.75, get_user_attacker can return a non-player index if the player was attacked by a non-player entity.
*/
native get_user_attacker(index,...);
Синтаксис:
get_user_attacker(index,weapon,bodypart)
- index - id жертвы
- weapon - переменная для записи id оружия
- bodypart - переменная для записи id части тела куда был нанесен урон.
Тип функции:
Native
Пример:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "[http://amxxmodx.ru] Sockets for CS"
#define VERSION "1.0"
#define AUTHOR "Admin"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("Damage", "fwd_damage", "b", "2!0")
}
public fwd_damage(id){
new weapon, bodypart, attacker = get_user_attacker(id,weapon,bodypart)
new name[32]
get_user_name(attacker,name,charsmax(name))
client_print(0,print_chat,"Attaker[%s][%d][%d]",name,weapon,bodypart)
}
Описание:
При нанесении повреждений будет выводиться информация о атакующем.