Raised This Month: $ Target: $400
 0% 

Top15 in MYSQL


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
dEMolite
Member
Join Date: Feb 2006
Old 10-02-2006 , 21:07   Top15 in MYSQL
Reply With Quote #1

Hi Guys everyone ones the Climbtimer 15 the kreedz plugin.
Atm i'm working on a Top15 in MYSQL but i only want to save the first place in mysql and it won't work :/ Maybe u have some ideas?
Code:
public save_top15() {
	new pathname[128]
	get_cvar_string("amx_climbtimer_path",pathname,127)
	
	new mapname[64] 
	get_mapname(mapname,63) 
	
	new filename[128]	
	format(filename, 127, "%s/%s-top15.txt", pathname, mapname)
	
	if( file_exists(filename) )  
		delete_file(filename)
	
	for( new i = 0; i < 15; i++ ) {
		if( top15_times[i] == CT_MAX_TIME )
			return 
		
		new number[192]
		num_to_str(top15_times[i],number,191)
		
		write_file(filename, top15_authid[i])
		write_file(filename, top15_names[i])		
		write_file(filename, number)
		for (new w = 0; w < 1; w++) {
			dbi_query(dbc,"INSERT INTO `top15` ( `map` , `jumper` , `steamid` , `time`) VALUES ( '%s', '%s', '%s' , '%d:%02d')", mapname, top15_names[w], top15_authid[w], number )
		}
	}
	return
}
dEMolite is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 10-02-2006 , 21:52   Re: Top15 in MYSQL
Reply With Quote #2

Code:
	for( new i = 0; i < 15; i++ ) {
->
Code:
	for( new i = 0; i < 1; i++ ) {
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
dEMolite
Member
Join Date: Feb 2006
Old 10-02-2006 , 22:09   Re: Top15 in MYSQL
Reply With Quote #3

After that he will only safe one person in the text. But i want to save 15 in the a txt file to show it in game and online 1 for a stats system like this:
http://www.climbers-germany.de/topjumpers.php

/edit O.M.G im so stupid it was every easy i settet the for w wrong it must be like this:

Code:
public save_top15() {
	new pathname[128]
	get_cvar_string("amx_climbtimer_path",pathname,127)
	
	new mapname[64] 
	get_mapname(mapname,63) 
	
	new filename[128]	
	format(filename, 127, "%s/%s-top15.txt", pathname, mapname)
	
	if( file_exists(filename) )  
		delete_file(filename)
	
	for( new i = 0; i < 15; i++ ) {
		if( top15_times[i] == CT_MAX_TIME )
			return 
		
		new number[192]
		num_to_str(top15_times[i],number,191)
		
		write_file(filename, top15_authid[i])
		write_file(filename, top15_names[i])		
		write_file(filename, number)
	}
	for (new w = 0; w < 1; w++) {
		dbi_query(dbc,"INSERT INTO `top15` ( `map` , `jumper` , `steamid` , `time`) VALUES ( '%s', '%s', '%s' , '%d:%02d')", mapname, top15_names[w], top15_authid[w], number )
	}
	return
}

damn it won't work forwards :/ have anyone an idea?

Last edited by dEMolite; 10-03-2006 at 00:12.
dEMolite is offline
dEMolite
Member
Join Date: Feb 2006
Old 10-03-2006 , 14:07   Re: Top15 in MYSQL
Reply With Quote #4

Have nobody an idea? why it isn'T working?
dEMolite is offline
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 10-04-2006 , 00:25   Re: Top15 in MYSQL
Reply With Quote #5

shouldn't you use w < 15 instead of w < 1
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
dEMolite
Member
Join Date: Feb 2006
Old 10-04-2006 , 12:43   Re: Top15 in MYSQL
Reply With Quote #6

i can use that too but it wont work the dbi_query won't set.
dEMolite 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 04:45.


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