CMD:kick(playerid, params[])
{
new command[8] = "cmdkick";
new cmdlevel;
mysql_format(Mysql_users, query, sizeof(query), "SELECT * FROM `commands` WHERE `command` = '%s'", command);
mysql_tquery(Mysql_users, query, "", "");
printf("%s", query);
cmdlevel = cache_get_field_content_int(0, "adminlevel", Mysql_users);
printf("%s", cmdlevel);
if(PlayerData[playerid][AdminLevel] < cmdlevel) return SendUnathorizedMessage(playerid);
CMD:kick(playerid, params[])
{
new command[8] = "cmdkick";
new cmdlevel;
mysql_format(Mysql_users, query, sizeof(query), "SELECT * FROM `commands` WHERE `command` = '%s'", command);
mysql_query(Mysql_users, query);
mysql_store_result();
new rows = mysql_num_rows(); //We get how many rows the query returned.
if(rows)
{
//it found something
printf("%s", query);
cmdlevel = cache_get_field_content_int(0, "adminlevel", Mysql_users);
printf("%s", cmdlevel);
if(PlayerData[playerid][AdminLevel] < cmdlevel) return SendUnathorizedMessage(playerid);
}
new command[8] = "cmdkick";
new cmdlevel;
mysql_format(Mysql_users, query, sizeof(query), "SELECT * FROM `commands` WHERE `command` = '%s'", command);
mysql_query(Mysql_users, query);
new rows = cache_num_rows();
if(rows) {
cmdlevel = cache_get_field_content_int(0, "adminlevel", Mysql_users);
}
The newest release is only for threaded scripts. That means you cannot use old functions like mysql_store_result and mysql_query
|