Raised This Month: $ Target: $400
 0% 

Can't load more than 99999 from SQL DB.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 


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 21:53.


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