• Страница 1 из 1
  • 1
Модератор форума: pashkaa, Slesh  
Как сделать так, чтоб не 2 а 3 вещи можно было покупать?
Дата: Понедельник, 30.07.2012, 16:03 | Сообщение # (1)
Пользователи
I love LINK-CSS.PP.UA
Сообщения:112
1)
Откройте items.h
Вот как должно быть
Code
#define ITEM_SLOT_ONE 0
    #define ITEM_SLOT_TWO 1
    #define ITEM_SLOT_THREE 2
    #define ITEM_SLOT_FULL 3


2)
Откройте items.inl

найдите функцию ITEM_GiveAllBonuses( idUser )
1 строчку замените вот на это
Code
// Loop through all item slots
    for ( new i = ITEM_SLOT_ONE; i <= ITEM_SLOT_THREE; i++ )


а дальше должно выглядеть так

Code
// Item Get Functions
    ITEM_GetSlot( idUser )
    {
    if ( g_iShopMenuItems[idUser][ITEM_SLOT_ONE] > ITEM_NONE && g_iShopMenuItems[idUser][ITEM_SLOT_TWO] > ITEM_NONE&&
    g_iShopMenuItems[idUser][ITEM_SLOT_THREE] > ITEM_NONE )
    return ITEM_SLOT_FULL;
       
    else if ( g_iShopMenuItems[idUser][ITEM_SLOT_ONE] > ITEM_NONE && g_iShopMenuItems[idUser][ITEM_SLOT_TWO] > ITEM_NONE)
    return ITEM_SLOT_THREE;
       
    else if ( g_iShopMenuItems[idUser][ITEM_SLOT_ONE] > ITEM_NONE)
    return ITEM_SLOT_TWO;
       
    return ITEM_SLOT_ONE;
    }
       
    ITEM_Has( idUser, iItem )
    {
    if ( g_iShopMenuItems[idUser][ITEM_SLOT_ONE] == iItem )
    return ITEM_SLOT_ONE;
       
    else if ( g_iShopMenuItems[idUser][ITEM_SLOT_TWO] == iItem )
    return ITEM_SLOT_TWO;
       
    else if ( g_iShopMenuItems[idUser][ITEM_SLOT_THREE] == iItem )
    return ITEM_SLOT_THREE;
       
    return ITEM_NONE;
    }
       
    // Item Death Function
    ITEM_UserDied( idUser )
    {
    // The user just died, remove all items
    if ( g_iShopMenuItems[idUser][ITEM_SLOT_ONE] > ITEM_NONE )
    {
    ITEM_Remove( idUser, ITEM_SLOT_ONE );
    }
       
    if ( g_iShopMenuItems[idUser][ITEM_SLOT_TWO] > ITEM_NONE )
    {
    ITEM_Remove( idUser, ITEM_SLOT_TWO );
    }
       
    if ( g_iShopMenuItems[idUser][ITEM_SLOT_THREE] > ITEM_NONE )
    {
    ITEM_Remove( idUser, ITEM_SLOT_THREE );
    }
    }


находите и заменяете на моё.

Далее
Открываем menus.inl

находим строку public MENU_ReplaceItem( idUser )

И заменяем на
Code
public MENU_ReplaceItem( idUser )
    {
       
    new szMenu[512] = "", pos = 0;
    new iKeys = (1<<9)|(1<<0)|(1<<1)|(1<<2);
       
    // Add the menu header
    pos += format( szMenu[pos], charsmax(szMenu)-pos, "%L^n^n", LANG_PLAYER, "MENU_REPLACE_ITEM" );
       
    new szItemName[64], szItemName2[64], szItemName3[64];
    LANG_GetItemName( g_iShopMenuItems[idUser][ITEM_SLOT_ONE], idUser, szItemName, charsmax(szItemName) );
    LANG_GetItemName( g_iShopMenuItems[idUser][ITEM_SLOT_TWO], idUser, szItemName2, charsmax(szItemName2) );
    LANG_GetItemName( g_iShopMenuItems[idUser][ITEM_SLOT_THREE], idUser, szItemName3, charsmax(szItemName3) );
    // Add the items
    pos += format( szMenu[pos], charsmax(szMenu)-pos, "\r1. %s^n", szItemName );
    pos += format( szMenu[pos], charsmax(szMenu)-pos, "\y2. %s^n", szItemName2 );
    pos += format( szMenu[pos], charsmax(szMenu)-pos, "\w3. %s^n", szItemName3 );
    // Add the exit option
    pos += format( szMenu[pos], charsmax(szMenu)-pos, "^n\d0. %L", LANG_PLAYER, "WORD_EXIT" );
       
    // Show the menu
    show_menu( idUser, iKeys, szMenu, -1 );
       
    return;
    }


)

а дальше должно выглядеть так

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49

// Item Get Functions
ITEM_GetSlot( idUser )
{
if ( g_iShopMenuItems[idUser][ITEM_SLOT_ONE] > ITEM_NONE && g_iShopMenuItems[idUser][ITEM_SLOT_TWO] > ITEM_NONE&&
g_iShopMenuItems[idUser][ITEM_SLOT_THREE] > ITEM_NONE )
return ITEM_SLOT_FULL;

else if ( g_iShopMenuItems[idUser][ITEM_SLOT_ONE] > ITEM_NONE && g_iShopMenuItems[idUser][ITEM_SLOT_TWO] > ITEM_NONE)
return ITEM_SLOT_THREE;

else if ( g_iShopMenuItems[idUser][ITEM_SLOT_ONE] > ITEM_NONE)
return ITEM_SLOT_TWO;

return ITEM_SLOT_ONE;
}

ITEM_Has( idUser, iItem )
{
if ( g_iShopMenuItems[idUser][ITEM_SLOT_ONE] == iItem )
return ITEM_SLOT_ONE;

else if ( g_iShopMenuItems[idUser][ITEM_SLOT_TWO] == iItem )
return ITEM_SLOT_TWO;

else if ( g_iShopMenuItems[idUser][ITEM_SLOT_THREE] == iItem )
return ITEM_SLOT_THREE;

return ITEM_NONE;
}

// Item Death Function
ITEM_UserDied( idUser )
{
// The user just died, remove all items
if ( g_iShopMenuItems[idUser][ITEM_SLOT_ONE] > ITEM_NONE )
{
ITEM_Remove( idUser, ITEM_SLOT_ONE );
}

if ( g_iShopMenuItems[idUser][ITEM_SLOT_TWO] > ITEM_NONE )
{
ITEM_Remove( idUser, ITEM_SLOT_TWO );
}

if ( g_iShopMenuItems[idUser][ITEM_SLOT_THREE] > ITEM_NONE )
{
ITEM_Remove( idUser, ITEM_SLOT_THREE );
}
}

находите и заменяете на моё.

Далее
Открываем menus.inl

находим строку public MENU_ReplaceItem( idUser )

И заменяем на

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

public MENU_ReplaceItem( idUser )
{

new szMenu[512] = "", pos = 0;
new iKeys = (1<<9)|(1<<0)|(1<<1)|(1<<2);

// Add the menu header
pos += format( szMenu[pos], charsmax(szMenu)-pos, "%L^n^n", LANG_PLAYER, "MENU_REPLACE_ITEM" );

new szItemName[64], szItemName2[64], szItemName3[64];
LANG_GetItemName( g_iShopMenuItems[idUser][ITEM_SLOT_ONE], idUser, szItemName, charsmax(szItemName) );
LANG_GetItemName( g_iShopMenuItems[idUser][ITEM_SLOT_TWO], idUser, szItemName2, charsmax(szItemName2) );
LANG_GetItemName( g_iShopMenuItems[idUser][ITEM_SLOT_THREE], idUser, szItemName3, charsmax(szItemName3) );
// Add the items
pos += format( szMenu[pos], charsmax(szMenu)-pos, "\r1. %s^n", szItemName );
pos += format( szMenu[pos], charsmax(szMenu)-pos, "\y2. %s^n", szItemName2 );
pos += format( szMenu[pos], charsmax(szMenu)-pos, "\w3. %s^n", szItemName3 );
// Add the exit option
pos += format( szMenu[pos], charsmax(szMenu)-pos, "^n\d0. %L", LANG_PLAYER, "WORD_EXIT" );

// Show the menu
show_menu( idUser, iKeys, szMenu, -1 );

return;
}

И находим public _menu_ReplaceItem( idUser, iKey )

Заменяем на
Code
public _menu_ReplaceItem( idUser, iKey )
    {
    if ( !WC3_Check() || iKey == 9 )
    {
    return PLUGIN_HANDLED;
    }
       
    // Remove item from item slot one
    if ( iKey == 0 )
    {
    ITEM_Remove( idUser, ITEM_SLOT_ONE )
    }
       
    // Remove item from itemslot two
    else if ( iKey == 1 )
    {
    ITEM_Remove( idUser, ITEM_SLOT_TWO )
    }
    else if ( iKey == 2 )
    {
    ITEM_Remove( id, ITEM_SLOT_THREE );
    }
       
    // Then the user typed "rings"
    if ( g_iFutureItem[idUser] == -3 )
    {
    ITEM_BuyRings( idUser );
    }
    else
    {
    ITEM_Buy( idUser, g_iFutureItem[idUser] );
    }
       
    return PLUGIN_HANDLED;
    }


И последнее. Открываем war3ft.inl
Находим WC3_ShowBar( idUser )

И заменяем на
Code
WC3_ShowBar( idUser )
    {
       
    // User is not connected
    if ( !p_data_b[idUser][PB_ISCONNECTED] )
    {
    return;
    }
       
    new szString[256], pos = 0, szXPInfo[32],szCurrentItems[32];
    new szItemInfo[256], szRaceInfo[256];
    new szRaceName[64], szShortRaceName[32], szItemName[32];
       
    // Get the race names
    lang_GetRaceName( p_data[idUser][P_RACE], idUser, szRaceName, 63 );
    lang_GetRaceName( p_data[idUser][P_RACE], idUser, szShortRaceName, 31, true );
       
    // This information is displayed differently for CS/CZ
    if ( g_MOD == GAME_CSTRIKE || g_MOD == GAME_CZERO )
    {
    // No race selected
    if ( !p_data[idUser][P_RACE] )
    {
    pos += formatex( szRaceInfo[pos], 255, "%s ", szRaceName );
    }
       
    // User has a race
    else
    {
       
    // User is level 0
    if ( p_data[idUser][P_LEVEL] == 0 )
    {
    pos += formatex( szRaceInfo[pos], 255, "%s XP: %d/%d ", szRaceName, p_data[idUser][P_XP], XP_GetByLevel( p_data[idUser][P_LEVEL]+1 ) );
    formatex( szXPInfo, 31, "XP: %d/%d", p_data[idUser][P_XP], XP_GetByLevel( p_data[idUser][P_LEVEL]+1 ) );
    }
       
    //CSSB
    // User is under level MAX_LEVELS
    else if ( p_data[idUser][P_LEVEL] < MAX_LEVELS )
    {
    pos += formatex( szRaceInfo[pos], 255, "%s %L: %d XP: %d/%d ", szShortRaceName, LANG_PLAYER, "WORD_LEVEL", p_data[idUser][P_LEVEL], p_data[idUser][P_XP], XP_GetByLevel( p_data[idUser][P_LEVEL]+1) );
    formatex( szXPInfo, 31, "%L: %d XP: %d/%d", LANG_PLAYER, "WORD_LEVEL", p_data[idUser][P_LEVEL], p_data[idUser][P_XP], XP_GetByLevel( p_data[idUser][P_LEVEL]+1 ) );
    }
       
    // User is level MAX_LEVELS
    else
    {
    pos += formatex( szRaceInfo[pos], 255, "%s %L: %d XP: %d ", szShortRaceName, LANG_PLAYER, "WORD_LEVEL", p_data[idUser][P_LEVEL], p_data[idUser][P_XP] );
    formatex( szXPInfo, 31, "%L: %d XP: %d", LANG_PLAYER, "WORD_LEVEL", p_data[idUser][P_LEVEL], p_data[idUser][P_XP] );
    }
    }
    }
       
    // Reset our position since we're using a new array
    pos = 0;
       
    // User has one item
    if ( g_iShopMenuItems[idUser][ITEM_SLOT_ONE] > ITEM_NONE )
    {
    ITEM_Format( idUser, g_iShopMenuItems[idUser][ITEM_SLOT_ONE], szItemName, 31 )
       
    formatex(szCurrentItems, 31, "%L:",LANG_PLAYER,"WC3_CURRENT_ITEM");
    pos += formatex( szItemInfo[pos], 256-pos, "%s", szItemName );
    }
       
    // User has another item
    if ( g_iShopMenuItems[idUser][ITEM_SLOT_TWO] > ITEM_NONE )
    {
    ITEM_Format( idUser, g_iShopMenuItems[idUser][ITEM_SLOT_TWO], szItemName, 31 )
       
    // Then the string isn't empty and we have information in it (so we have a first item)
    if ( szItemInfo[0] )
    {
    formatex(szCurrentItems, 31, "%L:",LANG_PLAYER,"WC3_CURRENT_ITEMS" );
    pos += formatex( szItemInfo[pos], 256-pos, " %L %s", LANG_PLAYER, "WORD_AND", szItemName );
    }
       
    // We don't need the word "and"
    else
    {
    pos += formatex( szItemInfo[pos], 256-pos, "%s", szItemName );
    }
    }
    if ( g_iShopMenuItems[idUser][ITEM_SLOT_THREE] > ITEM_NONE )
    {
    ITEM_Format( idUser, g_iShopMenuItems[idUser][ITEM_SLOT_THREE], szItemName, 31 )
       
    // Then the string isn't empty and we have information in it (so we have a first and a second item)
    if ( szItemInfo[0] )
    {
    formatex(szCurrentItems, 31, "%L:",LANG_PLAYER,"WC3_CURRENT_ITEMS" );
    pos += formatex( szItemInfo[pos], 256-pos, " %L %s", LANG_PLAYER, "WORD_AND", szItemName );
    }
       
    // We don't need the word "and"
    else
    {
    pos += formatex( szItemInfo[pos], 256-pos, "%s", szItemName );
    }
    }
       
    new szRaceItemInfo[256];
    //CSSB
    // Put the final string together
    formatex( szString, 255, "%s%s", szRaceInfo, szItemInfo );
    formatex( szRaceItemInfo, 255, "%s^n%s %s", szRaceInfo,szCurrentItems, szItemInfo);
       
    if ( SHARED_IsOnTeam( idUser ) )
    {
    // Display the item + race info with a hudmessage
    if ( g_MOD == GAME_CSTRIKE || g_MOD == GAME_CZERO )
    {
       
    if ( is_user_alive( idUser ) )
    {
    set_hudmessage( 0, 255, 0, 0.012, 0.92, HUDMESSAGE_FX_FADEIN, 10.0, 540.0, 2.0, 3.0, HUD_XP );
    show_hudmessage(idUser, szRaceItemInfo);
       
    // set_dhudmessage( 0, 255, 0, 0.012, 0.82, HUDMESSAGE_FX_FADEIN, 10.0, 540.0, 2.0, 3.0, HUD_XP );
    // show_dhudmessage(idUser,"%s", szRaceItemInfo);
    /*
    new szNameLang[28];
    if (vaultdata_exists("server_language"))
    {
    get_vaultdata("server_language", szNameLang, 27);
    }
    else
    {
    copy(szNameLang, 27, "en")
    //set_vaultdata("server_language", szNameLang);
    }
       
    if( equali(szNameLang,"ru") )
    {
    set_hudmessage( 0, 255, 0, 0.012, 0.92, HUDMESSAGE_FX_FADEIN, 10.0, 540.0, 2.0, 3.0, HUD_XP );
    show_hudmessage(idUser, szRaceItemInfo);
    }
    else
    {
    Create_StatusText( idUser, 0, szString );
    }
    */
    }
       
    else
    {
    set_hudmessage( 160, 160, 160, 0.012, 0.90, HUDMESSAGE_FX_FADEIN, 10.0, 0.0, 2.0, 3.0, HUD_XP );
    show_hudmessage( idUser, "%s", szXPInfo );
    }
    }
       
    }
       
    return;
    }


Теперь вы можете покупать 3 вещи

Источник


<br>http://servera-cs.net/userbar/userbar.png?serv=91.211.117.52:27029</br>
  • Страница 1 из 1
  • 1
Поиск:

Используются технологии uCoz