Raised This Month: $ Target: $400
 0% 

Finish an subject


Post New Thread Reply   
 
Thread Tools Display Modes
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
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-05-2013 , 17:14   Re: Finish an subject
Reply With Quote #2

Then post in that thread. Why are you asking for exactly the same thing as bibu?
__________________
fysiks is offline
h3llzOr
Member
Join Date: Nov 2011
Old 01-05-2013 , 17:54   Re: Finish an subject
Reply With Quote #3

i have post in the theard and no one reply to me and it because i want to know how to do an second page to that menu and i don't know how
h3llzOr is offline
ONEMDX
Junior Member
Join Date: Jan 2013
Old 01-06-2013 , 03:43   Re: Finish an subject
Reply With Quote #4

it's very complicated function , i tryed to make myself but the server crashs .... so someone can help us with that function ? apreciate ...

Last edited by ONEMDX; 01-06-2013 at 03:44.
ONEMDX is offline
Old 01-10-2013, 04:12
ONEMDX
This message has been deleted by YamiKaitou. Reason: wait 14 days before you bump
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 13:35.


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