Mysql help
#1

Hello all. I'am creating VIP system with time.
There is vip check code:
Код HTML:
stock VipCheck2(playerid)
{
format(jQuery, MAX_QUERY_LENGTH, "SELECT Vipas TIMESTAMPDIFF(MINUTE, NOW(), DATE_ADD(Timesta, INTERVAL Time MINUTE)) FROM vips WHERE Vipas = '%s' AND (NOW() <= DATE_ADD(Timesta, INTERVAL Time MINUTE) OR ban_time = 0)", pName(playerid));
mysql_query(jQuery);
mysql_store_result();
new vipas[MAX_PLAYER_NAME],vTime,vresult[1000];
  if(mysql_num_rows() < 1)
  {
   mysql_fetch_row(vresult);
   j_sscanf(vresult, "p|si", vipas, vTime);
   PlayerInfo[playerid][pVip] = false;
SendClientMessage(playerid, COLOR_RED,"Jus pasibaige vip galiojimas");
format(jQuery,MAX_QUERY_LENGTH,"DELETE FROM vips WHERE Vipas='%s'",pName(playerid));
mysql_query(jQuery);
}
return 1;
}
I create 1 minute timer and I put this code.
I put a 100 minutes, but after one minute my VIP is false...
Can anyone help me?
Reply
#2

Why is vresult a 1000? How long is your query length by the way?
Reply
#3

Here is a simple version of the learning
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)