SA-MP Forums Archive
Problem with SQL loading - 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: Problem with SQL loading (/showthread.php?tid=599436)



Problem with SQL loading - Squirrel - 25.01.2016

Alright so the problem is probably easy to detect but I dont see it. Its causing a server crash

Quote:

[01:32:21] [debug] AMX backtrace:
[01:32:21] [debug] #0 native SendClientMessage () from samp-server.exe
[01:32:21] [debug] #1 001c4ad4 in public OnChatLoad (0) from MySrv.amx
[01:32:21] [debug] Native backtrace:
[01:32:21] [debug] #0 0049dc0c in ?? () from samp-server.exe

PHP код:
forward onFunLoad(playerid);
public 
onFunLoad(playerid)
{
    new 
string[128],
        
dateString[50],
        
rows cache_num_rows(),
        
someStringName[24],
        
IssuedByString[128],
        
crimecount,
        
mainstring[128];
    
Msg(playerid,COLOR_RED,"______________| Testing |______________");
    for(new 
i=0rowsi++) {
        
cache_get_field_content(i"Name"someStringName);
        
cache_get_field_content(i"Message"IssuedByString);
        
cache_get_field_content(i"Date"string);
        
cache_get_field_content(i"Time"dateString);
        
format(mainstring,sizeof(mainstring),"%s\n",IssuedByString);
        
Msg(playerid,COLOR_RED,mainstring); //This is the one causing the problem
     
}
    return 
1;

I know im not using all data from it but its just for testing purposes


Re: Problem with SQL loading - AmigaBlizzard - 26.01.2016

Make sure the message doesn't have any formatting specifiers when using SendClientMessage.
https://sampwiki.blast.hk/wiki/SendClientMessage
See the comments in this page.

Also the \n isn't needed when sending text using SendClientMessage.
Also, your error-log says it comes from OnChatLoad instead of OnFunLoad.


Re: Problem with SQL loading - Squirrel - 26.01.2016

Quote:
Originally Posted by AmigaBlizzard
Посмотреть сообщение
Make sure the message doesn't have any formatting specifiers when using SendClientMessage.
https://sampwiki.blast.hk/wiki/SendClientMessage
See the comments in this page.

Also the \n isn't needed when sending text using SendClientMessage.
Also, your error-log says it comes from OnChatLoad instead of OnFunLoad.
Yeah it does come from OnCHatLoad, its just I renamed the function before I made the post, like 2 minutes after it


Re: Problem with SQL loading - TwinkiDaBoss - 26.01.2016

Resolved,there was a problem with string size