SA-MP Forums Archive
Send mysql logs to ingame - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Send mysql logs to ingame (/showthread.php?tid=650078)



Send mysql logs to ingame - Score - 20.02.2018

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); 



Re: Send mysql logs to ingame - AlexMSK - 20.02.2018

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


Re: Send mysql logs to ingame - Score - 20.02.2018

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..


Re: Send mysql logs to ingame - AlexMSK - 20.02.2018

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;




Re: Send mysql logs to ingame - Score - 20.02.2018

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.


Re: Send mysql logs to ingame - AlexMSK - 20.02.2018

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


Re: Send mysql logs to ingame - Score - 20.02.2018

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?


Re: Send mysql logs to ingame - iLearner - 20.02.2018

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


Re: Send mysql logs to ingame - rfr - 20.02.2018

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


Re: Send mysql logs to ingame - iKarim - 20.02.2018

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