Simple Rank + Top15

In jos

descarca Simple Rank + Top15

Mesaj Scris de DarkArms la data de Dum Noi 13, 2016 6:42 pm

Descriere: Este un simplu top15 + rank care l-am creat pentru fostul meu server de zombie. Nu provoaca lag.

Descarcare:
Spoiler:
#include < amxmodx >
#include < csx >
#include < new_release >

enum {
INT_STATS_KILLS = 0,
INT_STATS_DEATHS
};

public plugin_init ( )
{
register_plugin ( "ZP PRO STATS", "1.0", "LondoN eXtream" );

register_clcmd ( "say", "CMD_ClientHook" );
register_clcmd ( "say_team", "CMD_ClientHook" );
}

public CMD_ClientHook ( id )
{
new CMD [ 11 ];
read_argv ( 1, CMD, charsmax ( CMD ) );

if ( equali ( CMD, "top", 3 ) || equali ( CMD, "/top", 4 ) )
{
new HANDLE_MENU = menu_create ( "\rTOP \w15", "FUNC_MENU_HANDLER" );

new szName [ 32 ], szStats [ 8 ], Body [ 8 ], Temp [ 4096 ], TempNum [ 4 ];
new Num = get_ststsnum ( );
new i, INT;

if ( Num < 360 )
INT = Num;
else
INT = 360;

for ( i = 0; i < INT; i++ )
{
get_stats ( i, szStats, Body, szName, charsmax ( szName ) );
num_to_str ( i + 1, TempNum, charsmax ( TempNum ) );

static Kills [ 16 ], Deaths [ 16 ];
AddCommas ( szStats [ INT_STATS_KILLS ], Kills, charsmax ( Kills ) );
AddCommas ( szStats [ INT_STATS_DEATHS ], Deaths, charsmax ( Deaths ) );

formatex ( Temp, charsmax ( Temp ), "\w(Rank: \r%d\w) %s (\r%s Kills\w) (\r%s \wDeaths\w)", i + 1, szName, Kills, Deaths );

menu_additem ( HANDLE_MENU, Temp );
}

menu_setprop ( HANDLE_MENU, MPROP_EXIT, MEXIT_ALL );
menu_display ( id, HANDLE_MENU, 0 );
}

else if ( equali ( CMD, "rank" ) || equali ( CMD, "/rank" ) )
{
new szStats [ 8 ], Body [ 8 ], Name [ 32 ];
new g_pos = get_user_stats ( id, szStats, Body );
get_user_name ( id, Name, charsmax ( Name ) );

static Me [ 16 ], Max [ 16 ], Kiils [ 16 ], Deaths [ 16 ];
AddCommas ( g_pos, Me, charsmax ( Me ) );
AddCommas ( g_statsnum, Max, charsmax ( Max ) );
AddCommas ( szStats [ INT_STATS_DEATHS ], Deaths, charsmax ( Deaths ) );
AddCommas ( szStats [ INT_STATS_KILLS ], Kills, charsmax ( Kills ) );

zp_colored_print ( 0, "Player^x04 %s's^x01 rank is^x04 %s/%s^x01 with^x04 %s^x01 Kills and^x04 %s^x01 Deaths", szName, Me, Max, Kills, Deaths );
}

return PLUGIN_CONTINUE;
}

public FUNC_MENU_HANDLER ( id, HANDLE_MENU, item )
{
menu_destroy ( HANDLE_MENU );
return PLUGIN_HANDLED;
}

Spoiler:
/*
ZOMBIE OUTSTANDING v6.5 RELEASE
Include File
*/
#if defined _new_release_included
#endinput
#endif


/*
Forward: zp_round_ended ( WINTEAM=0 )

Called when ZP Round is ended.
This forward need loop for getting player ID.
*/
forward zp_round_ended()

/*
Native: zp_get_user_zombie ( const id )

Returns true if the user is zombie otherwise
return false.

Example:

if ( zp_get_user_zombie ( Player ) )
continue;
*/
native zp_get_user_zombie ( id );

/*
STOCK: zp_colored_print ( const id, const msg[], any:... )

@id - Player index
@msg - Message to be send
@any:... - Other variables / Strings who will be displayed

Example:

if ( is_user_alive ( id ) )
{
zp_colored_print ( 0, "^x04[ZP]^x01 Player^x04 %d^x01 is alive", id );
}

This stock send a colored message to specifed user in chat.
*/
zp_colored_print(target, const message[], any:...)
{
static buffer[512], i, argscount
argscount = numargs()

static g_msgSayText;

if(!g_msgSayText)
g_msgSayText = get_user_msgid("SayText");

if (!target)
{
static player
for (player = 1; player <= get_maxplayers(); player++)
{
if (!is_user_connected(player))
continue;

static changed[5], changedcount
changedcount = 0

for (i = 2; i < argscount; i++)
{
if (getarg(i) == LANG_PLAYER)
{
setarg(i, 0, player)
changed[changedcount] = i
changedcount++
}
}

vformat(buffer, charsmax(buffer), message, 3)

message_begin(MSG_ONE_UNRELIABLE, g_msgSayText, _, player)
write_byte(player)
write_string(buffer)
message_end()

for (i = 0; i < changedcount; i++)
setarg(changed[i], 0, LANG_PLAYER)
}
}
else
{
vformat(buffer, charsmax(buffer), message, 3)

message_begin(MSG_ONE, g_msgSayText, _, target)
write_byte(target)
write_string(buffer)
message_end()
}
}

Nume: Simple Rank & Top
Versiune: 1.0
Autor: LondoN eXtream

Instalare: Fisiserul inc in scripting/unclude, .sma in scripting si .amxx in plugins.Adaugati in plugins.ini:
Cod:
SimpleRankTop15.amxx

Nu exista CVAR-uri, Comenzi publice sau administrative.
Trebuie sa aveti modulul csx activ.

DarkArms
Founders
Founders

Mesaje : 226
Data de inscriere : 23/09/2016
Varsta : 16
Localizare : Terra

http://lowgamers.forumgratuit.ro

Sus In jos

descarca Re: Simple Rank + Top15

Mesaj Scris de Dracu la data de Dum Noi 13, 2016 9:29 pm

Good Job!
avatar
Dracu
Moderators
Moderators

Mesaje : 193
Data de inscriere : 11/11/2016

Sus In jos

descarca Re: Simple Rank + Top15

Mesaj Scris de Tipu la data de Mier Noi 23, 2016 1:31 pm

Good Job!
avatar
Tipu
Administrators
Administrators

Mesaje : 151
Data de inscriere : 22/11/2016

Sus In jos

descarca Re: Simple Rank + Top15

Mesaj Scris de CelRau la data de Dum Noi 27, 2016 7:50 pm

Good Job!
avatar
CelRau
Registered user
Registered user

Mesaje : 184
Data de inscriere : 26/11/2016

Sus In jos

descarca Re: Simple Rank + Top15

Mesaj Scris de Continut sponsorizat


Continut sponsorizat


Sus In jos

Sus


 
Permisiunile acestui forum:
Nu puteti raspunde la subiectele acestui forum