Raised This Month: $ Target: $400
 0% 

Code help plz


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
XyXEL
Junior Member
Join Date: Jun 2007
Old 06-05-2007 , 13:08   Code help plz
Reply With Quote #1

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")

}

Last edited by XyXEL; 06-05-2007 at 18:06.
XyXEL is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 06-05-2007 , 14:31   Re: Code help plz
Reply With Quote #2

Here
Code:
new error[33], hostname[64], sqluser[64], sqlpass[64], sqldb[64]
,delete
Code:
error[33]
because you dont use it!
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
XyXEL
Junior Member
Join Date: Jun 2007
Old 06-05-2007 , 14:50   Re: Code help plz
Reply With Quote #3

well, yes, thats true ^^ thx

hope the script wont crash my server, going to test it now
XyXEL is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 06-05-2007 , 15:31   Re: Code help plz
Reply With Quote #4

It's just a warning, not an error. The plugin still compiled fine ;)
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
XyXEL
Junior Member
Join Date: Jun 2007
Old 06-05-2007 , 16:24   Re: Code help plz
Reply With Quote #5

Quote:
L 06/05/2007 - 22:220: [AMXX] Plugin ("xyxelstats.amxx") is setting itself as failed.
L 06/05/2007 - 22:220: [AMXX] Plugin says: Column count doesn't match value count at row 1
L 06/05/2007 - 22:220: [AMXX] Run time error 1 (plugin "xyxelstats.amxx") - forced exit
why? whats my mistake?
XyXEL is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 06-05-2007 , 16:27   Re: Code help plz
Reply With Quote #6

Show us the code, please.
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
XyXEL
Junior Member
Join Date: Jun 2007
Old 06-05-2007 , 16:31   Re: Code help plz
Reply With Quote #7

i got the error..... it was a wrong sql query... it put only 3 values in db, but must be 4
XyXEL is offline
XyXEL
Junior Member
Join Date: Jun 2007
Old 06-05-2007 , 18:10   Re: Code help plz
Reply With Quote #8

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.
XyXEL 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 10:42.


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