Bayne Posted May 3, 2013 Share Posted May 3, 2013 gibt es eine möglichkeit im script anzufragen wann jmd zuletzt online war? ala: GM bob - offline - zuletzt online: DD/MM//JJ HH:MM GM bos - online Quote Link to comment Share on other sites More sharing options...
Kenpachi Posted May 3, 2013 Share Posted May 3, 2013 Ob jemand online ist: query_sql("SELECT `online` FROM `char` WHERE `char_id` = " + getcharid(0), [email protected]); if([email protected]) mes "online"; else mes "offline"; Wann sich jemand zuletzt eingeloggt hat (leider nur Account basiert mölich): query_sql("SELECT `lastlogin` FROM `login` WHERE `account_id` = " + getcharid(3), [email protected]$); mes "zuletzt online: " + [email protected]$; Sollte so funzen... habs nur schnell dahin getippelt. Quote Link to comment Share on other sites More sharing options...
Bayne Posted May 4, 2013 Author Share Posted May 4, 2013 (edited) vielen dank erstmal werds nach der arbeit heut antest EDIT: Danke nochmals, habs ein wenig abändern müssen aber nun gehts auchgleich gut zu wissen wie man sql_datenbank einträge abfragt Edited May 4, 2013 by Bayne Quote Link to comment Share on other sites More sharing options...
DeadlySilence Posted May 5, 2013 Share Posted May 5, 2013 (edited) Alternativ könnte das auch so gehen: query_sql( "SELECT `c`.`online`, DATE_FORMAT(`l`.`lastlogin`, '%d.%m.%Y') as date, DATE_FORMAT(`l`.`lastlogin`, '%H:%i') as time " + "FROM `char` c, `login` l " + "WHERE `l`.`account_id` = " + getcharid(3) + " AND `c`.`char_id` = " + getcharid(0) , [email protected], [email protected]$, [email protected]$ ); if ([email protected]) { mes "Online"; } else { mes "Offline - zuletzt online am " + [email protected]$ + " um " + [email protected]$ + " Uhr"; } So selektierst du beide Werte in einem Query und formatierst das Datum und die Uhrzeit in eine lesbarere Form. (Anmerkung: Das Skript findet den Status des aktuellen Spielers heraus. Du musst die beiden getcharid-Funktionen durch die Account- bzw. Char-ID des Chars ersetzen, der überprüft werden soll.) Edited May 5, 2013 by DeadlySilence Quote Link to comment Share on other sites More sharing options...