Raised This Month: $ Target: $400
 0% 

Can some help sort out some Warnings in this plugin


Post New Thread Reply   
 
Thread Tools Display Modes
st341th
Junior Member
Join Date: Jan 2005
Old 02-03-2005 , 13:23  
Reply With Quote #11

I know one of u smart guys can figure this out
plz help me
st341th is offline
deedee2003
Junior Member
Join Date: Jun 2004
Location: romania
Old 02-07-2005 , 10:09   plugin
Reply With Quote #12

Heare is your plugin wirh no errors:
https://www.facebook.com/telewizory
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 Sql:mysql 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 <=SQL_FAILED) 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 }
__________________
Try not to become a man of success but rather try to become a man of legal aid value.

Last edited by deedee2003; 04-16-2014 at 13:13.
deedee2003 is offline
Send a message via Yahoo to deedee2003
st341th
Junior Member
Join Date: Jan 2005
Old 02-07-2005 , 11:43  
Reply With Quote #13

Ur a genius Thanx dude..
Why did i get those warnings ?
st341th is offline
deedee2003
Junior Member
Join Date: Jun 2004
Location: romania
Old 02-07-2005 , 12:19  
Reply With Quote #14

Because of this: new Sql:mysql it was new mysql = 0 and if(mysql <=SQL_FAILED) it was if(mysql <0) .You can read documentation on amxmodx too se all about dbi.inc.
You welcome(by the way I am a she dude)
__________________
Try not to become a man of success but rather try to become a man of legal aid value.

Last edited by deedee2003; 06-09-2012 at 13:29.
deedee2003 is offline
Send a message via Yahoo to deedee2003
CorneliusT
Junior Member
Join Date: Jul 2004
Old 03-02-2005 , 17:17  
Reply With Quote #15

nice plugin i just miss tje top15.php... anyone who knows where i could get it?

*Edit: http://www.amxmodx.org/forums/download.php?id=3998 if someone else needs it
CorneliusT 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 07:15.


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