Raised This Month: $ Target: $400
 0% 

Can't load more than 99999 from SQL DB.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
NiQu
Veteran Member
Join Date: Nov 2009
Old 08-21-2010 , 05:51   Can't load more than 99999 from SQL DB.
Reply With Quote #1

Hi, im making a plugin and im getting so frustrated over my problem.

Saving works fine but when i load something it seems like it can only store 5 numbers, so it can only store a maximum of 99999.

Thats my problem.

The Variable:
PHP Code:
const MAX_CLIENTS 32;
new 
g_iCash[MAX_CLIENTS 1]; 
Loading:
PHP Code:
Load(client)
{
    static 
query[128];
    
formatex(querysizeof(query) - 1"SELECT `data` FROM `cashmod` WHERE `authid` = '%s';"g_iAuthID[client]);
    
    static 
data[2];
    
data[0] = client;
    
    
SQL_ThreadQuery(g_sql_tuple"QueryLoadData"querydatasizeof(data));

PHP Code:
public QueryLoadData(failstateHandle:queryerror[], errnumdata[], sizeFloat:queuetime)
{
    if( 
failstate == TQUERY_CONNECT_FAILED
    
|| failstate == TQUERY_QUERY_FAILED )
    {
        
set_fail_state(error);
    }
    else
    {
        if( 
SQL_NumResults(query) )
        {
            static 
sqldata[512];
            
SQL_ReadResult(query0sqldatasizeof(sqldata) - 1);
            
ParseLoadData(data[0], sqldata);
        }
        else
        {
            
NewUser(data[0]);
        }
    }

PHP Code:
ParseLoadData(iPlayerdata[512])
{
    static 
num[6];
    
strbreak(datanumsizeof(num) - 1datasizeof(data) - 1);
    
    
g_iCash[iPlayer] = str_to_num(num);
    
    for( new 
iItem 0iItem g_iItemCountiItem++ )
    {
        
strbreak(datanumsizeof(num) - 1datasizeof(data) - 1);
        
g_iItemLevel[iPlayer][iItem] = clamp(str_to_num(num), 0g_iItemMaxLevel[iItem]);
    }
    
    for( new 
iWeap 0iWeap g_iWeapCountiWeap++ )
    {
        
strbreak(datanumsizeof(num) - 1datasizeof(data) - 1);
        
g_iWeapLevel[iPlayer][iWeap] = clamp(str_to_num(num), 0g_iWeapMaxLevel[iWeap]);
    }
    
    
g_loaded_data[iPlayer] = 1;

Can someone please help me fix this problem ?
__________________
My Projects
  • RoTAPI V0.0.1 ------- Private
    • Progress - [||||||||||]
  • CashMod V0.0.6 ----- Public
    • Progress - [||||||||||]
  • CashMod V0.0.7 ----- Public
    • Progress - [||||||||||]
NiQu is offline
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 08-21-2010 , 06:24   Re: Can't load more than 99999 from SQL DB.
Reply With Quote #2

You plugin creates the tables automatic ?
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
NiQu
Veteran Member
Join Date: Nov 2009
Old 08-21-2010 , 06:41   Re: Can't load more than 99999 from SQL DB.
Reply With Quote #3

Yes it does.

name varchar(32)
authid varchar(35)
data varchar(256)
__________________
My Projects
  • RoTAPI V0.0.1 ------- Private
    • Progress - [||||||||||]
  • CashMod V0.0.6 ----- Public
    • Progress - [||||||||||]
  • CashMod V0.0.7 ----- Public
    • Progress - [||||||||||]
NiQu is offline
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 08-21-2010 , 06:52   Re: Can't load more than 99999 from SQL DB.
Reply With Quote #4

'data' is a number ?
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
NiQu
Veteran Member
Join Date: Nov 2009
Old 08-21-2010 , 06:59   Re: Can't load more than 99999 from SQL DB.
Reply With Quote #5

No, it is varchar and the data gets saved like this:

10000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Where the cash is the first value following by all items in my shop.
__________________
My Projects
  • RoTAPI V0.0.1 ------- Private
    • Progress - [||||||||||]
  • CashMod V0.0.6 ----- Public
    • Progress - [||||||||||]
  • CashMod V0.0.7 ----- Public
    • Progress - [||||||||||]
NiQu is offline
Old 08-21-2010, 08:02
lucas_7_94
This message has been deleted by lucas_7_94. Reason: i fail xd.
Seta00
The Seta00 user has crashed.
Join Date: Jan 2010
Location: Berlin
Old 08-21-2010 , 08:17   Re: Can't load more than 99999 from SQL DB.
Reply With Quote #6

Quote:
Originally Posted by lucas_7_94 View Post
i think , i think , the problem is here

PHP Code:
static num[6];
    
strbreak(datanumsizeof(num) - 1datasizeof(data) - 1
LOL
Seta00 is offline
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 08-21-2010 , 08:27   Re: Can't load more than 99999 from SQL DB.
Reply With Quote #7

Quote:
Originally Posted by Seta00 View Post
LOL
and , if that is not the problem , what is ?
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
Seta00
The Seta00 user has crashed.
Join Date: Jan 2010
Location: Berlin
Old 08-21-2010 , 08:39   Re: Can't load more than 99999 from SQL DB.
Reply With Quote #8

Quote:
Originally Posted by lucas_7_94 View Post
and , if that is not the problem , what is ?
That is the problem, but it's so obvious I can't imagine someone asking for help for solving that... L-O-L
Seta00 is offline
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 08-21-2010 , 08:46   Re: Can't load more than 99999 from SQL DB.
Reply With Quote #9

but , i'm right , no xd lol?
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
DruGzOG
Veteran Member
Join Date: Nov 2007
Location: Unknown
Old 08-21-2010 , 22:18   Re: Can't load more than 99999 from SQL DB.
Reply With Quote #10

Quote:
Originally Posted by Seta00 View Post
That is the problem, but it's so obvious I can't imagine someone asking for help for solving that... L-O-L
__________________
DruGzOG is offline
Send a message via AIM to DruGzOG
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 21:53.


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