Raised This Month: $ Target: $400
 0% 

Truncating Variables?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Migs Davis
Junior Member
Join Date: Mar 2006
Location: Wilton, CT
Old 04-07-2006 , 12:39   Truncating Variables?
Reply With Quote #1

I'm making a custom plugin, needs to store steam ids and usernames to mysql database (when I get these two things down everythign else will be cake) but it truncates their steamid somewhere along the code...


Code:
#include <amxmodx> #include <amxmisc> #include <dbi> #define PLUGIN "SteamId Manager" #define VERSION "1.0" #define AUTHOR "Migs Davis" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR) } public client_connect(id) {     new user[20], len     new Sql:idList new steamId[20] new Result:checkExist new Result:addId new Result:addName idList = dbi_connect ( "host", "username", "password", "table")     if (idList < SQL_OK)     {         new err[255]         new errNum = dbi_error(idList, err, 254)         server_print("error1: %s|%d", err, errNum)     }     get_user_authid(id, steamId, 20)     server_print("Their steam ID is: %s", steamId)     //while (steamId[9]=='P')     //get_user_authid(id, steamId[], 20)     checkExist = dbi_query ( idList, "SELECT * FROM list WHERE (steamid) = ('%s')", steamId)     if (checkExist <= RESULT_NONE) {                 len = get_user_name(id,user[0],30)     server_print("Not in our database yet, %s", steamId)     addId = dbi_query(idList, "INSERT INTO list (name, steamid) values ('%s', '%d')", steamId, user)                 //These are reversed but whats strange is that it doesn't reverse them in the database         //addName = dbi_query(idList, "UPDATE list SET name='%d' WHERE steamid='%s'", user, steamId)         console_print(id, "You should be succesfully added")         dbi_free_result(addId)     }         server_print("%s is in our database under %d", user, steamId)         dbi_free_result(addName)     dbi_free_result(checkExist)         dbi_close ( idList ) }

(sorry for the somewhat messed up indents I've been up for a day or 3)

This is the server output:
Quote:
Their steam ID is: STEAM_0:1:9834747
Not in our database yet, STEAM_0:1:9834747
[ css:um ] Migs Davis is in our database under 83
This is the created fields in the table:
(^^i actually think thats correct grammar, one example, many fields?)
<list>
<name>[ css:um ] Migs Davis</name>
<id>29</id>
<steamid>83</steamid>
<roundsplayed>0</roundsplayed>
<posts>0</posts>
<css>0</css>
<blazed>0</blazed>
<zero>0</zero>
<admin>not</admin>
</list>
(of course everytime I connect it copies.)
__________________
www.kdoubt.net - CS Syndicate website
------
(they need website hits \/\/\/)
www.awesomejon.com - friend's site (check galleries)
www.jednet.com - Friends website (check galleries)
www.djpeak.net - DJ website
Migs Davis is offline
Send a message via AIM to Migs Davis
 


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 16:48.


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