Raised This Month: $ Target: $400
 0% 

DBI codeing problem


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
lucky109
Senior Member
Join Date: Jan 2005
Old 04-09-2006 , 17:16   DBI codeing problem
Reply With Quote #1

Quote:
new const PLUGINNAME[] = "test"
new const VERSION[] = "test"
new const AUTHOR[] = "test"

#include <amxmodx>
#include <dbi>

new Sql:dbc
new Result:result

public plugin_init() {
register_plugin(PLUGINNAME, VERSION, AUTHOR)
set_task(Float:10.0,"sql_init")
}

public sql_init() {
new host[64], username[32], password[32], dbname[32], error[32]

get_cvar_string("amx_sql_host",host,64)
get_cvar_string("amx_sql_user",username,32)
get_cvar_string("amx_sql_pass",password,32)
get_cvar_string("amx_sql_db",dbname,32)

dbc = dbi_connect(host,username,password,dbname,err or,32)

if (dbc == SQL_FAILED)
log_amx("SQL Connection Failed")
else
dbi_query(dbc,"CREATE TABLE IF NOT EXISTS `test` (`value` varchar(20) NOT NULL)")
}

public client_putinserver(id) {
result = dbi_query(dbc,"SELECT value FROM test")
dbi_free_result(result)
new userinfo[64]
new name[32]
get_user_name(id,name,31)
get_user_info(id,"ABC",userinfo,63)
if(equal(userinfo,"%s"))
{
}
else {
server_cmd("kick #%d ^"%L^"",get_user_userid(id),LANG_SERVER,"kick _reson")
}
}

what's wrong?
kicked by server if i'm using setinfo "ABC" "1"

help me please thanks~
Attached Images
File Type: png aaaa.png (2.3 KB, 264 views)
lucky109 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:40.


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