Quote:
Originally Posted by themakar
Помогите, ошибка в функции, но я не могу её обнаружить.
PHP Code:
stock GetPlayerNameBySQLID(userid)
{
new
string[256],
Cache:result,
name[MAX_PLAYER_NAME];
mysql_format(g_iHandle, string, sizeof(string), "SELECT `Character` FROM `characters` WHERE `ID` = '%d'", userid);
result = mysql_query(g_iHandle, string);
cache_get_field_content(0, "Character", name, g_iHandle, MAX_PLAYER_NAME);
cache_delete(result);
return name;
}
PHP Code:
[debug] Run time error 8: "Heap underflow"
[debug] Heap pointer (HEA) is 0x80E2E8, heap bottom (HLW) is 0x80E368
[debug] AMX backtrace:
[debug] #0 00039078 in ?? (0x00000000, 0x00000001, 0x00000013) from roleplay.amx
[debug] #1 0015ccc4 in public OnPlayerEnterDynamicArea (0x00000000, 0x00000014) from roleplay.amx
Вызываю функцию
PHP Code:
format(info_2, sizeof(info_2), (HouseData[id][houseOwner]) ? (GetPlayerNameBySQLID(HouseData[id][houseOwner])) : (FormatNumber(HouseData[id][housePrice])));
После этого участок кода прекращает работу.
|
Не понимаю, что было не так, я переписал код заново и все заработало.