•  
     

Top Round - AMXX

Mostra o melhor jogador do Round

Testado em AMXX 1.8.3

topround-kills-hs.jpg

topround.jpg


Código: Selecionar todos

#include <amxmodx>
new topround; 
new kills[33];
new hs[33];
public plugin_init(){
register_plugin("Top Round","1.0","Anderson"); 
topround=CreateHudSyncObj();
register_event("HLTV","OnHltv","a","1=0","2=0");
register_event("DeathMsg","OnDeathMsg","a");
register_event("DeathMsg","OnRoundEnd","a");
register_logevent("toproundend",2,"1=Round_End");
}
public client_disconnect(id){
kills[id] = hs[id] = 0;
}   
public OnHltv(){
arrayset(kills,0,32);
arrayset(hs,0,32);
}
public OnDeathMsg(){
new id = read_data(1);
if (!is_user_connected(id))
return;    
kills[id]++;
if (read_data(3))
hs[id]++;
}
public OnRoundEnd(){
new players[32],num;
get_players(players,num);
if(!num){
return;
}
new best = players[0];
for(new i = 1,id;i < num;i++){
id = players[i];
if(kills[id] > kills[best] || (kills[id] == kills[best] && hs[id] > hs[best]))
best = id;
}
if(kills[best] >= 1){
new name[32];
get_user_name(best,name,31);  
set_hudmessage(random(256),random(256),random(256),0.01,0.34,0,6.0,50.0); 
ShowSyncHudMsg(0,topround, "Top Round: %s - Kills: %i  HS: %i", name,kills[best],hs[best]);
}
}
public toproundend(){
new players[32],num;
get_players(players,num);
if(!num){
return;
}
new best = players[0];
for (new i = 1,id;i < num;i++){
id = players[i];
if (kills[id] > kills[best] || (kills[id] == kills[best] && hs[id] > hs[best]))
best = id;
}  
if (kills[best] >= 2){
new name[32];
get_user_name(best,name,31);  
set_hudmessage(255,0,0,-1.0,-0.52,1,6.0,5.0);
show_hudmessage(0,"(%d)^n--0--[%d]--0--^n[0]^n0 0^n_/  \_",kills[best],hs[best]);
set_hudmessage(255,0,0,-1.0,-0.50,1,6.0,5.0);
ShowSyncHudMsg(0,topround,"Top Round: %s",name);
}
}
 
eu vi la no server ficou muito bom parabéns !!