Raised This Month: $ Target: $400
 0% 

dbi_query error


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
slurpycof
Senior Member
Join Date: Nov 2004
Old 03-26-2006 , 23:31  
Reply With Quote #2

Code:
format(query,255,"SELECT steamid, reason, time FROM tempbans")

should be

Code:
format(query,255,"SELECT steamid, reason, time FROM tempbans WHERE steamid = '%s'",authid)

That would make it run cleaner. I would also suggest you use

public client_authorized(id){

to do the check so that you know the player has a steam id.

++edit++
Try this code
Code:
new Sql:dbc new Result:result // ... public client_authorized(id) {     new authid[32]     get_user_authid(id, authid, 31)     result = dbi_query(dbc,"SELECT steamid, reason, time FROM tempbans WHERE steamid = '%s'",authid)     if (dbi_num_rows(result) < 1) //not in db     {         return PLUGIN_CONTINUE     }     else     { //get the info from the database         dbi_nextrow(result)         new reason[101], var;         dbi_result(result, "reason" , reason , 100)         var = dbi_result(result, "time")         new name[32]         get_user_name(id,name,31)         client_print(0,print_chat,"[AMXX] %s (%s) is still banned for %i minutes",name,authid,var)         server_cmd("kick #%d ^"%s (%i minutes left in ban)^"",get_user_userid(id),reason,var)         return PLUGIN_CONTINUE     }             dbi_free_result(result)         return PLUGIN_CONTINUE }
slurpycof is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:30.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode