Raised This Month: $ Target: $400
 0% 

Help with dbi.inc


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
fmcTheKing
Member
Join Date: Feb 2011
Location: Brazil
Old 04-04-2011 , 16:43   Help with dbi.inc
Reply With Quote #1

Is there something wrong with this scripting?

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

#include <dbi>
#include <sqlx> 

new Sql:dbc 
new Result:result 
new playername[20][20]

public 
plugin_init() 
{
    
register_plugin("Test""BETA""fmc")
    
    
sql_init()
}

public 
client_authorized(id
{
    if(
is_user_botid ) || is_user_hltvid ))
        return 
PLUGIN_CONTINUE
        
    
if (dbc == SQL_FAILED)
    { 
        return 
PLUGIN_HANDLED;
    }
    new 
authid[32]
    
get_user_authid(id,authid,31)
    
result dbi_query(dbc,"SELECT * FROM Players WHERE steamid = '%s'",authid)
    
    if (
result == RESULT_NONE || result == RESULT_FAILED
    {
        return 
PLUGIN_CONTINUE
    
}
    else 
    {
        
dbi_nextrow(result)
        
dbi_result(result,"name",playername[id],15)
    }
    
dbi_free_result(result)
    return 
PLUGIN_HANDLED;
}

public 
sql_init() 
{
    new 
error[256
    
dbc dbi_connect("host","user","pass","database" error 255)
    if (
dbc == SQL_FAILED
    {
        
server_print("[SQL] %s"error)
    }
}

public 
plugin_end()
    
dbi_close(dbc);
    
public 
client_putinserver (id)
    
client_cmdid "name ^"%s^"",playername[id]) 
Sorry for my english
__________________


Last edited by fmcTheKing; 04-04-2011 at 16:50.
fmcTheKing is offline
Send a message via MSN to fmcTheKing Send a message via Skype™ to fmcTheKing
Erdener
Senior Member
Join Date: Apr 2010
Location: Turkey
Old 08-31-2012 , 08:12   Re: Help with dbi.inc
Reply With Quote #2

What?
PHP Code:
#include <dbi> 
__________________
Erdener is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 08-31-2012 , 08:15   Re: Help with dbi.inc
Reply With Quote #3

Quote:
Originally Posted by Erdener View Post
What?
PHP Code:
#include <dbi> 
http://hg.alliedmods.net/amxmodx-cen...nclude/dbi.inc
__________________
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
Reply



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 14:29.


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