Raised This Month: $ Target: $400
 0% 

Codes not workin, anyone help?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
cssryan
Junior Member
Join Date: Feb 2005
Old 03-04-2006 , 12:29   Codes not workin, anyone help?
Reply With Quote #1

OK well first off, this is a part of the code put into a plugin. Does anyone know WHY it won't work? And how to fix it?

Code:
		{
			// Set 'username' in mYSQL
			new uName[64], uSteam[64], uQuery[256], uQuery_2[256]
			get_user_name(id, uName, 63)
			get_user_authid(id, uSteam, 63)

			format(uQuery,255,"SELECT username FROM money WHERE steamid='%s'", uSteam)
			result = dbi_query(dbc, uQuery)
			if( result == RESULT_NONE ) {
				server_print( "[Bleh] No Username Found In mySQL!" )
				server_print( "[Bleh] Debug Info: uName: %s  -  uSteam: %s", uName, uSteam )
			} else if( result <= RESULT_FAILED ) {
				server_print( "[Bleh] Setting Username In mySQL . . . FAILED !" )
				server_print( "[Bleh] Debug Info: uName: %s  -  uSteam: %s", uName, uSteam )
			} else {
				format(uQuery_2,255,"UPDATE money SET username='%' WHERE steamid='%'", uName, uSteam)
				result = dbi_query(dbc, uQuery_2)

				server_print( "[Bleh] Setting Username In mySQL. . . COMPLETE!" )
				server_print( "[Bleh] Debug Info: uName: %s  -  uSteam: %s", uName, uSteam )
			}

			dbi_free_result(result)
			return PLUGIN_HANDLED
		}
	}
Any ideas?
cssryan is offline
P34nut
AMX Mod X Beta Tester
Join Date: Feb 2006
Location: Netherlands
Old 03-04-2006 , 12:47  
Reply With Quote #2

you type:
Code:
format(uQuery_2,255,"UPDATE money SET username='%' WHERE steamid='%'", uName, uSteam)

change that to
Code:
format(uQuery_2,255,"UPDATE money SET username='%s' WHERE steamid='%s'", uName, uSteam)
__________________
All you need to change the world is one good lie and a river of blood
P34nut is offline
Des12
Senior Member
Join Date: Jan 2005
Old 03-04-2006 , 12:47  
Reply With Quote #3

Code:
 format(uQuery_2,255,"UPDATE money SET username='%s' WHERE steamid='%s'", uName, uSteam)
__________________
-Dest Romano

www.JustRP.com
A TSRP Server

Quote:
Originally Posted by Brad
Don't you go be bringing reality into this.
Des12 is offline
cssryan
Junior Member
Join Date: Feb 2005
Old 03-04-2006 , 12:52  
Reply With Quote #4

Thank you, I should look over my code next time :/
cssryan is offline
Reply


Thread Tools
Display Modes

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 20:14.


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