rowcount check

This commit is contained in:
jenzur 2020-04-14 01:06:36 +02:00
parent ef103951d2
commit 8f064c9e40

View File

@ -411,13 +411,16 @@ public void mysql_enable_disable_poll(int iclient6, char []table_name_enable)
delete rs_disable;
return;
}
rs_disable.FetchRow();
int status = rs_disable.FetchInt(0);
delete rs_disable;
if (status)
PrintToChat(iclient6, "Enabled poll %s", table_name_enable);
else
PrintToChat(iclient6, "Disabled poll %s", table_name_enable);
if (rs_disable.RowCount > 0)
{
rs_disable.FetchRow();
int status = rs_disable.FetchInt(0);
delete rs_disable;
if (status)
PrintToChat(iclient6, "Enabled poll %s", table_name_enable);
else
PrintToChat(iclient6, "Disabled poll %s", table_name_enable);
}
editpoll(iclient6, table_name_enable);
}
@ -687,22 +690,25 @@ public void mysql_playtime_requirement(int client, char []info)
delete rs;
return;
}
int playtime;
rs.FetchRow();
playtime = rs.FetchInt(0);
PrintToChat(client, "playtime required: %i", playtime);
admin_editing[client] = 7;
Menu menu = new Menu(editpollmenu, MENU_ACTIONS_ALL);
menu.SetTitle("Poll %s has playtime requirement: %i", "", info, playtime);
menu.AddItem("0", "0 hours playtime requirement");
menu.AddItem("5", "5 hours playtime requirement");
menu.AddItem("10", "10 hours playtime requirement");
menu.AddItem("25", "25 hours playtime requirement");
menu.AddItem("50", "50 hours playtime requirement");
menu.AddItem("250", "250 hours playtime requirement");
menu.AddItem("1000", "1000 hours playtime requirement");
menu.ExitButton = true;
menu.Display(client, MENU_TIME_FOREVER);
if (rs.RowCount > 0)
{
int playtime;
rs.FetchRow();
playtime = rs.FetchInt(0);
PrintToChat(client, "playtime required: %i", playtime);
admin_editing[client] = 7;
Menu menu = new Menu(editpollmenu, MENU_ACTIONS_ALL);
menu.SetTitle("Poll %s has playtime requirement: %i", "", info, playtime);
menu.AddItem("0", "0 hours playtime requirement");
menu.AddItem("5", "5 hours playtime requirement");
menu.AddItem("10", "10 hours playtime requirement");
menu.AddItem("25", "25 hours playtime requirement");
menu.AddItem("50", "50 hours playtime requirement");
menu.AddItem("250", "250 hours playtime requirement");
menu.AddItem("1000", "1000 hours playtime requirement");
menu.ExitButton = true;
menu.Display(client, MENU_TIME_FOREVER);
}
delete rs;
}