Cs.TomisNord.Ro
Would you like to react to this message? Create an account in a few clicks or log in to continue.


Counter-Strike TomisNord va ureaza bun venit !
 
HomePortalGalleryLatest imagesSearchRegisterLog in

 

 TimeLeft in Hostname hlds

Go down 
AuthorMessage
Nspyder
Admin
Nspyder


Posts : 130
Join date : 17/06/2010

TimeLeft in Hostname hlds Empty
PostSubject: TimeLeft in Hostname hlds   TimeLeft in Hostname hlds I_icon_minitimeSat Jul 10, 2010 6:20 am

Descriere:Acest plugin arata timpul ramas in HostName
Download:http://WwW.CsBesTiaL.CoM/upload/30670HostnameTimeleft.rar

Sma
Code:
#include <amxmodx>
#include <engine>

#pragma semicolon 1

#define UPDATE_TIME 1.0
#define ENTITY_CLASS "env_host_timeleft"

new bool:g_timerRunning = false;
new g_MsgServerName;
new g_szHostname[ 64 ];
new g_pointerTimelimit;
new g_pointerHostname;
new g_cvarEnabled;
new g_cvarStyle;

public plugin_init() {
register_plugin( "Hostname Timeleft", "1.0", "xPaw" );

g_cvarEnabled = register_cvar( "sv_hostname_timeleft", "1" );
g_cvarStyle = register_cvar( "sv_hostname_style", "3" );
g_pointerTimelimit = get_cvar_pointer( "mp_timelimit" );
g_pointerHostname = get_cvar_pointer( "hostname" );

g_MsgServerName = get_user_msgid( "ServerName" );

// Give delay to load configs...
set_task( 2.5, "checkTimeleft" );
}

public plugin_end( )
if( g_timerRunning )
if( strlen( g_szHostname ) )
set_pcvar_string( g_pointerHostname, g_szHostname );

public checkTimeleft( ) {
get_pcvar_string( g_pointerHostname, g_szHostname, 63 );

if( get_pcvar_num( g_cvarEnabled ) != 1 ) {
g_timerRunning = false;

return;
} else
register_think( ENTITY_CLASS, "fwdThink_Updater" );

g_timerRunning = true;

// initialize thinking entity...
new iEntityTimer = create_entity( "info_target" );
entity_set_string( iEntityTimer, EV_SZ_classname, ENTITY_CLASS );
entity_set_float( iEntityTimer, EV_FL_nextthink, get_gametime() + UPDATE_TIME );
}

public fwdThink_Updater( iEntity ) {
static szHostname[ 64 ], iStyle;
iStyle = get_pcvar_num( g_cvarStyle );

if( get_pcvar_float( g_pointerTimelimit ) ) {
static iHours, iMinutes, iSeconds;

iSeconds = get_timeleft( );
iMinutes = iSeconds / 60;
iHours = iMinutes / 60;
iSeconds = iSeconds - iMinutes * 60;
iMinutes = iMinutes - iHours * 60;


if( iHours ) {
switch( iStyle ) {
case 1: formatex( szHostname, 63, "%s (Timeleft %d:%02d:%02d)", g_szHostname, iHours, iMinutes, iSeconds );
case 2, 4: formatex( szHostname, 63, "%s (%d:%02d:%02d)", g_szHostname, iHours, iMinutes, iSeconds );
case 3, 5: formatex( szHostname, 63, "(%d:%02d:%02d) %s", iHours, iMinutes, iSeconds, g_szHostname );
}
} else {
switch( iStyle ) {
case 1: formatex( szHostname, 63, "%s (Timeleft %d:%02d)", g_szHostname, iMinutes, iSeconds );
case 2, 4: formatex( szHostname, 63, "%s (%d:%02d)", g_szHostname, iMinutes, iSeconds );
case 3, 5: formatex( szHostname, 63, "(%d:%02d) %s", iMinutes, iSeconds, g_szHostname );
}
}
} else {
switch( iStyle ) {
case 1: formatex( szHostname, 63, "%s (No time limit)", g_szHostname );
case 2, 4: formatex( szHostname, 63, "%s (--:--)", g_szHostname );
case 3, 5: formatex( szHostname, 63, "(--:--) %s", g_szHostname );
}
}

if( iStyle < 4 )
set_pcvar_string( g_pointerHostname, szHostname );

message_begin( MSG_BROADCAST, g_MsgServerName );
write_string( szHostname );
message_end( );

entity_set_float( iEntity, EV_FL_nextthink, get_gametime() + UPDATE_TIME );

return PLUGIN_CONTINUE;
}[/b]

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

Code:
HostnameTimeleft.amxx
Stilul Time Left
Stilul 1


Code:
hostname (Timeleft: 35:20)
hostname (No timelimit)

Stilul 2, 4

Code:
hostname (35:20)
hostname (--:--)


Stilul 3, 5


Code:
(35:20) hostname
(--:--) hostname

Quote :
Cvars:(se adauga in fisierul amxmodx\configs\amxx.cfg):
sv_hostname_timeleft 0/1 - Activeaza/Dezactiveaza pluginul.
sv_hostname_style 1-5 - Stilul Time Left (Default: 3)

Imagine
TimeLeft in Hostname hlds 2r7xdh1
Back to top Go down
http://tomisnord.ogameplayer.com
 
TimeLeft in Hostname hlds
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Cs.TomisNord.Ro :: Counter-Strike :: Resurse :: Plugin-uri-
Jump to: