Alex_Jemison
Умник
Помогите . Проблема с PayDay а точней с выдачей exp и обновлением отыграного времени
PHP:
[22:22:14] [ERROR] error #1064 while executing query "UPADE `accounts` SET `Lvl` = '1', `Exp` = '1' WHERE `id` = '1'": You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UPADE `accounts` SET `Lvl` = '1', `Exp` = '1' WHERE `id` = '1'' at line 1
[22:22:14] [ERROR] error #1064 while executing query "UPADE `accounts` SET `Time` = '0' WHERE `id` = '1'": You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UPADE `accounts` SET `Time` = '0' WHERE `id` = '1'' at line 1
[22:25:32] [ERROR] error #1064 while executing query "UPADE `accounts` SET `Time` = '1' WHERE `id` = '1'": You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UPADE `accounts` SET `Time` = '1' WHERE `id` = '1'' at line 1
PHP:
forward MinutesUpdate();
public MinutesUpdate()
{
foreach(new i:Player)
{
if(PlayerAFK[i] < 2)
{
PlayerInfo[i][pTime]++;
if(PlayerInfo[i][pTime] >= 60)
{
PlayerInfo[i][pTime] = 0;
PayDay(i);
}
static const fmt_query[] = "UPADE `accounts` SET `Time` = '%d' WHERE `id` = '%d'";
new query[sizeof(fmt_query)+(-2+11)+(-2+8)];
format(query, sizeof(query), fmt_query, PlayerInfo[i][pTime],PlayerInfo[i][pID]);
mysql_tquery(mysql, query);
}
}
return 1;
}
PHP:
stock PayDay(playerid)
{
SendClientMessage(playerid, COLOR_GOLD, "[ PayDay ]");
GiveExp(playerid, 1);
}
stock GiveExp(playerid, exp)
{
PlayerInfo[playerid][pExp] += exp;
new NextExp = (PlayerInfo[playerid][pLvl]+1)*NextLvl;
new buffer = PlayerInfo[playerid][pExp]-NextExp;
if(PlayerInfo[playerid][pExp] >= NextExp)
{
PlayerInfo[playerid][pExp] = 0;
if(buffer > 0) PlayerInfo[playerid][pExp] += buffer;
PlayerInfo[playerid][pLvl]++;
SendClientMessage(playerid, COLOR_WHITE, "Поздравляем ! Ваш уровень повышен !");
SetPlayerScore(playerid, PlayerInfo[playerid][pLvl]);
}
static const fmt_query[] = "UPADE `accounts` SET `Lvl` = '%d', `Exp` = '%d' WHERE `id` = '%d'";
new query[sizeof(fmt_query)+(-2+9)+(-2+8)];
format(query, sizeof(query), fmt_query, PlayerInfo[playerid][pLvl],PlayerInfo[playerid][pExp],PlayerInfo[playerid][pID]);
mysql_tquery(mysql, query);
}
