29.06.2013, 10:48
New problem:
This only works if the banlog has 1 row. how would I loop through all rows and set the value?
pawn Код:
CheckPlayerSuspended(playerid)
{
new str[128], ans;
format(str,sizeof(str),"SELECT * FROM kick_ban_jail_log WHERE type = 1 AND username = '%s'",pName(playerid));
mysql_query(str);
mysql_store_result();
new row[256]; // The length of 1 'row' total.
new field[9][128]; // [4] = Amount of fields, [24] = Max length of the bigest field.
mysql_fetch_row(row, "|");
explode(row, field, "|");
new day,month,year;
getdate(year,month,day);
if(year <= strval(field[8]))
{
if(month < strval(field[7])) ans = 1;
else if(month == strval(field[7]) && day < strval(field[6])) ans = 1;
else ans = 0;
}
else ans = 0;
mysql_free_result();
return ans;
}

