unreachable code 225

Статус
В этой теме нельзя размещать новые ответы.
Сообщения
270
Реакции
43
Помог
5 раз(а)
hello, all. I'm adding message client_print(id, print_center,"message"); and I get it compiling warning, without this message no warnings any idea why ? :)

//AMXXPC compile.exe
// by the AMX Mod X Dev Team


//// re_vipmenu_fix.sma
//
// C:\Users\Lina\Desktop\scripting\scripting\re_vipmenu_fix.sma(169) : warning 2
25: unreachable code
// Header size: 1184 bytes
// Code size: 8088 bytes
// Data size: 5256 bytes
// Stack/heap size: 16384 bytes
// Total requirements: 30912 bytes
//
// 1 Warnings.
// Done.
//
// Compilation Time: 0,91 sec
// ----------------------------------------

Press enter to exit ...

C++:
public MenuHandler(id, key) {
    #if defined BUYZONE_USE
    if(!cs_get_user_buyzone(id))
    client_print(id, print_center,"message");    // my message
    return PLUGIN_HANDLED;   
    #endif
    if(key <= 4) { // warning line 169
        /***    Защита от дурака    ***/
        if(g_iRound < pCvarCfg[WEAPONSRND]) return client_print_color(id, 0, "%L %L", LANG_SERVER, "CHAT_TAG", LANG_SERVER, "PISTOLS_ROUND");
        /***    End        ***/
        if(g_bUseWeapon[id]) return client_print_color(id, 0, "%L %L", LANG_SERVER, "CHAT_TAG", LANG_SERVER, "ALREDY_WEAPON_RND");
        g_bUseWeapon[id] = true;
      
        static const szChoosedBP[] = { 90, 90, 90, 30, 90 };
        static const szChoosedWP[][] = { "weapon_ak47", "weapon_m4a1", "weapon_famas", "weapon_awp", "weapon_galil" };
      
        return rg_give_items(id, szChoosedWP[key], szChoosedBP[key]);
    }
    else if (key == 5) GivePistol(id);
    return PLUGIN_HANDLED;
}
 
Сообщения
432
Реакции
410
Помог
14 раз(а)
Should be like this i guess
Код:
public MenuHandler(id, key) {
    #if defined BUYZONE_USE
    if(!cs_get_user_buyzone(id))
    {
        client_print(id, print_center,"message");    // my message
        return PLUGIN_HANDLED;   
    }
    #endif
    if(key <= 4) { // warning line 169
        /***    Защита от дурака    ***/
        if(g_iRound < pCvarCfg[WEAPONSRND]) return client_print_color(id, 0, "%L %L", LANG_SERVER, "CHAT_TAG", LANG_SERVER, "PISTOLS_ROUND");
        /***    End        ***/
        if(g_bUseWeapon[id]) return client_print_color(id, 0, "%L %L", LANG_SERVER, "CHAT_TAG", LANG_SERVER, "ALREDY_WEAPON_RND");
        g_bUseWeapon[id] = true;
      
        static const szChoosedBP[] = { 90, 90, 90, 30, 90 };
        static const szChoosedWP[][] = { "weapon_ak47", "weapon_m4a1", "weapon_famas", "weapon_awp", "weapon_galil" };
      
        return rg_give_items(id, szChoosedWP[key], szChoosedBP[key]);
    }
    else if (key == 5) GivePistol(id);
    return PLUGIN_HANDLED;
}
 
  • Нравится
Реакции: Murz
Сообщения
270
Реакции
43
Помог
5 раз(а)
Should be like this i guess
Код:
public MenuHandler(id, key) {
    #if defined BUYZONE_USE
    if(!cs_get_user_buyzone(id))
    {
        client_print(id, print_center,"message");    // my message
        return PLUGIN_HANDLED;  
    }
    #endif
    if(key <= 4) { // warning line 169
        /***    Защита от дурака    ***/
        if(g_iRound < pCvarCfg[WEAPONSRND]) return client_print_color(id, 0, "%L %L", LANG_SERVER, "CHAT_TAG", LANG_SERVER, "PISTOLS_ROUND");
        /***    End        ***/
        if(g_bUseWeapon[id]) return client_print_color(id, 0, "%L %L", LANG_SERVER, "CHAT_TAG", LANG_SERVER, "ALREDY_WEAPON_RND");
        g_bUseWeapon[id] = true;
     
        static const szChoosedBP[] = { 90, 90, 90, 30, 90 };
        static const szChoosedWP[][] = { "weapon_ak47", "weapon_m4a1", "weapon_famas", "weapon_awp", "weapon_galil" };
     
        return rg_give_items(id, szChoosedWP[key], szChoosedBP[key]);
    }
    else if (key == 5) GivePistol(id);
    return PLUGIN_HANDLED;
}
and you are right thank you
 
Статус
В этой теме нельзя размещать новые ответы.

Пользователи, просматривающие эту тему

Сейчас на форуме нет ни одного пользователя.
Сверху Снизу