Raised This Month: $ Target: $400
 0% 

[help plz] tag mismatch


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Dr.G
Senior Member
Join Date: Nov 2008
Old 02-18-2009 , 12:45   Re: [help plz] tag mismatch
Reply With Quote #3

hehe yea sqlx is better it would be something like this i think NOT TESTED

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <sqlx>
#include <fun>
new Host[64],User[64],Pass[64],Db[64]
new 
error[256], errorcode
new Handle:sql_makedbtuple
new Handle:sql_connect
public plugin_init() 
{
 
register_plugin("Donate HP SQL","0.1","aTei")
 
 
 
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)
 
 
 
sql_makedbtuple SQL_MakeDbTuple(Host,User,Pass,Db)
 
sql_connect SQL_Connect(sql_makedbtupleerrorcodeerror255)
 
 
 if (!
sql_connect)
 {
  
log_amx("[Donate HP]Error (%d): %s"errorcodeerror)
  
set_fail_state("[Donate HP] Can't connect to DB!")
  
console_print(0,"[Donate HP]Error (%d): %s"errorcodeerror)
  return 
PLUGIN_HANDLED
 
}
 
 new 
Handle:query SQL_PrepareQuery(sql_connect,"CREATE TABLE IF NOT EXISTS donate_hp (steamid text,hp INT(11))")
 
SQL_Execute(query)
 
 
SQL_FreeHandle(query)
 return 
PLUGIN_HANDLED
}
 
public 
client_putinserver (id)
{
 new 
steamid[38]
 new 
result
 get_user_authid
(idsteamid37)
 
 new 
Handle:query SQL_PrepareQuery(sql_connect"SELECT * FROM donate_hp WHERE steamid = '%s'"steamid)
 
SQL_Execute(query)
 
 if (
SQL_MoreResults(query))
 
 
result SQL_ReadResult(query2)
 
 
SQL_FreeHandle(query)
 
 if(
result 0)
 {
  new 
db_hp SQL_ReadResult(query2)
  
set_user_health(iddb_hp)    
 }
 return 
PLUGIN_CONTINUE

__________________
Dr.G 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