AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Finish an subject (https://forums.alliedmods.net/showthread.php?t=204999)

h3llzOr 01-05-2013 16:33

Finish an subject
 
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

fysiks 01-05-2013 17:14

Re: Finish an subject
 
Then post in that thread. Why are you asking for exactly the same thing as bibu?

h3llzOr 01-05-2013 17:54

Re: Finish an subject
 
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 :(

ONEMDX 01-06-2013 03:43

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


All times are GMT -4. The time now is 13:35.

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