can someone tell me why this doesnt work properly?
when i test it with just one person( my self ) it works because im slot #1 but when someone else is in slot #1 it doesnt work.
its suposed to connect to a SQL DB then loop through all players STEAMIDs on the server and compare then with ones located in the admins table.
if it one matches it shud print Alias Name then STEAMID followed by Real Name
ie
Player??? STEAM123 Dave
Code:
public checkAdmin(id){
if (!(get_user_flags(id)&ADMIN_KICK)){
console_print(id,"You have no access to that command")
return PLUGIN_HANDLED
}
new players[32],inum, auth[32],name[32],playerid[32], playername[32]
if(!get_playersnum()){
console_print(id,"No Players Found")
return PLUGIN_HANDLED
}
get_players(players,inum)
result = dbi_query(dbc,"SELECT * FROM admins")
console_print(id,"Admins On Server")
for (new i=0;i<=dbi_num_rows(result);i++) {
dbi_nextrow(result)
dbi_result(result,"auth",auth,31)
get_user_authid(players[i],playerid,31)
get_user_name(players[i],playername,31)
if ( equal(auth,playerid)){
dbi_result(result,"name",name,31)
console_print(id,"%s %s = %s",playername,playerid,name)
}
}
dbi_free_result(result)
return PLUGIN_HANDLED
}
think its to do with the loop
__________________