Падает сервер при вызове комманды
#1

Добрый вечер, занимаюсь переводом системы гонок на MySql r7, но при загрузке происходит такая проблемка:

При вводе команды, серв падает.

Команда
PHP Code:
COMMAND:startrace(playeridparams[])
{
       if(
sscanf(params,"d",params[0])) return SendClientMessage(playerid, -1"{0069ff}[DriftCity]{FFFFFF}: /startRace [Сумма выигрыша]");
    
//if(!IsPlayerAdmin(playerid)) return true;
    
SetPVarInt(playerid"raceTemp"params[0]);
    
mysql_function_query(MYSQL"SELECT * FROM  "TABLERACE""true"StartRacePubl""i"playerid);
    return 
true;

Паблик:
PHP Code:
forward StartRacePubl(playerid);
public 
StartRacePubl(playerid)
{
    print(
"До StartRacePubl дошло");
    new 
fields,
        
rows,
        
dialog[255],
        
str[32];
    
cache_get_data(rowsfields);
    print(
"Доходит до цикла");
    for(new 
ii<rowsi++)
    {
        
printf("Доходит до цикла %d",i);
        
cache_get_field_content(i"RName"Races[i][rName]);
         
format(strsizeof(str), "%s\n"Races[i][rName]);
           
strcat(dialogstr);
        
printf("Прошло цикл %d, имя гонки %s",iRaces[i][rName]);
           
printf("%s",str);
    }
    
ShowPlayerDialog(playeridRACEDIALOG+1DIALOG_STYLE_LIST"Выбор гонки"dialog"Выбрать""Назад");
    return 
true;

В логах сервера:
Quote:

До StartRacePubl дошло
Доходит до цикла
Доходит до цикла 0

В логах MySql
Quote:

>> mysql_query_callback( Connection handle: 1 )
Passing query SELECT * FROM `racesinfo` | i
ProcessQueryThread(StartRacePubl) - Query was successful. (SELECT * FROM `racesinfo`)
ProcessQueryThread(StartRacePubl) - Data caching enabled.
CMySQLHandler::StoreResult() - Result was stored.
CMySQLHandler::FreeResult() - Result was successfully free'd.
CMySQLHandler::ProcessQueryThread() - Data is getting passed to ->ProcessTick()
StartRacePubl(i) - Threaded function called.
>> cache_get_data( Connection handle: 1 )

Reply
#2

Не нужно быть гадалкой, что бы понять, что проблема где-то здесь - cache_get_field_content(i, "RName", Races[i][rName]);
Возможно ключ не существует.

Так же не очень ясен смысл лишних табуляций, неудачный копипаст?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)