Offline |
|
|
Csatlakozott: 2016.03.06. 14:20 Hozzászólások: 968
Megköszönt másnak: 109 alkalommal Megköszönték neki: 135 alkalommal
|
saxxo írta: The Peace írta: Nem hallottam még róla.
De ha elmondod mit kezel és mihez kell, meglehet írni. Szia! kódhoz kellene.... Rá nézésre shedi_time_length(g_Player[m_Index][PlayTime], timeunit_seconds, MinuteString, charsmax(MinuteString));
én úgy gondolom , hogy ez az időt kezelné.. de passzolom, mert kifagy tőle az AMXMODX 1.9 , ha megnyitom.XD Én valahogy így indulnék el (csak példa,de amúgy meg tudja a fene, hogy pontosan miket rejt magában.. de azis lehet hogy csak a playtimeot. arról van sok poszt, hogy az hogyan menthető stb..) : #if defined _shedi_included #endinput #endif #define _shedi_included #define timeunit_seconds 0 #define timeunit_minutes 1 #define timeunit_hours 2 #define timeunit_days 3 stock shedi_time_length(time, timeunit, output[], outputlen) { new seconds, minutes, hours, days; switch (timeunit) { case timeunit_seconds: { seconds = time; minutes = seconds / 60; hours = minutes / 60; days = hours / 24; } case timeunit_minutes: { minutes = time; seconds = minutes * 60; hours = minutes / 60; days = hours / 24; } case timeunit_hours: { hours = time; minutes = hours * 60; seconds = minutes * 60; days = hours / 24; } case timeunit_days: { days = time; hours = days * 24; minutes = hours * 60; seconds = minutes * 60; } } if (days > 0) { format(output, outputlen, "%d nap %d óra %d perc %d másodperc", days, hours % 24, minutes % 60, seconds % 60); } else if (hours > 0) { format(output, outputlen, "%d óra %d perc %d másodperc", hours, minutes % 60, seconds % 60); } else if (minutes > 0) { format(output, outputlen, "%d perc %d másodperc", minutes, seconds % 60); } else { format(output, outputlen, "%d másodperc", seconds); } }
Most találtam: /*Played Time with [Current Time]*/ /*Thanks to SAMURAI16 for current time*/ /*Author:Alka **Version:v1.0*/ #include <amxmodx> #include <amxmisc> #define PLUGIN "Played Time" #define VERSION "1.0" #define AUTHOR "Alka" new showpt; public plugin_init() { register_plugin( PLUGIN, VERSION, AUTHOR ); register_clcmd( "say", "handle_say" ); register_concmd( "amx_playedtime", "admin_showptime", ADMIN_KICK," <#Player Name>" ); showpt = register_cvar( "amx_ptshow", "1" ); } public handle_say(id) { static said[7] read_argv( 1, said, 6 ); if( said[0] != '!' ) return PLUGIN_CONTINUE; if( equali( said, "!ptime" ) ) { static ctime[64], timep; timep = get_user_time( id, 1 ) / 60; get_time( "%H:%M:%S", ctime, 63 ); switch( get_pcvar_num(showpt) ) { case 0 : { client_print( id,print_chat,"[PT]You are playing on server for: %d minute%s.", timep, timep == 1 ? "" : "s" ); client_print( id,print_chat,"[PT]Current time: %s", ctime ); } case 1 : { set_hudmessage( 255,50,50, 0.34, 0.50, 0, 6.0, 4.0, 0.1, 0.2, -1 ); show_hudmessage( id, "[PT]You are playing on server for: %d minute%s.^n[PT]Current time: %s", timep, timep == 1 ? "" : "s", ctime ); } } return PLUGIN_HANDLED; } return PLUGIN_CONTINUE; } public admin_showptime(id,level,cid) { if( !cmd_access(id,level,cid,1) ) return PLUGIN_HANDLED; static arg[32], target; read_argv( 1, arg, 31 ); target = cmd_target( id, arg, 2 ); if( !target ) return PLUGIN_HANDLED; static name[32]; get_user_name( target, name, 31 ); static timep, ctime[64]; timep = get_user_time( target, 1 ) / 60; get_time( "%H:%M:%S", ctime, 63 ); console_print(id,"----------------[PlayedTime]--------------------"); console_print(id,"[PT]%s is playing on server for %d minute%s.",name, timep, timep == 1 ? "" : "s"); console_print(id,"[PT]Current time: %s", ctime); console_print(id,"----------------------------------------------------"); return PLUGIN_HANDLED; }
------ U.I: Szerintem hagy a fenébe azt az INC.-et töröld ki és olvasgass nézz utána ha nagyon akarod ezt a "mod"-nak nevezett valamit és annyi helyen találsz jobbnál jobb dolgokat, hogy keresgélj!! rengeteg dolgot megtudsz és jobb kivitelezésben elkészíted. De valami aktívabb az includeok-ban biztos tud segíteni neked itt a forumon! ^^
_________________ ! | Moderátori megjegyzés (kiki): | Kérlek csekkold az aláírásra vonatkozó szabályokat! |
|
|