Raised This Month: $ Target: $400
 0% 

[help plz] tag mismatch


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 02-18-2009 , 12:25   Re: [help plz] tag mismatch
Reply With Quote #2

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <dbi>
#include <fun>

new Sql:g_SqlConnection
new g_Error[512]



public 
plugin_init() {
    
register_plugin("Donate HP SQL","0.1","aTei")
    
    new 
Host[64],User[64],Pass[64],Db[64]
    
get_cvar_string("amx_sql_host",Host,63)
    
get_cvar_string("amx_sql_user",User,63)
    
get_cvar_string("amx_sql_pass",Pass,63)
    
get_cvar_string("amx_sql_db",Db,63)
   
    
g_SqlConnection dbi_connect(Host,User,Pass,Db,g_Error,511)
    if(
g_SqlConnection SQL_OK)
       
set_fail_state(g_Error)

    if (!
g_SqlConnection)
    {
       
console_print(0,"[Donate HP] Can't connect to DB!")
    }
       
    
dbi_query(g_SqlConnection,"CREATE TABLE IF NOT EXISTS donate_hp (steamid text,hp INT(11))")
}


public 
client_putinserver (id){
    new 
steamid[38]
    
get_user_authid(idsteamid37)
    new 
Result:result dbi_query(g_SqlConnection"SELECT * FROM donate_hp WHERE steamid = '%s'"steamid);
    if (
result != RESULT_FAILED){
       new 
db_hp dbi_field(result,2)
       
set_user_health(iddb_hp)    
    }
    return 
PLUGIN_CONTINUE

Compiles with no warnings now

The run-time error you are getting is because your connection details are incorrect. I would also recommend using SQLx and PCVARs
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou 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 17:00.


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