MajesticYT
Новичок
Вызываю команду для получения промокода и ввожу сам промокод, после ввода крашится сервер.
Вот ошибка которая есть в логе сервера:
Вот строка 5954:
Вот паблик в котором эта строка:
Вот ошибка которая есть в логе сервера:
PHP:
[20:15:09] [join] Nikolas_Majestic has joined the server (0:127.0.0.1)
[20:15:32] [debug] Server crashed while executing juicecc.amx
[20:15:32] [debug] AMX backtrace:
[20:15:32] [debug] #0 native SendClientMessage () from samp-server.exe
[20:15:32] [debug] #1 0016541c in public mysql_PromoCheck (playerid=0, code[]=@00708970 "Free") at D:\Server\juice\gamemodes\juicecc.pwn:5954
[20:15:32] [debug] Native backtrace:
[20:15:32] [debug] #0 0049dc0c in ?? () from samp-server.exe
PHP:
SendClientMessage(playerid,COLOR_GREEN,"Промокод '%s' содержит:",code);
PHP:
forward mysql_PromoCheck(playerid,code[]);
public mysql_PromoCheck(playerid,code[])
{
new rows,fields;
cache_get_data(rows, fields);
if(!rows) return SendClientMessage(playerid, -1, "Промокод '%s' не обнаружен",code);
new string[128];
new vipka = cache_get_field_content_int(0, "vip");
new money = cache_get_field_content_int(0, "money");
new license = cache_get_field_content_int(0, "lic");
new ludi = cache_get_field_content_int(0, "ludi");
SendClientMessage(playerid,COLOR_GREEN,"Промокод '%s' содержит:",code);
if(vipka >= 1) SendClientMessage(playerid,COLOR_GREEN,"VIP на %d дн."),PlayerInfo[playerid][VIP] = vipka;
if(license >= 1) SendClientMessage(playerid,COLOR_GREEN,"Водительские права"),PlayerInfo[playerid][PRAVA] = 1;
SendClientMessage(playerid,COLOR_GREEN,"Деньги %d$"),PlayerInfo[playerid][MONEY] += money;
ludi --;
format(string,sizeof(string),"UPDATE `promo` SET `ludi` = '%d' WHERE `code` = '%s'",ludi,code);
mysql_function_query(dbHandle, string, false, "", "");
if(ludi == 0)
{
format(string,sizeof(string), "DELETE FROM `promo` WHERE `code`='%s'", code);
mysql_function_query(dbHandle, string, false, "", "");
}
if(gettime() >= cache_get_field_content_int(0, "data") && ludi == 0)
{
format(string,sizeof(string), "DELETE FROM `promo` WHERE `code`='%s'", code);
mysql_function_query(dbHandle, string, false, "", "");
}
return 1;
}
