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(string, sizeof(string), "%s", mysql_log(ALL));
    
mysql_log(ALL);
    
SendClientMessageToAll(COLOR_ORANGE, string); 
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] [DEBUG] mysql_tquery: return value: '1'
[00:54:30] [DEBUG] mysql_tquery(1, "CREATE TABLE IF NOT EXISTS `temp_blocked_users` (`ip` VARCHAR(18), `lock_timestamp` INT, `user_id` INT)", "", "")
[
00:54:30] [DEBUG] CCallback::Create(amx=0x236a4a0, name='', format='', params=0x341d72c, param_offset=5)
[
00:54:30] [DEBUG] CHandle::Execute(this=0x5e7ee0, type=1, query=0x5f7250)
[
00:54:30] [DEBUG] CHandle::Execute - return value: true
[00:54:30] [DEBUG] mysql_tquery: return value: '1'
[00:54:30] [DEBUG] CConnection::Execute(query=0x5f4c38, this=0x52f020, connection=0x5f4858)
[
00:54:30] [DEBUG] CConnection::GetError(this=0x52f020, connection=0x5f4858)
[
00:54:30] [DEBUG] CConnection::Execute(query=0x5f7250, this=0x52f020, connection=0x5f4858)
[
00:54:30] [DEBUG] CConnection::GetError(this=0x52f020, connection=0x5f4858)
[
00:54:30] [DEBUG] CCallback::Create(amx=0x236a4a0, name='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(errorid, error[], callback[], query[], connectionHandle)
{
    for(new 
i = 0, j = GetPlayerPoolSize(); i <= j; i++)
    {
        new
            
string[2048];
        
format(string, sizeof(string), "Error ID: %i\nCallback: %s\nQuery: %s\nError: %s\n", errorid, callback, query, error);
        
ShowPlayerDialog(i, DIALOG_ERROR, DIALOG_STYLE_MSGBOX, "Mysql Error", string, "Close", "");
    }
    return 
1;
} 
Reply
#5

Quote:
Originally Posted by AlexMSK
Посмотреть сообщение
PHP код:
#define DIALOG_ERROR -1
public OnQueryError(errorid, error[], callback[], query[], connectionHandle)
{
    for(new 
i = 0, j = GetPlayerPoolSize(); i <= j; i++)
    {
        new
            
string[2048];
        
format(string, sizeof(string), "Error ID: %i\nCallback: %s\nQuery: %s\nError: %s\n", errorid, callback, query, error);
        
ShowPlayerDialog(i, DIALOG_ERROR, DIALOG_STYLE_MSGBOX, string, "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(string, sizeof(string), "%s", mysql_log(ALL));
    
mysql_log(ALL);
    
SendClientMessageToAll(COLOR_ORANGE, string); 
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 код:
[DEBUG] mysql_tquery: return value: '1' 
[DEBUG] mysql_tquery(1, "CREATE TABLE IF NOT EXISTS `temp_blocked_users` (`ip` VARCHAR(18), `lock_timestamp` INT, `user_id` INT)", "", "") 
[
DEBUG] CCallback::Create(amx=0x236a4a0, name='', format='', params=0x341d72c, param_offset=5) 
[
DEBUG] CHandle::Execute(this=0x5e7ee0, type=1, query=0x5f7250) 
[
DEBUG] CHandle::Execute - return value: true 
[DEBUG] mysql_tquery: return value: '1' 
[DEBUG] CConnection::Execute(query=0x5f4c38, this=0x52f020, connection=0x5f4858) 
[
DEBUG] CConnection::GetError(this=0x52f020, connection=0x5f4858) 
[
DEBUG] CConnection::Execute(query=0x5f7250, this=0x52f020, connection=0x5f4858) 
[
DEBUG] CConnection::GetError(this=0x52f020, connection=0x5f4858) 
[
DEBUG] CCallback::Create(amx=0x236a4a0, name='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)