Raised This Month: $ Target: $400
 0% 

One thing with SQLx


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Rixorster
Senior Member
Join Date: Jul 2005
Old 01-05-2007 , 14:33   One thing with SQLx
Reply With Quote #1

So i'm trying out SQLx at the moment, so i used Hawk552's example of that 'Core' thingy (His last example on the topic).
So, i got an function like this:
Code:
public hrp_is_job(id,authid) {     SQL_ThreadQuery(sql_get_handle(),"QueryHandle","SELECT job FROM users WHERE steamid='%s'",authid) } public QueryHandle(FailState,Handle:Query,Error[],Errcode,Data[],DataSize) {     //Thanks Hawk552 <3     if(FailState == TQUERY_CONNECT_FAILED)         return set_fail_state("[HRPi]SQL Connection Failed.")     else if(FailState == TQUERY_QUERY_FAILED)         return set_fail_state("[HRPi]Query failed.")         if(Errcode)         return log_amx("[HRPi]Error on query: %s",Error)         server_print("[HRPi] SQL Connection Successfull!")     return Handle:Query }
And, i'm calling that function with this:
Code:
    if(!hrp_is_job(id,authid) >= 2 && !hrp_is_job(id,authid) <= 11)     {         client_print(id,print_chat,"You must be an Police for the Tazer to work!")         return PLUGIN_HANDLED     }
SQL_ThreadQuery gives an error of the authid thing, but isn't that how it's supposed to be so it would work?

Also, I think i should have an 'return (something)' in 'public hrp_is_job' to return the value of the job, but what should i return?

Any help would be nice :/
__________________
You never know, what will happen the day after tomorrow...

+karma if i helped you!
Rixorster is offline
 


Thread Tools
Display Modes

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 22:27.


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