Modificare plugin /orejucate

Modificari necesare ale pluginurilor

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
User avatar
Rares ;x
Membru, skill +1
Membru, skill +1
Posts: 104
Joined: 10 Jul 2013, 16:19
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Has thanked: 10 times
Contact:

24 Nov 2013, 22:38

Am si eu acest plugin pe server, este pus corect, dar cand intru pe sv si scrie /orejucate imi da asta:
Descarca plugin-uri de pe www.indungi.ro!
[AMXX] ML_NOTFOUND: PLAYED_TIME

sma este:

Code: Select all

#include < amxmodx >
#include < amxmisc >
#include < nvault >
#include < time >

#include "color_chat_ml.inl"

#pragma semicolon 1

new const g_sVaultName[ ] = "PlayedTime";

new g_hVault;

public plugin_init( ) {
	register_plugin( "Played Time", "1.0", "Hattrick" );
	
	register_dictionary( "played_time.txt" );
	register_dictionary( "time.txt" );
	
	register_concmd( "amx_time", "FuncCommandTime", ADMIN_BAN, "- Show the players and their time" );
	register_clcmd( "say", "FuncCommandSay" );
	
	g_hVault = nvault_open( g_sVaultName );
	
	set_task( 60.0, "FuncUpgradePlayedTime", 237567, _, _, "b" );
	
	color_chat_init( );
}

public plugin_cfg( )
	nvault_prune( g_hVault, 0, get_systime( ) - 604800 );

public plugin_end( )
	nvault_close( g_hVault );

public FuncUpgradePlayedTime( ) {
	new sName[ 32 ];
	new sData[ 32 ];
	new iMinutes;
	
	for( new iPlayer = 1; iPlayer <= 32; iPlayer++ ) {
		if( is_user_connected( iPlayer ) ) {
			get_user_name( iPlayer, sName, charsmax( sName ) );
			
			nvault_get( g_hVault, sName, sData, charsmax( sData ) );
			
			iMinutes = str_to_num( sData );
			
			iMinutes++;
			
			num_to_str( iMinutes, sData, charsmax( sData ) );
			
			nvault_set( g_hVault, sName, sData );
		}
	}
}

public FuncCommandTime( iPlayer, iLevel, iCid ) {
	if( !cmd_access( iPlayer, iLevel, iCid, 1 ) )
		return PLUGIN_HANDLED;
	
	new iUser;
	new sName[ 32 ];
	new sData[ 32 ];
	new sText[ 128 ];
	new iMinutes;
	
	console_print( iPlayer, "%L									%L", iPlayer, "CON_NAME_X", iPlayer, "CON_TIME_X" );
	
	for( iUser = 1; iUser <= 32; iUser++ ) {
		if( is_user_connected( iUser ) ) {
			get_user_name( iUser, sName, charsmax( sName ) );
			
			nvault_get( g_hVault, sName, sData, charsmax( sData ) );
			
			iMinutes = str_to_num( sData );
			
			if( iMinutes ) {
				get_time_length( iUser, iMinutes, timeunit_minutes, sText, charsmax( sText ) );
				
				console_print( iPlayer, "%32s %32s", sName, sText );
			} else {
				console_print( iPlayer, "%32s									%L", sName, iPlayer, "NOT_YET_CON" );
			}
		}
	}
	
	return PLUGIN_HANDLED;
}

public FuncCommandSay( iPlayer ) {
	new sArgument[ 32 ];
	read_argv( 1, sArgument, charsmax( sArgument ) );
	
	if( equal( sArgument, "/orejucate" ) || equal( sArgument, "/time" ) ) {
		new sName[ 32 ];
		new sData[ 32 ];
		new sText[ 128 ];
		new iMinutes;
		
		get_user_name( iPlayer, sName, charsmax( sName ) );
		
		nvault_get( g_hVault, sName, sData, charsmax( sData ) );
		
		iMinutes = str_to_num( sData );
		
		if( iMinutes ) {
			get_time_length( iPlayer, iMinutes, timeunit_minutes, sText, charsmax( sText ) );
			
			ColorChat( iPlayer, RED, "[AMXX]^x01 %L", iPlayer, "PLAYED_TIME", sText );
		} else {
			ColorChat( iPlayer, RED, "[AMXX]^x01 %L", iPlayer, "PLAYED_TIME_NULL" );
		}
	}
}
BBX.INDUNGI.RO - [BaseBuilder] - [VIP-ON] - Event HappyHour: Sambata intre orele 21:00-22:00 VIP Gratis la toata lumea!
Image
User avatar
h4wk
Fost moderator
Fost moderator
Posts: 3806
Joined: 22 Sep 2009, 13:10
Detinator Steam: Da
Reputatie: Fost eXtream Mod
Nume anterior : DaZ , zimpe , Dan eXtream
Location: Iasi
Has thanked: 306 times
Been thanked: 321 times
Contact:

24 Nov 2013, 22:55

Played_time.txt - Lipseste !

Code: Select all

register_dictionary( "played_time.txt" );
register_dictionary( "time.txt" ); 

Faci un fisier nou si il salvezi cu numele de "played_time.txt"

Code: Select all

[en]
PLAYED_TIME_NULL = You are not recorded in our database yet...
PLAYED_TIME = You have played!g %s!y on our server
CON_NAME_X = Name
CON_TIME_X = Played time
NOT_YET_CON = Not recorded yet

[ro]
PLAYED_TIME_NULL = Nu esti aflat in baza noastra de date inca...
PLAYED_TIME = Ai jucat!g %s!y pe server
CON_NAME_X = Nume
CON_TIME_X = Timp jucat
NOT_YET_CON = Inca neinregistrat

Code: Select all

"Daca ai culoare nu inseamna ca esti mai presus ca un utilizator. Culoare e un fel de "rasplata" pentru ca te implici in "ridicarea" acestei comunitati.
Unii nu realizeaza ca daca ai culoare nu inseamna ca esti smecher." -- by Alexey
:troll :troll

Spui ceva,dar faci altceva !
User avatar
Rares ;x
Membru, skill +1
Membru, skill +1
Posts: 104
Joined: 10 Jul 2013, 16:19
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Has thanked: 10 times
Contact:

25 Nov 2013, 08:43

si acest txt unde il plasez?
BBX.INDUNGI.RO - [BaseBuilder] - [VIP-ON] - Event HappyHour: Sambata intre orele 21:00-22:00 VIP Gratis la toata lumea!
Image
LordOfNothing
Membru, skill +1
Membru, skill +1
Posts: 387
Joined: 19 Jul 2013, 15:51
Detinator Steam: Nu
Reputatie: Restrictie PM
Has thanked: 11 times
Been thanked: 35 times

25 Nov 2013, 11:26

amxmodx/data/lang/nume.txt


pS : zimpe dc folosesti %s la integers ??
Post Reply

Return to “Modificari pluginuri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest