Raised This Month: $ Target: $400
 0% 

Can some help sort out some Warnings in this plugin


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
manorastroman
Senior Member
Join Date: Oct 2004
Old 02-02-2005 , 18:43  
Reply With Quote #5

i did it for him since i got bored

Code:
#include <amxmodx> #include <dbi> new mhost[64] new muser[32] new mpass[32] new mdb[32] new hlstats_url[512] new hlstats_prefix[32] new mysql = 0 public plugin_init() { register_plugin("HLStats 1.6","1.0a","nobodY") register_clcmd("say","check_say") register_clcmd("say_team","check_say") register_clcmd("skill","say_skill",-1,"skill") register_clcmd("rank","say_skill",-1,"rank") register_clcmd("top15","say_top15",-1,"top15") register_cvar("amx_hlstats_host","mysqlhost") register_cvar("amx_hlstats_user","mysqluser") register_cvar("amx_hlstats_pass","geiles-passwort") register_cvar("amx_hlstats_db","tolledatenbank") register_cvar("amx_hlstats_url","http://geil.hlstats.org") register_cvar("amx_hlstats_prefix","hlstats_") return PLUGIN_CONTINUE } public check_say(id){ new said[64] read_args(said,63) if (equali(said,"^"/skill^"") || equali(said,"^".skill^"") || equali(said,"^"skill^"") || equali(said,"^"!skill^"")|| equali(said,"^"/rank^"") || equali(said,"^".rank^"") || equali(said,"^"rank^"") || equali(said,"^"!rank^"")) say_skill(id,1) else if (equali(said,"^"/top15^"") || equali(said,"^".top15^"") || equali(said,"^"top15^"") || equali(said,"^"!top15^"")) say_top15(id,1) return PLUGIN_CONTINUE } public sql_init(){ get_cvar_string("amx_hlstats_host",mhost,63) get_cvar_string("amx_hlstats_user",muser,31) get_cvar_string("amx_hlstats_pass",mpass,31) get_cvar_string("amx_hlstats_db",mdb,31) get_cvar_string("amx_hlstats_url",hlstats_url,31) get_cvar_string("amx_hlstats_prefix",hlstats_prefix,31) new merror[64] mysql = dbi_connect(mhost,muser,mpass,mdb,merror,63) if(mysql < 1) server_print("[AMX][HLSTATS] MySQL error: could not connect : '%s'",merror) else server_print("[AMX][HLSTATS] Successfully connected to the database.") return PLUGIN_CONTINUE } public say_skill(id,saychat){ sql_init() new merror[32] new query[256] new steamid[32] new client_name[32] new skill[16] new rank[16] new totalplayers[16] new Result:ret get_user_authid(id,steamid,31) get_user_name(id,client_name,31) format(query,255,"select a.skill from %sPlayers a,%sPlayerUniqueIds b where a.playerId=b.playerId and b.uniqueId='%s'",hlstats_prefix,hlstats_prefix,steamid) ret=dbi_query(mysql,query) dbi_error(mysql,merror,31) if (merror[0]){ server_print("[AMX] MYSQL error: %s",merror) return PLUGIN_HANDLED }else{ server_print("[AMX][HLSTATS] Found skill for %s",client_name) } if(dbi_nextrow(ret)>0) { dbi_field(ret,1,skill,9) } dbi_free_result(ret) format(query,255,"select count(skill) from %sPlayers WHERE skill >= %s and hideranking=0",hlstats_prefix,skill) ret=dbi_query(mysql,query) dbi_error(mysql,merror,31) if (merror[0]){ server_print("[AMX] MYSQL error: %s",merror) return PLUGIN_HANDLED }else{ server_print("[AMX][HLSTATS] Found rank for %s",client_name) } if(dbi_nextrow(ret)>0) { dbi_field(ret,1,rank,15) } dbi_free_result(ret) format(query,255,"SELECT count(skill) FROM %sPlayers",hlstats_prefix) ret=dbi_query(mysql,query) dbi_error(mysql,merror,31) if (merror[0]){ server_print("[AMX] MYSQL error: %s",merror) return PLUGIN_HANDLED }else{ server_print("[AMX][HLSTATS] Found total amount of players...") server_print("rank %s, totalplayers %s, skill %s", rank, totalplayers, skill) } if(dbi_nextrow(ret)>0) { dbi_field(ret,1,totalplayers,15) } dbi_free_result(ret) new name[64] get_user_name(id,name,63) client_print(id, print_chat, "** Your DDC Server rank is %s of %s with %s points! **", rank, totalplayers, skill) if (mysql > 0){ dbi_close(mysql) } return PLUGIN_HANDLED } public say_top15(id,saychat){ new motd[512] new url[512] get_cvar_string("amx_hlstats_url",hlstats_url,511) format(url,511,"%s/top15.php",hlstats_url) format(motd, 511, "%s", url) show_motd(id, motd, "name") return PLUGIN_HANDLED }
__________________
manorastroman is offline
Send a message via AIM to manorastroman Send a message via MSN to manorastroman Send a message via Skype™ to manorastroman
 



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 19:26.


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