LivingThings
Умник
Hello all. :bs:
Команда:
Сохранение:
Итог:
В таблице ничего не появляется, да и координаты по нулям. В чём проблема?
P.s таблица:
Команда:
PHP:
if(!strcmp(cmd, "/createmapicon", true))
{
new Float: Pos[3], string[100];
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
if(pData[playerid][Admin] < 5) return SCM(playerid, COL_GREY, NoAdm);
if(sscanf(params, "d", params[0])) return SCM(playerid, 0x33AA33FF, " Используйте: /createmapicon [ тип иконки ]");
if(params[0] < 1 || params[0] > 62) return SCM(playerid, COL_GREY, " Ошибка: Неверный номер иконки.");
ALLICONS ++;
pIcon[ALLICONS][XS] = Pos[0];
pIcon[ALLICONS][YS] = Pos[1];
pIcon[ALLICONS][ZS] = Pos[2];
pIcon[ALLICONS][Type] = params[0];
CreateDynamicMapIcon(Pos[0], Pos[1], Pos[2], params[0], -1, 0, 0, playerid, 100.0);
format(string, 100, " Иконка номер {33AAFF}%i{FF0000} - успешно создана!", ALLICONS);
SCM(playerid, COL_RED, string);
SaveMapIcon(params[0]);
return 1;
}
PHP:
stock SaveMapIcon(iconid)
{
new buf[500];
mysql_format(connectionHandle, buf, "UPDATE `"TABLE_ICON"` SET `X`='%f', `Y` = '%f', `Z` = '%f', `Type` = '%i'", pIcon[iconid][XS], pIcon[iconid][YS], pIcon[iconid][ZS], pIcon[iconid][Type]);
mysql_function_query(connectionHandle, buf, false, "", "");
return 1;
}
PHP:
[02:59:40] ProcessQueryThread() - Executing query UPDATE `ICON` SET `X`='0.000000', `Y` = '0.000000', `Z` = '0.000000', `Type` = '0'...
[02:59:40] ProcessQueryThread() - Query was successful.
[02:59:40] ProcessQueryThread() - Data being passed to ProcessTick().
P.s таблица:
PHP:
CREATE TABLE `ICON`
(
`X` varchar(24) NOT NULL,
`Y` varchar(24) NOT NULL,
`Z` varchar(24) NOT NULL,
`Type` int(2) NOT NULL
)
