Raised This Month: $ Target: $400
 0% 

Finish an subject


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
h3llzOr
Member
Join Date: Nov 2011
Old 01-05-2013 , 16:33   Finish an subject
Reply With Quote #1

hi all, i want to know how to finish this menu from this topic

http://forums.alliedmods.net/showthread.php?t=175675

only i need is DB_GetAllXP(id, start_page)

PHP Code:
public DB_GetAllXPid )
{
    
// If we're not saving XP, why do this?
    
if ( !get_pcvar_numCVAR_wc3_save_xp ) || !id )
    {
        return;
    }
    
    
// Get the XP    
    
switch( g_DBType )
    {
        case 
DB_MYSQLX:    MYSQLX_GetAllXPid );
        case 
DB_SQLITE:    SQLITE_GetAllXPid );
    }

    return;
}

MYSQLX_GetAllXPid )
{
    
// Make sure our connection is working
    
if ( !MYSQLX_Connection_Available() )
    {
        return;
    }
    
    new 
iUniqueID DB_GetUniqueIDid );

    
// Then we have a problem and cannot retreive the user's XP
    
if ( iUniqueID <= )
    {
        
client_printidprint_chat"%s Unable to retreive your XP from the database, please attempt to changerace later"g_MODclient );

        
WC3_Logtrue"[ERROR] Unable to retreive user's Unique ID" );

        return;
    }

    new 
szQuery[256];
    
format(szQuery255"SELECT `race_id`, `race_xp` FROM `wc3_player_race` WHERE ( `player_id` = '%d' );"iUniqueID );
    new 
Handle:query SQL_PrepareQueryg_DBConnszQuery );

    if ( !
SQL_Executequery ) )
    {
        
client_printidprint_chat"%s Error, unable to retrieve XP, please contact a server administrator"g_MODclient );

        
MYSQLX_ErrorqueryszQuery);

        return;
    }

    
// Set last saved XP to 0
    
for ( new 0MAX_RACESi++ )
    {
        
g_iDBPlayerXPInfoStore[id][i] = 0;
    }

    
// Get the XP!
    
new iXPiRace;

    
// Loop through all of the records to find the XP data
    
while ( SQL_MoreResultsquery ) )
    {
        
iRace    SQL_ReadResultquery);
        
iXP        SQL_ReadResultquery);
        
        
// Save the user's XP in an array
        
if ( iRace && iRace MAX_RACES )
        {
            
g_iDBPlayerXPInfoStore[id][iRace-1] = iXP;
        }

        
SQL_NextRowquery );
    }

    
// Free the handle
    
SQL_FreeHandlequery );

    
// Call the function that will display the "select a race" menu
    
WC3_ChangeRaceShowMenuidg_iDBPlayerXPInfoStore[id] );

    return;
}

SQLITE_GetAllXPid )
{
    
// Make sure our connection is working
    
if ( !SQLITE_Connection_Available() )
    {
        return;
    }

    new 
iUniqueID DB_GetUniqueIDid );

    
// Then we have a problem and cannot retreive the user's XP
    
if ( iUniqueID <= )
    {
        
client_printidprint_chat"%s Unable to retreive your XP from the database, please attempt to changerace later"g_MODclient );

        
WC3_Logtrue"[ERROR] Unable to retreive user's Unique ID" );

        return;
    }

    new 
szQuery[256];
    
format(szQuery255"SELECT `race_id`, `race_xp` FROM `wc3_player_race` WHERE ( `player_id` = '%d' );"iUniqueID );
    new 
Handle:query SQL_PrepareQueryg_DBConnszQuery );

    if ( !
SQL_Executequery ) )
    {
        
SQLITE_ErrorqueryszQuery);

        return;
    }

    
// Set last saved XP to 0
    
for ( new 0MAX_RACESi++ )
    {
        
g_iDBPlayerXPInfoStore[id][i] = 0;
    }

    new 
iXPiRace;

    
// Loop through all of the records to find the XP data
    
while ( SQL_MoreResultsquery ) )
    {
        
iRace    SQL_ReadResultquery);
        
iXP        SQL_ReadResultquery);
        
        
// Save the user's XP in an array
        
if ( iRace && iRace MAX_RACES )
        {
            
g_iDBPlayerXPInfoStore[id][iRace-1] = iXP;
        }

        
SQL_NextRowquery );
    }

    
// Free the handle
    
SQL_FreeHandlequery );

    
// Call the function that will display the "select a race" menu
    
WC3_ChangeRaceShowMenuidg_iDBPlayerXPInfoStore[id] );

    return;

thanks
h3llzOr is offline
 



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 13:35.


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