Raised This Month: $ Target: $400
 0% 

amxmodx 1.01 plugin using dbi


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
onosrider
Member
Join Date: Jul 2005
Old 09-11-2005 , 20:51   amxmodx 1.01 plugin using dbi
Reply With Quote #1

hi,

ill try to write my own plugin but im not sure about the code and it wont compile ... some errors in line 26. i downt know anything about small and the code but i hope it isent all false what i have written.

my try is a stats output for psychostats to lern and understand the code.

i hope some one will help me

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

#define mysql_host	"127.0.0.1"
#define mysql_user	"user"
#define mysql_pass	"pass"
#define mysql_db	"psychostats"

public CheckMySats(id)
{

new authid[34], username[65], rank[10]

get_user_authid ( id, authid, 33 )
get_user_name ( id, username, 65 )

dbi_connect ( mysql_host, mysql_user, mysql_pass, mysql_db )
dbi_query ( "SELECT rank FROM pstats_plr WHERE wordid='%s'", authid )

if( dbi_query == RESULT_FAILED )
  client_print(id,print_chat,"[STATS] You are not RANKED yet!", username )
  return PLUGIN_HANDLED

dbi_field( dbi_query, rank, 10 )

client_print( id, print_chat, "[STATS] %s is RANK %s", username, rank )

dbi_close()

return PLUGIN_CONTINUE 
}

public plugin_init() 
{ 
	register_plugin( "Statstest", "0.0.1", "myownhand" )
	register_clcmd( "say /rank", "CheckMySats" )
	return PLUGIN_CONTINUE 
}

and the error line 26 is this part

Code:
dbi_field( dbi_query, rank, 10 )
thanks
onosrider 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 14:21.


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