//************************************* //* NWN-MySQL 4.0 (c) 2004 FastFrench * //************************************* // This file is licensed under the terms of the // GNU GENERAL PUBLIC LICENSE (GPL) Version 2 // ************************ // ** ff_stat_ff_now.nss ** // ************************ // ** This script is part of the server status dialog #include "ff_include" string DisplayTime(int NbMinute) { if (NbMinute>60) return IntToString(NbMinute/60)+" hours and "+IntToString(NbMinute%60)+" minutes"; else return IntToString(NbMinute%60)+" minutes"; } //µ int StartingConditional() { string sDureeOn = DisplayTime(SQLExecAndFetchSingleInt("SELECT UNIX_TIMESTAMP() - UNIX_TIMESTAMP(Date) FROM restart ORDER BY Date DESC LIMIT 1")/60); string sPlayer = SQLExecAndFetchSingle("SELECT COUNT(*) FROM `idplayer` WHERE Actif=1"); //string sDM = SQLExecAndFetchSingle("SELECT COUNT(*) FROM `idplayer` WHERE Actif=1 AND DM=1"); string sRef = ff_Colorize("[b]There are currently [g]"+sPlayer+"[b] players"); if (GetLocalInt(GetPCSpeaker(),"DM_STATUS")>=LV_DM) sRef += ff_Colorize(" and [g]"+SQLExecAndFetchSingle("SELECT COUNT(*) FROM `idplayer` WHERE Actif=1 AND DM=1")+"[b] DM"); sRef += " on this server powered by FastFrench.\n"; sRef += ff_Colorize("The server is running for [g]"+sDureeOn+"[b].\n"); SetCustomToken(100, sRef); return TRUE; }