Problem with SQL loading
#1

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
Reply
#2

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.
Reply
#3

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
Reply
#4

Resolved,there was a problem with string size
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)