Jump to content
Sign in to follow this  
totopizza

[N-PLUGIN] Mostrar al mejor player

Recommended Posts

Nombre del plugin: Player PRo

Author: Metrikcz

Descripcíon: Con este plugin, podremos saber quien es el mejor jugador, el que tiene mas frags mediantes un Mensaje HUD

Imágenes: No hay..

Fuente: Player PRo

Código:

#include <amxmodx>
#include <hamsandwich>

#define PLUGIN "Player PRo"
#define VERSION "1.1"
#define AUTHOR "Metrikcz"

new g_maxplayers, g_player_proname[32]
public plugin_init() {
   register_plugin(PLUGIN, VERSION, AUTHOR)
   RegisterHam(Ham_Killed, "player", "reload_playerpro", 1)
   g_maxplayers = get_maxplayers()
   set_task(1.0, "show_playerpro", _, _, _, "b")
}
public show_playerpro() {
   set_hudmessage(0, 255, 255, 0.80, 0.11, 1, 1.0, 1.0)
   show_hudmessage(0, "Jugador en cabeza: %s", g_player_proname)
}
public reload_playerpro() {
   new sort[33][2], count
   for(new id = 1; id <= g_maxplayers; id++) {
       if(is_user_connected(id)) {
           sort[count][0] = id
           sort[count][1] = get_user_frags(id)
           count++
       }
   }
   SortCustom2D(sort, count, "sort_player_frags")
   get_user_name(sort[0][0], g_player_proname, charsmax(g_player_proname))
}
public sort_player_frags(pl1[], pl2[]) {
   if(pl1[1] > pl2[1]) 
       return -1;

   else if(pl1[1] < pl2[1]) 
       return 1;

   return 0;
} 

Share this post


Link to post
Share on other sites

Guest
This topic is now closed to further replies.
Sign in to follow this  

×
×
  • Create New...