RSSy MYGO.pl Opublikowano Luty 4, 2022 o 12:59 RSSy Udostępnij Opublikowano Luty 4, 2022 o 12:59 Time played Table of contents:Description API Credits Changelog Download Files How to use DESCRIPTIONIt for saves the time played of the player and first seen, last seen on the server.APIFull documentation can be found there, as well in include file: PHP Code: #if defined _timeplayed_included #endinput #endif #define _timeplayed_included /** * Returns the time played. * * @param id Client index. * @return Client time played. */ native get_time_played( id ) /** * Returns the first time seen. * * @param id Client index. * @return Client first seen. */ native get_first_seen( id ) /** * Returns the last time seen. * * @param id Client index. * @return Client last seen. */ native get_last_seen( id ) CHANGELOG v1.0.0 : December, 10, 2021Initial release. Credits ➥ Bugsy( nVault Array & Unix Time ) DownloadFiles DOWNLOAD SOURCE CODEHow to use PHP Code: #include <amxmodx> #include <unixtime> #if !defined client_print_color #define client_print_color client_print #define print_team_default print_chat #endif native get_time_played( id ) native get_first_seen( id ) native get_last_seen( id ) new const szFormatRule[ ] = "%m/%d/%Y %H:%M:%S" public plugin_init( ) { register_plugin( "Time Played: Test", "", "Supremache" ) register_clcmd( "say /time", "@TimePlayed" ) } @TimePlayed( id ) { new szTime[ 64 ], iYear, iMonth, iDay, iHour, iMinute, iSecond; new iTime = get_time_played( id ), iFirst = get_first_seen( id ), iLast = get_last_seen( id ); UnixToTime( iTime, iYear, iMonth, iDay, iHour, iMinute, iSecond ); client_print_color( id, print_team_default, "^4[Time Played]^1 Your Time^4(%d)^3 ->^4 (%02d/%02d/%02d %02d:%02d:%d)", iTime, iMonth, iDay, iYear, iHour, iMinute, iSecond ); format_time( szTime, charsmax( szTime ), szFormatRule, iFirst ) client_print_color( id, print_team_default, "^4[Time Played]^1 First Time:^4 %s", szTime ); format_time( szTime, charsmax( szTime ), szFormatRule, iLast ) client_print_color( id, print_team_default, "^4[Time Played]^1 Last Time:^4 %s", iLast ? szTime : "Hello, You are new here!" ); } Przeczytaj cały wpis Odnośnik do komentarza Udostępnij na innych stronach Więcej opcji udostępniania...
Rekomendowane odpowiedzi