Jump to content
  • IceGame # Spatiu Publicitar

Server's Map information


Barlap

Recommended Posts


Server's Map Information

by
Ulquiorra

 

 
Am vazut pe un server, un plugin care arata toate hartile care erau pe server ( in folderul maps ) in motd.
Arata informatii de genu: NumeHarta, Spawn-uri Harta, Imagine thumbnail.
 
In secunda urmatoare mi-a venit ideea.
 
Acest plugin iti arata in motd toate informatiile necesare despre hartile serverului.
 
Informatii despre Harta [Curenta & Urmatoare]
-Numele hartii curente, Timpul jucat.
-Numele hartii urmatoare, timp ramas din harta curenta ( timeleft ).
 
In cazul in care cvarul "amx_nextmap" este gol ( "" , adica nu are nicio valoare ), imagine thumbnail va fi una diferita (
This is the hidden content, please
)
 
Informatii despre ultimele 10 harti jucate.
-Numele fiecarei hari + imagine thumbnail pentru preview.
-Cat timp a fost jucata.
-Recordul jucatorilor pe harta respectiva ( ex: 15/32 ).
-Acum cat timp a fost jucata ( e cam inutila acesta statistica, dar am adaugato ca sa am toace cele 4 colturi ocupare[ vezi preview ] ).
 
Gasiti un Preview in josul paginii la Imagini.
 
This is the hidden content, please
This is the hidden content, please
 

#include
#include
 
#pragma semicolon 1
 
 
#define PLUGIN "Server's Map Information"
#define VERSION "1.1.1"
 
#define iMapsToSave 10
 
new g_szFile[ 64 ];
 
new g_szMapsName[ iMapsToSave ][ 32 ];
new g_iMapPlayersRec[ iMapsToSave ];
new g_iMapPlayedTime[ iMapsToSave ];
new g_iMapSysTime[ iMapsToSave ];
 
 
new g_iMapsNum = 0;
new g_iMaxPlayers;
 
new g_iPlayers = 0;
new g_iPlayersRecord = 0;
 
new g_iCvarUrl;
new g_szMapName[ 32 ];
public plugin_init( )
{
 
register_plugin( PLUGIN, VERSION, "Ulquiorra" );
register_cvar( "smi_version", VERSION, FCVAR_SERVER | FCVAR_SPONLY ); 
 
register_clcmd( "say /maps", "cmd_MapsInfo" );
register_clcmd( "say /mapsinfo", "cmd_MapsInfo" );
register_clcmd( "say /minfo", "cmd_MapsInfo" );
register_clcmd( "say /mi", "cmd_MapsInfo" );
register_clcmd( "say /lastmaps", "cmd_MapsInfo" );
 
g_iCvarUrl = register_cvar( "smi_script_url", "
This is the hidden content, please
);
 
get_localinfo( "amxx_configsdir", g_szFile, charsmax( g_szFile ) );
add( g_szFile, charsmax( g_szFile ), "/LastPlayedMaps.txt" );
 
for( new i = 0; i < iMapsToSave; i++ )
{
g_szMapsName[ i ] = "NoMap";
g_iMapPlayedTime[ i ] = -999;
g_iMapPlayersRec[ i ] = -999;
g_iMapSysTime[ i ] = -999;
}
 
new iFile = fopen( g_szFile, "rt" );
 
if( iFile )
{
 
new szBuffer[ 128 ], szData[ 3 ][ 32 ];// 0 = Played Time, 1 = Player record, 2 = SysTime to get the mins ago.
while( !feof( iFile ) && g_iMapsNum < iMapsToSave )
{
fgets( iFile, szBuffer, charsmax( szBuffer ) );
trim( szBuffer );
 
if( szBuffer[ 0 ] )
{
parse( szBuffer,\
g_szMapsName[ g_iMapsNum ], charsmax( g_szMapsName[] ),\
szData[ 0 ], charsmax( szData[] ),\
szData[ 1 ], charsmax( szData[] ),\
szData[ 2 ], charsmax( szData[] ) );
 
g_iMapPlayedTime[ g_iMapsNum ] = str_to_num( szData[ 0 ] );
g_iMapPlayersRec[ g_iMapsNum ] = str_to_num( szData[ 1 ] );
g_iMapSysTime[ g_iMapsNum ] = str_to_num( szData[ 2 ] );
g_iMapsNum++;
}
}
 
fclose( iFile );
}
 
g_iMaxPlayers = get_maxplayers( );
get_mapname( g_szMapName, charsmax( g_szMapName ) );
}
 
public client_putinserver( id )
{
if( is_user_bot( id ) || is_user_hltv( id ) )
return;
 
if( ++g_iPlayers > g_iPlayersRecord )
g_iPlayersRecord = g_iPlayers;
 
}
 
public client_disconnect( id )
{
if( is_user_bot( id ) || is_user_hltv( id ) )
return;
 
if( --g_iPlayers < 0 )
g_iPlayers = 0;
 
}
 
public cmd_MapsInfo( id )
{
new iMinutes, iTimeLeft, szNextMap[ 32 ], szUrl[ 64 ];
 
iMinutes = floatround( get_gametime(  ) / 60.0, floatround_ceil );
iTimeLeft = get_timeleft( ) / 60;
 
get_cvar_string( "amx_nextmap", szNextMap, charsmax( szNextMap ) );
get_pcvar_string( g_iCvarUrl, szUrl, charsmax( szUrl ) );
 
if( !szNextMap[ 0 ] )
szNextMap = "Not voted yet";
 
new szBuffer[ 2500 ], szMapInfo[ 128 ], i, iSysTime;
formatex( szBuffer, charsmax( szBuffer ), "%s?cr_mn=%s&cr_pt=%i&nm_mn=%s&nm_tl=%i", 
szUrl, g_szMapName, iMinutes, szNextMap, iTimeLeft );
 
iSysTime = get_systime( );
for( i = 0; i < g_iMapsNum; i++ )
{
formatex( szMapInfo, charsmax( szMapInfo ), "&m%i_pt=%i&m%i_pr=%i/%i&m%i_mn=%s&m%i_tago=%i",
i, g_iMapPlayedTime[ i ], i, g_iMapPlayersRec[ i ],\
g_iMaxPlayers, i, g_szMapsName[ i ],\
i, ( iSysTime - g_iMapSysTime[ i ] ) / 60 );
 
add( szBuffer, charsmax( szBuffer ), szMapInfo );
}
 
//log_amx( szBuffer );
show_motd( id, szBuffer, "Server's Map Info" );
 
}
 
public plugin_end(  )
{
new iMinutes, iFile;
iMinutes = floatround( get_gametime(  ) / 60.0, floatround_ceil );
 
iFile = fopen( g_szFile, "wt" );
if( iFile )
{
fprintf( iFile, "^"%s^" ^"%i^" ^"%i^" ^"%i^"", g_szMapName, iMinutes, g_iPlayersRecord, get_systime( ) );
 
if( g_iMapsNum == iMapsToSave )
g_iMapsNum--;
 
for( new i = 0; i < g_iMapsNum; i++ ) 
fprintf( iFile, "^n^"%s^" ^"%i^" ^"%i^" ^"%i^"", g_szMapsName[ i ], g_iMapPlayedTime[ i ], g_iMapPlayersRec[ i ], g_iMapSysTime[ i ] );
 
fclose( iFile );
}
 
}

 
Nume: Server's Map Information
Versiune: 1.1.1
Link oficial:
This is the hidden content, please
 
Instalare:
1. Fisierul smi.sma il puneti in addons/amxmodx/scripting
2. Fisierul smi.amxx il puneti in addons/amxmodx/plugins
3. Intrati in fisierul addons/amxmodx/configs/plugins.ini si adaugati la urma:

This is the hidden content, please
 
4. Urcati continutul arhiver smi_web pe webhostul vostru.
 
Cvar-uri (se adauga in fisierul amxmodx\configs\amxx.cfg):
smi_script_url "
This is the hidden content, please
"" Aici setati locatia scriptului pe webhost.
EX:
This is the hidden content, please
 
Comenzi administrative (se tasteaza in consola si trebuie sa fiti administrator):
- Nu detine
 
Comenzi publice (se tasteaza in joc prin apasarea tastei Y):
/maps, /mapsinfo, /minfo, /mi, /lastmaps - afiseaza motd'ul.
 
 
Module necesare (se sterge ; din fata modulului de mai jos; acestea le gasiti in fisierul amxmodx\configs\modules.ini):
- cele default.
 
Imagini:

http://i.imgur.com/r0th6je.jpg
http://i.imgur.com/vhskoX3.jpg

 
Aveti aici un mic
This is the hidden content, please
 
Cei ce nu detin un webhost, doar puneti pluginul pe server.
El se va conecta la webhostul meu afisandu'va Exact lafel aceste statistici.
Servere care folosesc acest plugin:
This is the hidden content, please
Link to comment
Share on other sites

Please disable AdBlocker in order to help us keeping the forum up and running!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By visiting our community, you agree to our Terms of Use.