AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Code help plz (https://forums.alliedmods.net/showthread.php?t=56052)

XyXEL 06-05-2007 13:08

Code help plz
 
Hello,

i just wanted to customize this stats script
http://forums.alliedmods.net/showthread.php?t=23010
but i decided to rewrite it completely.

this is my first real contact with amxx scripting so i do not know if there a any logic error. I fixed all errors shown by the web compiler... there is still this warning:

Quote:

/home/groups/amxmodx/tmp3/phpfTOGdk.sma(42) : warning 204: symbol is assigned a value that is never used: "error"
well this is my rewritten code:
Are there any fatal errors?
[php]#include <amxmodx>
#include <amxmisc>
#include <sqlx>
#include <engine>

#define PLUGIN "Total Kills On Server"
#define VERSION "1.0"
#define AUTHOR "Sonic remaked by XyXEL"

new Handle:g_SqlTuple
new g_Error[512]

public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("DeathMsg","death","a")
new error[33], hostname[64], sqluser[64], sqlpass[64], sqldb[64]
get_cvar_string("amx_sql_host", hostname, 63)
get_cvar_string("amx_sql_db", sqldb, 63)
get_cvar_string("amx_sql_pass", sqlpass, 63)
get_cvar_string("amx_sql_user", sqluser, 63)
register_clcmd("say /skill", "XySkill", 0, "- Displays your server ranking")
//register_clcmd("say /top15", "XyTop", 0, "- Displays the servers top 15 players")

}

Alka 06-05-2007 14:31

Re: Code help plz
 
Here
Code:
new error[33], hostname[64], sqluser[64], sqlpass[64], sqldb[64]
,delete
Code:
error[33]
because you dont use it! :wink:

XyXEL 06-05-2007 14:50

Re: Code help plz
 
well, yes, thats true ^^ thx

hope the script wont crash my server, going to test it now

v3x 06-05-2007 15:31

Re: Code help plz
 
It's just a warning, not an error. The plugin still compiled fine ;)

XyXEL 06-05-2007 16:24

Re: Code help plz
 
Quote:

L 06/05/2007 - 22:22:30: [AMXX] Plugin ("xyxelstats.amxx") is setting itself as failed.
L 06/05/2007 - 22:22:30: [AMXX] Plugin says: Column count doesn't match value count at row 1
L 06/05/2007 - 22:22:30: [AMXX] Run time error 1 (plugin "xyxelstats.amxx") - forced exit
why? whats my mistake?

v3x 06-05-2007 16:27

Re: Code help plz
 
Show us the code, please.

XyXEL 06-05-2007 16:31

Re: Code help plz
 
i got the error..... it was a wrong sql query... it put only 3 values in db, but must be 4

XyXEL 06-05-2007 18:10

Re: Code help plz
 
well.... i just finished and fixed some bugs.

it now logs the kills and deaths of each player and a player can see his rank by typing /rank and the top 10 player by typing /top10

to show the top10 i use a phpscript which can be included in a html frame by the motd.

it all works quite fine.


All times are GMT -4. The time now is 10:42.

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