PDA

View Full Version : Plugin Winner Map !



Power.
13-08-2012, 01:22 AM
Descriere: In ultimele 10 secunde arata castigatorul harti.

Nume: Winner Map
Versiune: 1.0
Autor: defa

Download:


/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>

#define PLUGIN "Winner Map"
#define VERSION "1.0"
#define AUTHOR "defa"

new g_winner[33]

public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_forward(FM_EmitSound,"fwdEmitSound")
}
public fwdEmitSound(id,channel,const Sound[])
{
if(!equali(Sound,"vox/ten.wav"))
{
new win

win_correct(win)

new pl[32],winpl[32],i,num,winnum,wins

get_players(pl,num)
for(i=0;i<num;i++){
if(g_winner[pl[i]]==win)
winpl[winnum++]=pl[i]
}
if(winnum==1)
wins=winpl[0]

else
{
new frags,won

for(i=0;i<winnum;i++){
frags=get_user_frags(winpl[i])

if(frags>=won)
won=frags
}
new wina[32],winanum

for(i=0;i<winnum;i++)
{
if(get_user_frags(winpl[i])==won)
wina[winanum++]=winpl[i]
}
if(winanum==1)
wins=wina[0]

else
{
new dk,ds

for(i=0;i<winanum;i++){
ds=get_user_deaths(wina[i])

if(ds<=dk)
dk=ds
}
new dd[32],ddnum

for(i=0;i<winanum;i++)
{
if(get_user_deaths(wina[i])==dk)
dd[ddnum++]=wina[i]
}
dd[random_num(0,ddnum-1)]
}
}
win_msg(wins)
}
}
win_correct(&fixed)
{
new pl[32],num,i,iamwin
get_players(pl,num)

for(i=0;i<num;i++){
if(iamwin==0||g_winner[pl[i]]>g_winner[iamwin])
iamwin=pl[i]
}

fixed=g_winner[iamwin]
return iamwin
}
win_msg(id)
{
new winner_name[32],mapname[32],motd[2500]

get_user_name(id,winner_name,sizeof(winner_name)-1)
get_mapname(mapname,31)

format(motd,2500,"<div align=center><h2><b><font color=red>CSDM.******.Ro!</font></h2></b><br> <h2><b><font color=blue>Imediat v-a incepe o noua mapa !</font></h2></b><br> <h2><b><font color=orange>Cel mai veteran de pe mapa asta a fost [%s]</h2></b></font><br> <h1><b><font color=red>!!!%s!!!</h1></b></font><div>",mapname,winner_name)

show_motd(0,motd)
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1049\\ f0\\ fs16 \n\\ par }
*/


Instalare:
1. Fisierul winner_map.sma il puneti in addons/amxmodx/scripting
2. Fisierul winner_map.amxx il puneti in addons/amxmodx/plugins
3. Intrati in fisierul addons/amxmodx/configs/plugins.ini si adaugati la urma:


winner_map.amxx


Module necesare (se sterge ; din fata modulului de mai jos; acestea le gasiti in fisierul amxmodx\configs\modules.ini):
-fakemeta

~TraNda~
08-06-2017, 04:14 PM
UPDATE


/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>

#define PLUGIN "Winner Map"
#define VERSION "1.0"
#define AUTHOR "defa"

new g_winner[33]

public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_forward(FM_EmitSound,"fwdEmitSound")
}
public fwdEmitSound(id,channel,const Sound[])
{
if(!equali(Sound,"vox/ten.wav"))
{
new win

win_correct(win)

new pl[32],winpl[32],i,num,winnum,wins

get_players(pl,num)
for(i=0;i<num;i++){
if(g_winner[pl[i]]==win)
winpl[winnum++]=pl[i]
}
if(winnum==1)
wins=winpl[0]

else
{
new frags,won

for(i=0;i<winnum;i++){
frags=get_user_frags(winpl[i])

if(frags>=won)
won=frags
}
new wina[32],winanum

for(i=0;i<winnum;i++)
{
if(get_user_frags(winpl[i])==won)
wina[winanum++]=winpl[i]
}
if(winanum==1)
wins=wina[0]

else
{
new dk,ds

for(i=0;i<winanum;i++){
ds=get_user_deaths(wina[i])

if(ds<=dk)
dk=ds
}
new dd[32],ddnum

for(i=0;i<winanum;i++)
{
if(get_user_deaths(wina[i])==dk)
dd[ddnum++]=wina[i]
}
dd[random_num(0,ddnum-1)]
}
}
win_msg(wins)
}
}
win_correct(&fixed)
{
new pl[32],num,i,iamwin
get_players(pl,num)

for(i=0;i<num;i++){
if(iamwin==0||g_winner[pl[i]]>g_winner[iamwin])
iamwin=pl[i]
}

fixed=g_winner[iamwin]
return iamwin
}
win_msg(id)
{
new winner_name[32],mapname[32],motd[2500]

get_user_name(id,winner_name,sizeof(winner_name)-1)
get_mapname(mapname,31)

format(motd,2500,"<div align=center><h2><b><font color=red>CSDM.******.Ro!</font></h2></b><br> <h2><b><font color=blue>Imediat v-a incepe o noua mapa !</font></h2></b><br> <h2><b><font color=orange>Cel mai veteran de pe mapa asta a fost [%s]</h2></b></font><br> <h1><b><font color=red>!!!%s!!!</h1></b></font><div>",mapname,winner_name)

show_motd(0,motd)
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1049\\ f0\\ fs16 \n\\ par }
*/