Advertisement
Guest User

Untitled

a guest
Sep 6th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. #include < amxmodx >
  2. #include < amxmisc >
  3.  
  4. #define PLUGIN "Killed by"
  5. #define VERSION "1.0"
  6. #define AUTHOR "LondoN eXtream"
  7.  
  8. #define CHAT_TAG "^x04[CSO Furien]"
  9.  
  10. new g_msgSayText;
  11.  
  12. public plugin_init()
  13. {
  14. register_plugin(PLUGIN, VERSION, AUTHOR);
  15. register_event("DeathMsg", "EventWeaponKill", "a");
  16. g_msgSayText = get_user_msgid("SayText");
  17. }
  18.  
  19. public EventWeaponKill()
  20. {
  21. new Attacker = read_data(1), Victim = read_data(2), HS = read_data(3);
  22.  
  23. if(!Attacker || Attacker == Victim)
  24. return;
  25.  
  26. new Name[32], WeaponName[32];
  27. get_user_name(Attacker, Name, charsmax(Name));
  28. get_weapon_name(Attacker, WeaponName, charsmax(WeaponName));
  29. print_color(Victim, "^x01Ai fost omorat de^x03 %s^x01 cu^x04 %s^x01 (^x03 %s^x01 )", Name, WeaponName, HS ? "HEAD - SHOOT" : "");
  30. }
  31.  
  32. stock get_weapon_name(Player, WeaponName[], Len)
  33. {
  34. get_weaponname(get_user_weapon(Player), WeaponName, Len);
  35. replace(WeaponName, Len, "weapon_", "");
  36. ucfirst(WeaponName);
  37. }
  38.  
  39. stock print_color(const id, const input[], any:...) {
  40. new count = 1, players[32];
  41. static msg[191];
  42. vformat(msg, 190, input, 3);
  43.  
  44. new final[191];
  45. formatex(final, charsmax(final), "%s %s", CHAT_TAG, msg);
  46.  
  47. if(id) players[0] = id;
  48. else get_players(players, count, "ch"); {
  49. for(new i = 0; i < count; i++) {
  50. if(is_user_connected(players[i])) {
  51. message_begin(MSG_ONE_UNRELIABLE, g_msgSayText, _, players[i]);
  52. write_byte(players[i]);
  53. write_string(final);
  54. message_end();
  55. }
  56. }
  57. }
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement