Advertisement
Sugisaki

[AMXX] No reset Frags and deaths

Jan 29th, 2017
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.73 KB | None | 0 0
  1. #include <amxmodx>
  2.  
  3. #define PLUGIN  "New Plug-In"
  4. #define VERSION "1.0"
  5. #define AUTHOR  "Sugisaki"
  6.  
  7. new g_frag[32]
  8. new g_death[32]
  9.  
  10. public plugin_init()
  11. {
  12.     register_plugin(PLUGIN, VERSION, AUTHOR)
  13.     register_event("DeathMsg", "pfn_PlayerDeath", "a")
  14.     register_message(get_user_msgid("ScoreInfo"), "pfn_ScoreInfoHook")
  15. }
  16. public pfn_PlayerDeath()
  17. {
  18.     new v = read_data(2)
  19.     new k = read_data(1)
  20.  
  21.     if(!(1<= k <= get_maxplayers()) || v == k)
  22.     {
  23.         g_frag[v]--
  24.         g_death[v]++
  25.     }
  26.     else
  27.     {
  28.         g_frag[k]++
  29.         g_death[v]++
  30.     }
  31. }
  32. public pfn_ScoreInfoHook(m, e, id)
  33. {
  34.     //mis condiciones
  35.     set_msg_arg_int(2, get_msg_argtype(2), g_frag[get_msg_arg_int(1)])
  36.     set_msg_arg_int(3, get_msg_argtype(3), g_death[get_msg_arg_int(1)])
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement