> > > > >

Поиск Resetscore с ограничением для обычных игроков

Сообщения
37
Рейтинг
0
#1
Ищу плагин для Reapi
Resetscore , который выполняет такие функции:
1. Для обычных игроков сброс счёта доступен раз в указанное количество раундов
2. Для игроков с флагами без ограничений

Что-то такое уже реализовано в плагине

C++:
#include <amxmodx>
#include <reapi>
#include <vip_system>

#pragma semicolon 1

new g_iRoundCount[MAX_CLIENTS+1];
new pCvarResetBlock, g_iRoundBlock;

public plugin_init() {
    register_plugin("[ReVIP] Reset Score", VIP_SYSTEM_VERSION, "pUzzlik");
    register_dictionary("vip_system.txt");
  
    // Через сколько раундов можно исп. reset score обычным игрокам для откл. установите 0 (def. 5)
    pCvarResetBlock = register_cvar("rs_block_rnd", "5");

    register_clcmd("say /rs","ResetScore");
    register_clcmd("say /resetscore","ResetScore");
    register_clcmd("say_team /rs","ResetScore");
    register_clcmd("say_team /resetscore","ResetScore");
}

public plugin_cfg()
    g_iRoundBlock = get_pcvar_num(pCvarResetBlock);

public vip_core_player_spawn(const id)
    if(g_iRoundCount[id] > 0) g_iRoundCount[id]--;

public ResetScore(const id) {
    if(!is_user_connected(id)) return;
    if(g_iRoundCount[id] > 0) {
        if(!get_flag_access_def(id)) client_print_color(id, -2, "%L %L", LANG_SERVER, "RS_TAG", LANG_SERVER, "RESET_BLOCK", g_iRoundCount[id]);
        else client_print_color(id, -2, "%L %L", LANG_SERVER, "RS_TAG", LANG_SERVER, "RESET_BLOCK_VIP", g_iRoundCount[id]);
        return;
    }
    client_cmd(id, "spk buttons/blip1.wav");

    set_entvar(id, var_frags, 0.0); set_member(id, m_iDeaths, 0);
    client_print_color(id, 0, "%L %L", LANG_SERVER, "RS_TAG", LANG_SERVER, "RESET_SCORE");

    static mScoreInfo; if(!mScoreInfo) mScoreInfo = get_user_msgid("ScoreInfo");
    message_begin(MSG_ALL, mScoreInfo);
    write_byte(id);
    write_short(0);
    write_short(0);
    write_short(0);
    write_short(get_member(id, m_iTeam));
    message_end();
  
    if(get_flag_access_def(id)) g_iRoundCount[id] = 1;
    else g_iRoundCount[id] = g_iRoundBlock;
    return;
}
но отдельно от вип плагина он не хочет работать.
 

Вложения

1  
Сообщения
261
Рейтинг
297
#2
vip_core_player_spawn
->
Ham_Spawn

get_flag_access_def
->
get_user_flags
 
1  
Сообщения
37
Рейтинг
0
#3
neygomon,
unknown unknown unknown re_vip_reset_sc bad load

Что-то пошло не так...

C++:
AMX Mod X 1.9.0.5232 (http://www.amxmodx.org)
Authors:
David "BAILOPAN" Anderson, Pavol "PM OnoTo" Marko
Felix "SniperBeamer" Geyer, Jonny "Got His Gun" Bergstrom
Lukasz "SidLuke" Wlasinski, Christian "Basic-Master" Hammacher
Borja "faluco" Ferrer, Scott "DS" Ehlert
Compiled: Oct 14 2018 08:47:55
Built from: https://github.com/alliedmodders/amxmodx/commit/be52641
Build ID: 5232:be52641
Core mode: JIT+ASM32

C++:
description    stat pend  file                        vers            src  load  unload
[ 1] Reunion        RUN   -    reunion_mm_i386.so          v0.1.0.92       ini  Start Never
[ 2] ReAuthCheck    RUN   -    reauthcheck_mm_i386.so      v0.1.6          ini  Start Never
[ 3] Rechecker      RUN   -    rechecker_mm_i386.so        v2.5            ini  Chlvl ANY
[ 4] Revoice        RUN   -    revoice_mm_i386.so          v0.1.0.32       ini  Start Never
[ 5] AMX Mod X      RUN   -    amxmodx_mm_i386.so          v1.9.0.5232     ini  Start ANY
[ 6] ReSRDetector   RUN   -    resrdetector_mm_i386.so     v0.1.0          ini  Chlvl ANY
[ 7] WHBlocker      RUN   -    whblocker_mm_i386.so        v1.5.696        ini  Chlvl ANY
[ 8] ReSemiclip     RUN   -    resemiclip_mm_i386.so       v2.3.9          ini  Chlvl ANY
[ 9] MySQL          RUN   -    mysql_amxx_i386.so          v1.9.0.5232     pl5  ANY   ANY
[10] ReAimDetector  RUN   -    reaimdetector_amxx_i386.so  v0.2.2          pl5  ANY   Never
[11] FakeMeta       RUN   -    fakemeta_amxx_i386.so       v1.9.0.5232     pl5  ANY   ANY
[12] ReAPI          RUN   -    reapi_amxx_i386.so          v5.6.0.160-dev  pl5  ANY   Never
[13] Ham Sandwich   RUN   -    hamsandwich_amxx_i386.so    v1.9.0.5232     pl5  ANY   ANY
[14] Engine         RUN   -    engine_amxx_i386.so         v1.9.0.5232     pl5  ANY   ANY
[15] CStrike        RUN   -    cstrike_amxx_i386.so        v1.9.0.5232     pl5  ANY   ANY
15 plugins, 15 running

C++:
Currently loaded plugins:
name                    version     author            file             status
[  1] FreshBans               1.4.0b      kanagava          fresh_bans_140_  running
[  2] fb_forwards             0.1.4       Kanagava & Realu  fb_forwards.amx  running
[  3] unknown                 unknown     unknown           re_vip_reset_sc  bad load
[  4] Admin Base              1.9.0.5232  AMXX Dev Team     admin.amxx       running
[  5] Admin Commands          1.9.0.5232  AMXX Dev Team     admincmd.amxx    running
[  6] Admin Help              1.9.0.5232  AMXX Dev Team     adminhelp.amxx   running
[  7] Slots Reservation       1.9.0.5232  AMXX Dev Team     adminslots.amxx  running
[  8] Multi-Lingual System    1.9.0.5232  AMXX Dev Team     multilingual.am  running
[  9] Menus Front-End         1.9.0.5232  AMXX Dev Team     menufront.amxx   running
[ 10] Commands Menu           1.9.0.5232  AMXX Dev Team     cmdmenu.amxx     running
[ 11] Players Menu            1.9.0.5232  AMXX Dev Team     plmenu.amxx      running
[ 12] Maps Menu               1.9.0.5232  AMXX Dev Team     mapsmenu.amxx    running
[ 13] Plugin Menu             1.9.0.5232  AMXX Dev Team     pluginmenu.amxx  running
[ 14] Stop SpamBots           0.2         mx?!              stop_spambots.a  running
[ 15] Admin Chat              1.9.0.5232  AMXX Dev Team     adminchat.amxx   running
[ 16] Anti Flood              1.9.0.5232  AMXX Dev Team     antiflood.amxx   running
[ 17] Scrolling Message       1.9.0.5232  AMXX Dev Team     scrollmsg.amxx   running
[ 18] Info. Messages          1.9.0.5232  AMXX Dev Team     imessage.amxx    running
[ 19] Admin Votes             1.9.0.5232  AMXX Dev Team     adminvote.amxx   running
[ 20] NextMap                 1.9.0.5232  AMXX Dev Team     nextmap.amxx     running
[ 21] Nextmap Chooser         1.9.0.5232  AMXX Dev Team     mapchooser.amxx  running
[ 22] TimeLeft                1.9.0.5232  AMXX Dev Team     timeleft.amxx    running
[ 23] Pause Plugins           1.9.0.5232  AMXX Dev Team     pausecfg.amxx    running
[ 24] Stats Configuration     1.9.0.5232  AMXX Dev Team     statscfg.amxx    running
[ 25] AES: StatsX             0.5 Vega    serfreeman1337    aes_statsx_cstr  running
[ 26] Rank Menu               1.1         h1k3              rankmenu.amxx    running
[ 27] CSStatsX SQL            0.7.4+1     serfreeman1337    csstatsx_sql.am  running
[ 28] Say me and Say hp       1.4         neygomon          sayme.amxx       debug
[ 29] StatsX                  1.9.0.5232  AMXX Dev Team     statsx.amxx      running
[ 30] DopBan                  3.0.3b      kanagava          dop_ban.amxx     running
[ 31] ReAimDetector API       0.2.2       ReHLDS Team       reaimdetector.a  running
[ 32] ReChecker Logging       1.0         custom            rc_logging.amxx  running
[ 33] [ReAPI] Vip System      1.4.1       Dager* *.* -G-    re_vipka.amxx    running
[ 34] Advert Messages         1.22        neygomon          adverts.amxx     running
[ 35] AFK Control             1.4.1 [Rnd  neygomon          afk_control.amx  running
[ 36] [ReAPI] No Reset MOney  0.0.5       Vaqtincha         reapi_no_reset_  running
[ 37] Mute Menu               30.10.2018  w0w               mutemenu.amxx    running
[ 38] Lite VoteBan            1.4         neygomon          lite_voteban.am  running
[ 39] Team Balancer           1.8b3       Ptahhotep         ptb_rus.amxx     running
[ 40] lite screen fade        1.0         AcE               re_lite_screen_  running
[ 41] [ReAPI] No Team Flash   0.0.2       Vaqtincha         no_team_flash.a  running
[ 42] CSS Bomb                0.0.1       Vaqtincha         css_bomb.amxx    running
[ 43] Parachute               1.4 [ReAPI  Random1, cpCTRL   re_parachute.am  running
[ 44] [ReAPI] Knife Round     1.3         pUzzlik           re_knife_round.  running
[ 45] Damage Control          1.22        Fxfighter         Damage_Control2  running
[ 46] Lite Translit           2.8         neygomon          lite_translit.a  running
[ 47] Advanced Experience Sy  0.5.9 [REA  serfreeman1337/s  aes_main.amxx    running
[ 48] AES: CStrike Addon      0.5.9 [REA  serfreeman1337/s  aes_exp_cstrike  running
[ 49] AES: Informer           0.5.9 [REA  serfreeman1337/s  aes_informer.am  running
(  3) Load fails: Plugin uses an unknown function (name "get_flag_access_def") - check your modules.ini.
49 plugins, 48 running
 
 
Сообщения
135
Рейтинг
27
#4
several, вы когда начнёте показывать свои попытки? В конце то концов, гугл кишит знаниями. Это заключительный раз для меня, когда за вас делают работу:
Код:
#include <amxmodx>
#include <reapi>

#define ACCESS_LEVEL ADMIN_LEVEL_H

#pragma semicolon 1

new g_iRoundCount[MAX_CLIENTS+1];
new pCvarResetBlock, g_iRoundBlock;

public plugin_init() {
    register_plugin("[ReVIP] Reset Score", "2.5r", "pUzzlik");
    register_dictionary("vip_system.txt");

    // Через сколько раундов можно исп. reset score обычным игрокам для откл. установите 0 (def. 5)
    pCvarResetBlock = register_cvar("rs_block_rnd", "5");

    register_clcmd("say /rs","ResetScore");
    register_clcmd("say /resetscore","ResetScore");
    register_clcmd("say_team /rs","ResetScore");
    register_clcmd("say_team /resetscore","ResetScore");
   
    RegisterHookChain(RG_CBasePlayer_Spawn, "CBasePlayer_Spawn", true);
}

public plugin_cfg()
    g_iRoundBlock = get_pcvar_num(pCvarResetBlock);

public CBasePlayer_Spawn(id)
    if(g_iRoundCount[id] > 0) g_iRoundCount[id]--;

public ResetScore(const id) {
    if(!is_user_connected(id)) return;
    if(g_iRoundCount[id] > 0) {
        if(~get_user_flags(id) & ACCESS_LEVEL) client_print_color(id, -2, "%L %L", LANG_SERVER, "RS_TAG", LANG_SERVER, "RESET_BLOCK", g_iRoundCount[id]);
        else client_print_color(id, -2, "%L %L", LANG_SERVER, "RS_TAG", LANG_SERVER, "RESET_BLOCK_VIP", g_iRoundCount[id]);
        return;
    }
    client_cmd(id, "spk buttons/blip1.wav");

    set_entvar(id, var_frags, 0.0); set_member(id, m_iDeaths, 0);
    client_print_color(id, 0, "%L %L", LANG_SERVER, "RS_TAG", LANG_SERVER, "RESET_SCORE");

    static mScoreInfo; if(!mScoreInfo) mScoreInfo = get_user_msgid("ScoreInfo");
    message_begin(MSG_ALL, mScoreInfo);
    write_byte(id);
    write_short(0);
    write_short(0);
    write_short(0);
    write_short(get_member(id, m_iTeam));
    message_end();

    if(get_user_flags(id) & ACCESS_LEVEL) g_iRoundCount[id] = 1;
    else g_iRoundCount[id] = g_iRoundBlock;
    return;
}
 
2  
Сообщения
37
Рейтинг
0
#5
several, вы когда начнёте показывать свои попытки? В конце то концов, гугл кишит знаниями. Это заключительный раз для меня, когда за вас делают работу:
Код:
#include <amxmodx>
#include <reapi>

#define ACCESS_LEVEL ADMIN_LEVEL_H

#pragma semicolon 1

new g_iRoundCount[MAX_CLIENTS+1];
new pCvarResetBlock, g_iRoundBlock;

public plugin_init() {
    register_plugin("[ReVIP] Reset Score", "2.5r", "pUzzlik");
    register_dictionary("vip_system.txt");

    // Через сколько раундов можно исп. reset score обычным игрокам для откл. установите 0 (def. 5)
    pCvarResetBlock = register_cvar("rs_block_rnd", "5");

    register_clcmd("say /rs","ResetScore");
    register_clcmd("say /resetscore","ResetScore");
    register_clcmd("say_team /rs","ResetScore");
    register_clcmd("say_team /resetscore","ResetScore");
  
    RegisterHookChain(RG_CBasePlayer_Spawn, "CBasePlayer_Spawn", true);
}

public plugin_cfg()
    g_iRoundBlock = get_pcvar_num(pCvarResetBlock);

public CBasePlayer_Spawn(id)
    if(g_iRoundCount[id] > 0) g_iRoundCount[id]--;

public ResetScore(const id) {
    if(!is_user_connected(id)) return;
    if(g_iRoundCount[id] > 0) {
        if(~get_user_flags(id) & ACCESS_LEVEL) client_print_color(id, -2, "%L %L", LANG_SERVER, "RS_TAG", LANG_SERVER, "RESET_BLOCK", g_iRoundCount[id]);
        else client_print_color(id, -2, "%L %L", LANG_SERVER, "RS_TAG", LANG_SERVER, "RESET_BLOCK_VIP", g_iRoundCount[id]);
        return;
    }
    client_cmd(id, "spk buttons/blip1.wav");

    set_entvar(id, var_frags, 0.0); set_member(id, m_iDeaths, 0);
    client_print_color(id, 0, "%L %L", LANG_SERVER, "RS_TAG", LANG_SERVER, "RESET_SCORE");

    static mScoreInfo; if(!mScoreInfo) mScoreInfo = get_user_msgid("ScoreInfo");
    message_begin(MSG_ALL, mScoreInfo);
    write_byte(id);
    write_short(0);
    write_short(0);
    write_short(0);
    write_short(get_member(id, m_iTeam));
    message_end();

    if(get_user_flags(id) & ACCESS_LEVEL) g_iRoundCount[id] = 1;
    else g_iRoundCount[id] = g_iRoundBlock;
    return;
}
Огромное спасибо, дружище, я действительно сначала пытаюсь сам методом тыка и по интуиции. В тех случаях когда плагин пишет bad load, я даже не знаю что делать. Напиши мне в личку свой кошелек отблагодарю за потраченное время.
 
 

Похожие темы

> > > > >