Не выводит сообщения

Статус
В этой теме нельзя размещать новые ответы.

Murder

Пользователь
Регистрация
24 Июн 2017
Сообщения
14
Симпатии
2
Пол
Мужской
Доброе утро. Не выводит сообщения в чат. Тойсть есть ошибка. Не могу понять, что добавить, или убрать. Помогите плиз. За ранее СПАСИБО.
String formatted incorrectly - parameter 6 (total 5)
[AMXX] Run time error 25: parameter error
[0] colorchat.inc::client_print_color (line 138)
[1] steam_bonus_RU.sma::SteamBonus (line 124)
String formatted incorrectly - parameter 6 (total 5)
Displaying debug trace (plugin "steam_bonus_RU.amxx")
[AMXX] Run time error 25: parameter error
[0] colorchat.inc::client_print_color (line 138)
[1] steam_bonus_RU.sma::give_item_ex (line 163)
[2] steam_bonus_RU.sma::WeaponRandom (line 137)
[3] steam_bonus_RU.sma::SteamBonus (line 116)
[AMXX] Run time error 25: parameter error
[0] colorchat.inc::client_print_color (line 138)
[1] steam_bonus_RU.sma::SteamBonus (line 102)
Бонусы выдает, но нет сообщения.
Есть только одно и то не до конца [Steam Bonus]НИК получил бонус за Steam CS деньги: E иногда пишет V или W
PHP:
#include <amxmodx>
#include <cstrike>
#include <fun>
#include <hamsandwich>
#include <colorchat>


// #### Начало Конфигурационные defines ####
#define CHATTAG "^3[Steam Bonus]^4"
#define MIN_MONEY 300
#define MAX_MONEY 2500
#define MIN_HP 0
#define MAX_HP 20
#define STEAMBONUSROUND 3
//#define OPENMENUSOUND

new g_roundCount;

new const PRIMARY_WEAPONS_BITSUM = (1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_AUG)|(1<<CSW_UMP45)|(1<<CSW_SG550)|(1<<CSW_GALIL)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<<CSW_MP5NAVY)|(1<<CSW_M249)|(1<<CSW_M3)|(1<<CSW_M4A1)|(1<<CSW_TMP)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47)|(1<<CSW_P90);
new const SECONDARY_WEAPONS_BITSUM = (1<<CSW_P228)|(1<<CSW_ELITE)|(1<<CSW_FIVESEVEN)|(1<<CSW_USP)|(1<<CSW_GLOCK18)|(1<<CSW_DEAGLE);

public plugin_init()
{
    new sPref[][] = {"dm_", "awp_", "aim_", "35hp", "fy_"};
    new map[32]; get_mapname(map, charsmax(map));
    for(new i; i < sizeof sPref; i++)
    {
        if(containi(map, sPref[i]) != -1)
        {
            pause("ad");
            return;
        }
    }
    
    register_plugin("Steam Bonus", "2.0", "Neugomon")
    
    register_event("TextMsg", "eRestart", "a", "2&#Game_C", "2&#Game_w");
    register_event("HLTV","eRoundStart","a","1=0","2=0");
        
    RegisterHam(Ham_Spawn, "player", "Player_Spawn", 1);
    
    register_menucmd(register_menuid("Steam Bonus Menu"), MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_6, "SteamBonus");
}

public eRestart(id)
{
    g_roundCount = 0;
    
    show_menu(id, 0, "^n", 1)
}

public eRoundStart(id)
{
    g_roundCount++;
}

public Player_Spawn(id)
{
    if(g_roundCount < STEAMBONUSROUND || !is_user_alive(id) || get_user_flags(id) & ADMIN_LEVEL_H)
        return 0;
        
    return SteamBonusMenu(id);
}

public SteamBonusMenu(id)
{   
    if(!is_user_steam(id)) return 0;
    
#if defined OPENMENUSOUND
    static OpenMenuSound[] = "buttons/blip2";
    client_cmd( id, "spk ^"%s^"", OpenMenuSound );
#endif
    
    static szMenu[512], iLen, iKey, Name[32];
    get_user_name(id, Name, charsmax(Name))
    
    iKey = MENU_KEY_6|MENU_KEY_5|MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4;
    iLen = formatex(szMenu, 511, "\d[\rSTEAM BONUS MENU\d]^n\d[\rHello\r: \y%s\d]^n^n\r[\y1\r]\y Деньги^n\r[\y2\r]\y Броня+Шлем^n\r[\y3\r]\y Набор гранат^n\r[\y4\r]\y Оружие \rAK, M4, FM, AWP^n\r[\y5\r]\y Добавить \rHP \d[\yДо \r20HP\d]^n^n", Name);
    
    formatex(szMenu[iLen], 511 - iLen, "\r[\y6\r] [\yОтказаться от бонусов\r]");
    
    return show_menu(id, iKey, szMenu, 15, "Steam Bonus Menu");
}

public SteamBonus(id, iKey)
{
    switch(iKey)
    {
        case 0:
        {
            new iMoney = random_num(MIN_MONEY, MAX_MONEY);
            cs_set_user_money(id, cs_get_user_money(id) + iMoney);
            new name[32];
            get_user_name(id, name, charsmax(name));
            client_print_color(0, id, "^1%s ^3%s ^1получил бонус за ^3Steam CS ^4деньги: ^3%s", CHATTAG, name, iMoney);
        }
        case 1:
        {
            cs_set_user_armor(id, 100, CsArmorType:2);
            new name[32];
            get_user_name(id, name, charsmax(name));
            client_print_color(0, id, "^1%s ^3%s ^1получил бонус за ^3Steam CS ^4Броню + Шлем: ^3%s", CHATTAG, name);
        }
        case 2:
        {
            give_item(id, "weapon_hegrenade");
            give_item(id, "weapon_flashbang");
            give_item(id, "weapon_smokegrenade");
            cs_set_user_bpammo(id, CSW_FLASHBANG, 2);
            new name[32];
            get_user_name(id, name, charsmax(name));
            client_print_color(0, id, "^1%s ^3%s ^1получил бонус за ^3Steam CS ^4Набор гранат: ^3%s", CHATTAG, name);
        }
        case 3:
        {
            WeaponRandom(id);
        }
        case 4:
        {
            new iHealth = random_num(MIN_HP, MAX_HP);
            set_user_health(id, get_user_health(id) + iHealth);
            new name[32];
            get_user_name(id, name, charsmax(name));
            client_print_color(0, id, "^1%s ^3%s ^1получил бонус за ^3Steam CS ^4чутка ^3%dHP: ^3%s", CHATTAG, name, iHealth);
        }
    }
    return PLUGIN_HANDLED;
}

public WeaponRandom(id)
{
    switch(random(4))
    {
    case 0: give_item_ex(id,"weapon_ak47",90,1)
    case 1: give_item_ex(id,"weapon_m4a1",90,1)
    case 2: give_item_ex(id,"weapon_awp",30,1)
    case 3: give_item_ex(id,"weapon_famas",90,1)
    }
    return PLUGIN_HANDLED;
}

stock give_item_ex(id,currWeaponName[],ammoAmount,dropFlag=0)
{
    static    weaponsList[32], weaponName[32], weaponsNum, currWeaponID;       
    currWeaponID = get_weaponid(currWeaponName);
    if(dropFlag)
    {   
        weaponsNum = 0;
        get_user_weapons(id,weaponsList,weaponsNum);
        for (new i;i < weaponsNum;i++)
        {
            if(((1 << currWeaponID) & PRIMARY_WEAPONS_BITSUM && (1 << weaponsList[i]) & PRIMARY_WEAPONS_BITSUM) | ((1 << currWeaponID) & SECONDARY_WEAPONS_BITSUM && (1 << weaponsList[i]) & SECONDARY_WEAPONS_BITSUM))
            {
                get_weaponname(weaponsList[i],weaponName,charsmax(weaponName));
                engclient_cmd(id,"drop",weaponName);
            }
        }
    }
    give_item(id,currWeaponName);
    cs_set_user_bpammo(id,currWeaponID,ammoAmount);
    new name[32];
    get_user_name(id, name, charsmax(name));
    client_print_color(0, id, "^1%s ^3%s ^1получил бонус за ^3Steam CS ^4оружие: ^3%s", CHATTAG, name, currWeaponName[7]);
    return 1;
}

stock ChatColor(const id, const szMessage[], any:...)
{
    static szMsg[190], IdMsg;
    vformat(szMsg, charsmax(szMsg), szMessage, 3);
    
    if(!IdMsg) IdMsg = get_user_msgid("SayText");
    
    message_begin(MSG_ONE, IdMsg, .player = id);
    write_byte(id);
    write_string(szMsg);
    message_end();
}

stock bool:is_user_steam(id)
{
    static dp_pointer;
    if(dp_pointer || (dp_pointer = get_cvar_pointer("dp_r_id_provider")))
    {
        server_cmd("dp_clientinfo %d", id);
        server_exec();
        return (get_pcvar_num(dp_pointer) == 2) ? true : false;
    }
    return false;
}
 

Vesuvius

НЕ СКРИПТЕР!!!
Команда форума
Администратор
Регистрация
8 Июн 2017
Сообщения
1.595
Симпатии
572
Пол
Мужской
Murder, попробуйте
 

Вложения

Murder

Пользователь
Регистрация
24 Июн 2017
Сообщения
14
Симпатии
2
Пол
Мужской
Vesuvius,
L 01/30/2018 - 21:34:51: Info (map "de_dust2_2x2") (file "addons/amxmodx/logs/error_20180130.log")
L 01/30/2018 - 21:34:51: String formatted incorrectly - parameter 6 (total 5)
L 01/30/2018 - 21:34:51: [AMXX] Displaying debug trace (plugin "Steam_Bonus_ru2.amxx")
L 01/30/2018 - 21:34:51: [AMXX] Run time error 25: parameter error
L 01/30/2018 - 21:34:51: [AMXX] [0] colorchat.inc::client_print_color (line 138)
L 01/30/2018 - 21:34:51: [AMXX] [1] Steam_Bonus_ru2.sma::SteamBonus (line 112)
L 01/30/2018 - 21:35:18: String formatted incorrectly - parameter 7 (total 6)
L 01/30/2018 - 21:35:18: [AMXX] Displaying debug trace (plugin "Steam_Bonus_ru2.amxx")
L 01/30/2018 - 21:35:18: [AMXX] Run time error 25: parameter error
L 01/30/2018 - 21:35:18: [AMXX] [0] colorchat.inc::client_print_color (line 138)
L 01/30/2018 - 21:35:18: [AMXX] [1] Steam_Bonus_ru2.sma::SteamBonus (line 124)
L 01/30/2018 - 21:35:29: String formatted incorrectly - parameter 6 (total 5)
L 01/30/2018 - 21:35:29: [AMXX] Displaying debug trace (plugin "Steam_Bonus_ru2.amxx")
L 01/30/2018 - 21:35:29: [AMXX] Run time error 25: parameter error
L 01/30/2018 - 21:35:29: [AMXX] [0] colorchat.inc::client_print_color (line 138)
L 01/30/2018 - 21:35:29: [AMXX] [1] Steam_Bonus_ru2.sma::SteamBonus (line 102)
L 01/30/2018 - 21:35:55: String formatted incorrectly - parameter 6 (total 5)
L 01/30/2018 - 21:35:55: [AMXX] Displaying debug trace (plugin "Steam_Bonus_ru2.amxx")
L 01/30/2018 - 21:35:55: [AMXX] Run time error 25: parameter error
L 01/30/2018 - 21:35:55: [AMXX] [0] colorchat.inc::client_print_color (line 138)
L 01/30/2018 - 21:35:55: [AMXX] [1] Steam_Bonus_ru2.sma::SteamBonus (line 102)
L 01/30/2018 - 21:35:57: String formatted incorrectly - parameter 7 (total 6)
L 01/30/2018 - 21:35:57: [AMXX] Displaying debug trace (plugin "Steam_Bonus_ru2.amxx")
L 01/30/2018 - 21:35:57: [AMXX] Run time error 25: parameter error
L 01/30/2018 - 21:35:57: [AMXX] [0] colorchat.inc::client_print_color (line 138)
L 01/30/2018 - 21:35:57: [AMXX] [1] Steam_Bonus_ru2.sma::SteamBonus (line 124)
L 01/30/2018 - 21:36:27: String formatted incorrectly - parameter 7 (total 6)
L 01/30/2018 - 21:36:27: [AMXX] Displaying debug trace (plugin "Steam_Bonus_ru2.amxx")
L 01/30/2018 - 21:36:27: [AMXX] Run time error 25: parameter error
L 01/30/2018 - 21:36:27: [AMXX] [0] colorchat.inc::client_print_color (line 138)
L 01/30/2018 - 21:36:27: [AMXX] [1] Steam_Bonus_ru2.sma::SteamBonus (line 124)
L 01/30/2018 - 21:36:28: String formatted incorrectly - parameter 6 (total 5)
L 01/30/2018 - 21:36:28: [AMXX] Displaying debug trace (plugin "Steam_Bonus_ru2.amxx")
L 01/30/2018 - 21:36:28: [AMXX] Run time error 25: parameter error
L 01/30/2018 - 21:36:28: [AMXX] [0] colorchat.inc::client_print_color (line 138)
L 01/30/2018 - 21:36:28: [AMXX] [1] Steam_Bonus_ru2.sma::SteamBonus (line 102)
L 01/30/2018 - 21:37:18: String formatted incorrectly - parameter 7 (total 6)
L 01/30/2018 - 21:37:18: [AMXX] Displaying debug trace (plugin "Steam_Bonus_ru2.amxx")
L 01/30/2018 - 21:37:18: [AMXX] Run time error 25: parameter error
L 01/30/2018 - 21:37:18: [AMXX] [0] colorchat.inc::client_print_color (line 138)
L 01/30/2018 - 21:37:18: [AMXX] [1] Steam_Bonus_ru2.sma::SteamBonus (line 124)
L 01/30/2018 - 21:37:19: String formatted incorrectly - parameter 6 (total 5)
L 01/30/2018 - 21:37:19: [AMXX] Displaying debug trace (plugin "Steam_Bonus_ru2.amxx")
L 01/30/2018 - 21:37:19: [AMXX] Run time error 25: parameter error
L 01/30/2018 - 21:37:19: [AMXX] [0] colorchat.inc::client_print_color (line 138)
L 01/30/2018 - 21:37:19: [AMXX] [1] Steam_Bonus_ru2.sma::SteamBonus (line 102)
Может инклуд не тот?
#if defined _colorchat_included
#endinput
#endif
#define _colorchat_included

/* ColorChat Support */
#define NORMAL DontChange
#define GREEN DontChange
#define TEAM_COLOR DontChange
#define RED Red
#define BLUE Blue
#define GREY Grey
#define ColorChat client_print_color
/* ColorChat Support */

enum _:Colors {
DontChange,
Red,
Blue,
Grey
}

stock const g_szTeamName[Colors][] =
{
"UNASSIGNED",
"TERRORIST",
"CT",
"SPECTATOR"
}

stock client_print_color(id, iColor=DontChange, const szMsg[], any:...)
{
// check if id is different from 0
if( id && !is_user_connected(id) )
{
return 0;
}

if( iColor > Grey )
{
iColor = DontChange;
}

new szMessage[192];
if( iColor == DontChange )
{
szMessage[0] = 0x04;
}
else
{
szMessage[0] = 0x03;
}

new iParams = numargs();
// Specific player code
if(id)
{
if( iParams == 3 )
{
copy(szMessage[1], charsmax(szMessage)-1, szMsg);
}
else
{
vformat(szMessage[1], charsmax(szMessage)-1, szMsg, 4);
}

if( iColor )
{
new szTeam[11]; // store current team so we can restore it
get_user_team(id, szTeam, charsmax(szTeam));

// set id TeamInfo in consequence
// so SayText msg gonna show the right color
Send_TeamInfo(id, id, g_szTeamName[iColor]);

// Send the message
Send_SayText(id, id, szMessage);

// restore TeamInfo
Send_TeamInfo(id, id, szTeam);
}
else
{
Send_SayText(id, id, szMessage);
}
}

// Send message to all players
else
{
// Figure out if at least 1 player is connected
// so we don't send useless message if not
// and we gonna use that player as team reference (aka SayText message sender) for color change
new iPlayers[32], iNum;
get_players(iPlayers, iNum, "ch");
if( !iNum )
{
return 0;
}

new iFool = iPlayers[0];

new iMlNumber, i, j;
new Array:aStoreML = ArrayCreate();
if( iParams >= 5 ) // ML can be used
{
for(j=4; j<iParams; j++)
{
// retrieve original param value and check if it's LANG_PLAYER value
if( getarg(j) == LANG_PLAYER )
{
i=0;
// as LANG_PLAYER == -1, check if next parm string is a registered language translation
while( ( szMessage[ i ] = getarg( j + 1, i++ ) ) ) {}
if( GetLangTransKey(szMessage) != TransKey_Bad )
{
// Store that arg as LANG_PLAYER so we can alter it later
ArrayPushCell(aStoreML, j++);

// Update ML array saire so we'll know 1st if ML is used,
// 2nd how many args we have to alterate
iMlNumber++;
}
}
}
}

// If arraysize == 0, ML is not used
// we can only send 1 MSG_BROADCAST message
if( !iMlNumber )
{
if( iParams == 3 )
{
copy(szMessage[1], charsmax(szMessage)-1, szMsg);
}
else
{
vformat(szMessage[1], charsmax(szMessage)-1, szMsg, 4);
}

if( iColor )
{
new szTeam[11];
get_user_team(iFool, szTeam, charsmax(szTeam));
Send_TeamInfo(0, iFool, g_szTeamName[iColor]);
Send_SayText(0, iFool, szMessage);
Send_TeamInfo(0, iFool, szTeam);
}
else
{
Send_SayText(0, iFool, szMessage);
}
}

// ML is used, we need to loop through all players,
// format text and send a MSG_ONE_UNRELIABLE SayText message
else
{
new szTeam[11], szFakeTeam[10];

if( iColor )
{
get_user_team(iFool, szTeam, charsmax(szTeam));
copy(szFakeTeam, charsmax(szFakeTeam), g_szTeamName[iColor]);
}

for( i = 0; i < iNum; i++ )
{
id = iPlayers;

for(j=0; j<iMlNumber; j++)
{
// Set all LANG_PLAYER args to player index ( = id )
// so we can format the text for that specific player
setarg(ArrayGetCell(aStoreML, j), _, id);
}

// format string for specific player
vformat(szMessage[1], charsmax(szMessage)-1, szMsg, 4);

if( iColor )
{
Send_TeamInfo(id, iFool, szFakeTeam);
Send_SayText(id, iFool, szMessage);
Send_TeamInfo(id, iFool, szTeam);
}
else
{
Send_SayText(id, iFool, szMessage);
}
}
ArrayDestroy(aStoreML);
}
}
return 1;
}

stock Send_TeamInfo(iReceiver, iPlayerId, szTeam[])
{
static iTeamInfo = 0;
if( !iTeamInfo )
{
iTeamInfo = get_user_msgid("TeamInfo");
}
message_begin(iReceiver ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, iTeamInfo, .player=iReceiver);
write_byte(iPlayerId);
write_string(szTeam);
message_end();
}

stock Send_SayText(iReceiver, iPlayerId, szMessage[])
{
static iSayText = 0;
if( !iSayText )
{
iSayText = get_user_msgid("SayText");
}
message_begin(iReceiver ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, iSayText, .player=iReceiver);
write_byte(iPlayerId);
write_string(szMessage);
message_end();
}

stock register_dictionary_colored(const filename[])
{
if( !register_dictionary(filename) )
{
return 0;
}

new szFileName[256];
get_localinfo("amxx_datadir", szFileName, charsmax(szFileName));
format(szFileName, charsmax(szFileName), "%s/lang/%s", szFileName, filename);
new fp = fopen(szFileName, "rt");
if( !fp )
{
log_amx("Failed to open %s", szFileName);
return 0;
}

new szBuffer[512], szLang[3], szKey[64], szTranslation[256], TransKey:iKey;

while( !feof(fp) )
{
fgets(fp, szBuffer, charsmax(szBuffer));
trim(szBuffer);

if( szBuffer[0] == '[' )
{
strtok(szBuffer[1], szLang, charsmax(szLang), szBuffer, 1, ']');
}
else if( szBuffer[0] )
{
strbreak(szBuffer, szKey, charsmax(szKey), szTranslation, charsmax(szTranslation));
iKey = GetLangTransKey(szKey);
if( iKey != TransKey_Bad )
{
while( replace(szTranslation, charsmax(szTranslation), "!g", "^4") ){}
while( replace(szTranslation, charsmax(szTranslation), "!t", "^3") ){}
while( replace(szTranslation, charsmax(szTranslation), "!n", "^1") ){}
AddTranslation(szLang, iKey, szTranslation[2]);
}
}
}

fclose(fp);
return 1;
}
 

Vesuvius

НЕ СКРИПТЕР!!!
Команда форума
Администратор
Регистрация
8 Июн 2017
Сообщения
1.595
Симпатии
572
Пол
Мужской
Murder, честно говоря я не силен в скриптинге...
 

Вложения

Murder

Пользователь
Регистрация
24 Июн 2017
Сообщения
14
Симпатии
2
Пол
Мужской
Vesuvius,
Murder, честно говоря я не силен в скриптинге...
с твоим инклудом одна только ошибка
L 01/30/2018 - 22:31:15: [AMXX] Displaying debug trace (plugin "Steam_Bonus_ru2.amxx")
L 01/30/2018 - 22:31:15: [AMXX] Run time error 25: parameter error
L 01/30/2018 - 22:31:15: [AMXX] [0] colorchat.inc::client_print_color (line 129)
L 01/30/2018 - 22:31:15: [AMXX] [1] Steam_Bonus_ru2.sma::SteamBonus (line 124)
L 01/30/2018 - 22:31:59: String formatted incorrectly - parameter 7 (total 6)
и показывать стала кто взял какое оружие.
 

Vesuvius

НЕ СКРИПТЕР!!!
Команда форума
Администратор
Регистрация
8 Июн 2017
Сообщения
1.595
Симпатии
572
Пол
Мужской
Murder, может кто и подскажет... Я тут дуб дерево
 
Статус
В этой теме нельзя размещать новые ответы.
Сверху Снизу