Send mysql logs to ingame
#1

Hello, is there any way to send mysql logs ingame?

I have a code on my script but that doesn't work..

PHP код:
public OnGameModeInit()
{
    new 
string[300];
    
format(stringsizeof(string), "%s"mysql_log(ALL));
    
mysql_log(ALL);
    
SendClientMessageToAll(COLOR_ORANGEstring); 
Reply
#2

yep you can do it under onqueryerror
https://sampwiki.blast.hk/wiki/MySQL#OnQueryError
Reply
#3

Quote:
Originally Posted by AlexMSK
Посмотреть сообщение
yep you can do it under onqueryerror
https://sampwiki.blast.hk/wiki/MySQL#OnQueryError
I want to send debugs and stuff, for example i get this on my mysql_logs.txt

PHP код:
[00:54:30] [DEBUGmysql_tquery: return value'1'
[00:54:30] [DEBUGmysql_tquery(1"CREATE TABLE IF NOT EXISTS `temp_blocked_users` (`ip` VARCHAR(18), `lock_timestamp` INT, `user_id` INT)""""")
[
00:54:30] [DEBUGCCallback::Create(amx=0x236a4a0name=''format=''params=0x341d72cparam_offset=5)
[
00:54:30] [DEBUGCHandle::Execute(this=0x5e7ee0type=1query=0x5f7250)
[
00:54:30] [DEBUGCHandle::Execute - return valuetrue
[00:54:30] [DEBUGmysql_tquery: return value'1'
[00:54:30] [DEBUGCConnection::Execute(query=0x5f4c38this=0x52f020connection=0x5f4858)
[
00:54:30] [DEBUGCConnection::GetError(this=0x52f020connection=0x5f4858)
[
00:54:30] [DEBUGCConnection::Execute(query=0x5f7250this=0x52f020connection=0x5f4858)
[
00:54:30] [DEBUGCConnection::GetError(this=0x52f020connection=0x5f4858)
[
00:54:30] [DEBUGCCallback::Create(amx=0x236a4a0name='OnQueryError'format='dsssd)
[00:54:30] [DEBUG] CCallback::Create(amx=0x236a4a0, name='
OnQueryError', format='dsssd
i want to send that ingame too..
Reply
#4

PHP код:
#define DIALOG_ERROR -1
public OnQueryError(erroriderror[], callback[], query[], connectionHandle)
{
    for(new 
0GetPlayerPoolSize(); <= ji++)
    {
        new
            
string[2048];
        
format(stringsizeof(string), "Error ID: %i\nCallback: %s\nQuery: %s\nError: %s\n"erroridcallbackqueryerror);
        
ShowPlayerDialog(iDIALOG_ERRORDIALOG_STYLE_MSGBOX"Mysql Error"string"Close""");
    }
    return 
1;

Reply
#5

Quote:
Originally Posted by AlexMSK
Посмотреть сообщение
PHP код:
#define DIALOG_ERROR -1
public OnQueryError(erroriderror[], callback[], query[], connectionHandle)
{
    for(new 
0GetPlayerPoolSize(); <= ji++)
    {
        new
            
string[2048];
        
format(stringsizeof(string), "Error ID: %i\nCallback: %s\nQuery: %s\nError: %s\n"erroridcallbackqueryerror);
        
ShowPlayerDialog(iDIALOG_ERRORDIALOG_STYLE_MSGBOXstring"Close""");
    }
    return 
1;

I think you can't understand me, i want to send the same exact texts from mysql_logs.txt to ingame.

PHP код:
new string[300];
    
format(stringsizeof(string), "%s"mysql_log(ALL));
    
mysql_log(ALL);
    
SendClientMessageToAll(COLOR_ORANGEstring); 
This is what i tried to do, thanks.
Reply
#6

It will send you the same log, just in another explication
Reply
#7

Quote:
Originally Posted by AlexMSK
Посмотреть сообщение
It will send you the same log, just in another explication
How can i do it like this, example send the text to all players online.


PHP код:
[DEBUGmysql_tquery: return value'1' 
[DEBUGmysql_tquery(1"CREATE TABLE IF NOT EXISTS `temp_blocked_users` (`ip` VARCHAR(18), `lock_timestamp` INT, `user_id` INT)"""""
[
DEBUGCCallback::Create(amx=0x236a4a0name=''format=''params=0x341d72cparam_offset=5
[
DEBUGCHandle::Execute(this=0x5e7ee0type=1query=0x5f7250
[
DEBUGCHandle::Execute - return valuetrue 
[DEBUGmysql_tquery: return value'1' 
[DEBUGCConnection::Execute(query=0x5f4c38this=0x52f020connection=0x5f4858
[
DEBUGCConnection::GetError(this=0x52f020connection=0x5f4858
[
DEBUGCConnection::Execute(query=0x5f7250this=0x52f020connection=0x5f4858
[
DEBUGCConnection::GetError(this=0x52f020connection=0x5f4858
[
DEBUGCCallback::Create(amx=0x236a4a0name='OnQueryError'format='dsssd) 
[DEBUG] CCallback::Create(amx=0x236a4a0, name='
OnQueryError', format='dsssd
How to send all of these debugs ingame?
Reply
#8

I think you can't unless Maddinat0r makes a function for that.
Reply
#9

can't you just read the log file and then send it ingame
Reply
#10

Why do you even want to send that ingame? That's totally unnecessary, you have the files for a reason.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)