Raised This Month: $ Target: $400
 0% 

One problem


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
conrad
Junior Member
Join Date: Jun 2007
Old 11-17-2007 , 05:28   One problem
Reply With Quote #1

Hello guys.
I have problem with my script.
Source:

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

#define PLUGIN "plugin"
#define VERSION "1.0"
#define AUTHOR "By conrad"

new Sql:dbc;
new Result:res;

public plugin_init() {
 register_plugin(PLUGIN, VERSION, AUTHOR)
 register_dictionary("csbank.txt")
 register_clcmd("say /money", "saymoney", 0, "- displays hoe much money I have ")
 
 // Add your code here...
}


public sql_init() 
{

dbc = dbi_connect("localhost", "login", "password", "db")
    
    if (dbc == SQL_FAILED)
    {
        server_print("[AMXX] %L", LANG_SERVER, "SQL_SERVER_DOWN")
    }
    else
    {
       server_print("[AMXX] %L", LANG_SERVER, "SQL_SERVER_UP")
    }
     
}


public saymoney(id)
{
  new szAuthid[32], szName[32], szMoney[32];
  get_user_authid( id, szAuthid, 31 );
  get_user_name( id, szName, 31 );
 

res = dbi_query(dbc, "SELECT `money` FROM table where name='%s' ", szName); 


 while (dbi_nextrow(res) > 0)
 {  
  dbi_result(res, "money", szMoney, 31)
 }
 


client_print(0,print_chat, szMoney);
 
}
It doesn't return any result back. What is the problem?
conrad 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 01:12.


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