Raised This Month: $32 Target: $400
 8% 

Issue with registering dictionary


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SomewhereLost
AlliedModders Donor
Join Date: Mar 2014
Location: Tomorrowland
Old 10-20-2018 , 22:11   Issue with registering dictionary
Reply With Quote #1

Hello,

I got an issue with the code, the dictionary is registered correctly and the .txt file is dropped in the appropriate folder but the texts still dont appear, says ML_NOTFOUND

Any ideas?

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <fakemeta>
#include <hamsandwich>

#pragma semicolon 1

#define PLUGIN "Knife Deathmatch Buy"
#define VERSION "3.4"
#define AUTHOR "xEhsaan"

/**
 * Knife Deathmatch Shop
 * First time written for Pars-Strike servers (pars-strike.ir)
 *
 * First release: 26 March 2015
 * First Public release: 7 May 2015
 * This Release: 11 May 2015
 *
 * This plugin is made for Knife servers (It won't be interesting for other servers)
 * Players can buy things with their frags (That means money will be unuseful :D)
 * Currently, This plugin supports these items:
 *     - Glow (Glow shell for players)
 *     - Extra HP
 *     - Speed (Fast moving)
 *     - Hook (Gives hook feature to player and they can do this with +hook, but you'll need Hook plugin for this)
 *     - GodMode
 *
 * Requirments:
 *     - Fun
 *     - Fakemeta
 *     - Hamsandwich
 *     - AMX Mod 1.8.3 Latest developer build
 *     - Hook plugin (needed for hook item) and amx_givehook & amx_takehook working!
 *
 * Compile Note:
 *     If you want use this plugin in AMX Mod 1.8.2 or lower, you have to compile the plugin yourself,
 *     before compile, add this to plugin header:
 *         #define MAX_PLAYERS 20
 *         #include <colorchat>
 *
 * Credits:
 *     - xEhsaan (Idea & Coding)
 *     - MohaMMadReZa (Coding advisor & Testing)
 *      - The.Mahdi.Hero (Persian translation)
 *     - F22 Raptor, Ali Bi Gham & Other Pars-Strike Staff (Testing)
 *
 * CVars:
 *     * All prices are in frags count
 *     * Times are in seconds
 *
 *     - dmb_glow_price  & dmb_glow_time : Glow price & expiration time
 *     - dmb_hp_price & dmb_hp_value : HP price & HP value (in HP units)
 *     - dmb_speed_price & dmb_speed_time : Speed price & Speed expiration time
 *     - dmb_godmode_price & dmb_godmode_time : GodMode price & expiration time
 *     - dmb_tag : String for prefix every messages in chat (Need restart to change)
 *
 * Console Commands:
 *     * All commands need LEVEL_C access
 *     - amx_setfrags <target> <frags>
 *         Set frags for a certain player or a team
 *     - amx_addfrags <target> <frags>
 *         Add frags to a certain player or a team frags
 *     - amx_expire_bonus <target>
 *         Expire bonus manually for a player or a team.
 *
 *
 * Change Log:
 *     - Version 3.4:
 *      + Added Multi-Language support
 *      + Added dmb_version CVar
 *      * Fixed another bug when a client disconnects
 *      * Replaced MAX_PLAYERS with hardcoded values
 *      * Fixed GodMode bug
 *
 *     - Version 3.3:
 *     * Removed a lot unused variables and unneccessary functions
 *      * Cached a lot of variables, those don't need to refresh every time
 *      + Fixed client_disconnect bug
 *      + Fixed Persian lines
 */

new g_Tag[64], g_pGlowTimeg_pSpeedTimeg_pHookTimeg_pGodModeTime;
new 
g_pGlowPriceg_pHPPriceg_pSpeedPriceg_pHookPriceg_pGodModePrice;
new 
g_pHPValueg_pTag;
new 
g_GlowCounter[MAX_PLAYERS], g_SpeedCounter[MAX_PLAYERS], g_GodModeCounter[MAX_PLAYERS], g_HookCounter[MAX_PLAYERS];
new 
g_GlowRGB[MAX_PLAYERS][3];

new 
g_GlowMenu;
new 
g_FlashMsg;

// Items data
new g_Items[5][2];

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR);
    
register_dictionary"common.txt" );
    
register_dictionary"knife_dm_shop.txt" );
    
    
register_clcmd"say /shop""Shop_Menu" );
    
register_clcmd"shop_menu""Shop_Menu" );
    
    
g_pGlowPrice         =    register_cvar"dmb_glow_price""50"FCVAR_ARCHIVE );
    
g_pGlowTime         =    register_cvar"dmb_glow_time""60"FCVAR_ARCHIVE );
    
    
g_pHPPrice         =    register_cvar"dmb_hp_price""100"FCVAR_ARCHIVE );
    
g_pHPValue         =    register_cvar"dmb_hp_value""200"FCVAR_ARCHIVE );
    
    
g_pSpeedPrice         =    register_cvar"dmb_speed_price""150"FCVAR_ARCHIVE );
    
g_pSpeedTime         =    register_cvar"dmb_speed_time""60"FCVAR_ARCHIVE );
    
    
g_pHookPrice         =    register_cvar"dmb_hook_price""200"FCVAR_ARCHIVE );
    
g_pHookTime         =    register_cvar"dmb_hook_time""60"FCVAR_ARCHIVE );
    
    
g_pGodModePrice     =    register_cvar"dmb_godmode_price""200"FCVAR_ARCHIVE );
    
g_pGodModeTime         =    register_cvar"dmb_godmode_time""60"FCVAR_ARCHIVE );
    
    
g_pTag             =    register_cvar"dmb_tag""DM Shop"FCVAR_ARCHIVE );
    
register_cvar"dmb_version""3.4"FCVAR_SERVER FCVAR_SPONLY );
    
    
register_concmd"amx_setfrags""Do_SetFrags"ADMIN_LEVEL_C"<target> <frags>" );
    
register_concmd"amx_addfrags""Do_AddFrags"ADMIN_LEVEL_C"<target> <frags>" );
    
register_concmd"amx_expire_bonus""Do_ExpireBonus"ADMIN_LEVEL_C"<target>" );
    
    
RegisterHamHam_Spawn"player""Fw_Spawn_Post");
    
    
Init_Vars();
}

Init_Vars() {
    
get_pcvar_stringg_pTagg_Tagcharsmaxg_Tag ) );
    
g_FlashMsg get_user_msgid"ScreenFade" );
    
    
// Glow
    
g_Items[0][0] = get_pcvar_numg_pGlowPrice );
    
g_Items[0][1] = get_pcvar_numg_pGlowTime );
    
    
// HP
    
g_Items[1][0] = get_pcvar_numg_pHPPrice );
    
g_Items[1][1] = get_pcvar_numg_pHPValue );
    
    
// Speed
    
g_Items[2][0] = get_pcvar_numg_pSpeedPrice );
    
g_Items[2][1] = get_pcvar_numg_pSpeedTime );
    
    
// Hook
    
g_Items[3][0] = get_pcvar_numg_pHookPrice );
    
g_Items[3][1] = get_pcvar_numg_pHookTime );
    
    
// GodMode
    
g_Items[4][0] = get_pcvar_numg_pGodModePrice );
    
g_Items[4][1] = get_pcvar_numg_pGodModeTime );
    
    
// Glow menu cache
    
new szTemp[64];
    
formatexszTempcharsmaxszTemp ), "\y%L"LANG_SERVER"COLOR_MENU_TITLE" );
    
g_GlowMenu menu_createszTemp"Glow_Menu_Handler" );
    
menu_additemg_GlowMenu"Red" );
    
menu_additemg_GlowMenu"Green" );
    
menu_additemg_GlowMenu"Blue" );
    
menu_additemg_GlowMenu"Purple" );
    
menu_additemg_GlowMenu"Cyan" );
    
menu_additemg_GlowMenu"Yellow" );
    
menu_additemg_GlowMenu"Black" );
    
menu_additemg_GlowMenu"White" );
    
menu_additemg_GlowMenu"Random" );
}

public 
client_disconnect(id) {
    
g_GlowCounter[id] = 0;
    
g_SpeedCounter[id] = 0;
    
g_GodModeCounter[id] = 0;
    
g_HookCounter[id] = 0;
    
g_GlowRGB[id][0] = 0;
    
g_GlowRGB[id][1] = 0;
    
g_GlowRGB[id][2] = 0;
}

public 
Shop_Menu(id) {
    if ( ! 
is_user_aliveid ) || ! ( cs_get_user_team(id) == CS_TEAM_CT || cs_get_user_team(id) == CS_TEAM_T ) ) {
        
client_print_coloridid"^4[%s] ^1%L"g_TagLANG_PLAYER"CANT_BUY" );
        return 
PLUGIN_HANDLED;
    }
        
    new 
g_Menu;
    new 
iFrags get_user_frags(id);
    
    new 
szTemp[64];
    
formatexszTempcharsmaxszTemp ), "\y%L"LANG_PLAYER"BUY_MENU_TITLE" );
    
g_Menu menu_createszTemp"Menu_Callback" );
    
    new 
tItem[192], iPriceiTimebool:bCanBuy;
    
    
iPrice g_Items[0][0];
    
iTime g_Items[0][1];
    
bCanBuy = ( iFrags >= iPrice ) ? true false;
    
formatextItem charsmaxtItem ), "%L"LANG_PLAYER"GLOW_ITEM", ( bCanBuy "\w" "\d" ), ( bCanBuy "\y" "\d" ), iPrice, ( bCanBuy "\r" "\d" ), iTime );
    
menu_additemg_MenutItem"Glow" );
    
    
iPrice g_Items[1][0];
    
iTime g_Items[1][1];
    
bCanBuy = ( iFrags >= iPrice ) ? true false;
    
formatextItem charsmaxtItem ), "%L"LANG_PLAYER"HP_ITEM", ( bCanBuy "\w" "\d" ), iTime, ( bCanBuy "\y" "\d" ), iPrice, ( bCanBuy "\r" "\d" ) );
    
menu_additemg_MenutItem"HP" );
    
    
iPrice g_Items[2][0];
    
iTime g_Items[2][1];
    
bCanBuy = ( iFrags >= iPrice ) ? true false;
    
formatextItem charsmaxtItem ), "%L"LANG_PLAYER"SPEED_ITEM", ( bCanBuy "\w" "\d" ), ( bCanBuy "\y" "\d" ), iPrice, ( bCanBuy "\r" "\d" ), iTime );
    
menu_additemg_MenutItem"Speed" );
    
    
iPrice get_pcvar_numg_pHookPrice );
    
iTime get_pcvar_numg_pHookTime );
    
bCanBuy = ( iFrags >= iPrice ) ? true false;
    
formatextItem charsmaxtItem ), "%L"LANG_PLAYER"HOOK_ITEM", ( bCanBuy "\w" "\d" ), ( bCanBuy "\y" "\d" ), iPrice, ( bCanBuy "\r" "\d" ), iTime );
    
menu_additemg_MenutItem"Hook" );
    
    
iPrice get_pcvar_numg_pGodModePrice );
    
iTime get_pcvar_numg_pGodModeTime );
    
bCanBuy = ( iFrags >= iPrice ) ? true false;
    
formatextItem charsmaxtItem ), "%L"LANG_PLAYER"GOD_ITEM", ( bCanBuy "\w" "\d" ), ( bCanBuy "\y" "\d" ), iPrice, ( bCanBuy "\r" "\d" ), iTime );
    
menu_additemg_MenutItem"God" );
    
    
menu_displayidg_Menu );
    return 
PLUGIN_HANDLED;
}

public 
Menu_Callback(idmenuitem) {
    if ( 
item == MENU_EXIT ) {
        
menu_destroymenu );
        return 
PLUGIN_HANDLED;
    }
    
    new 
szData[16], _accessitem_callback;
    
menu_item_getinfomenuitem_accessszDatacharsmaxszData ), __item_callback );
    
    new 
iFrags get_user_fragsid );
    
    if ( 
equaliszData"Glow" ) ) {
        if ( 
iFrags >= g_Items[0][0] ) {
            
Handle_Glowid );
            
menu_destroymenu );
            return 
PLUGIN_HANDLED;
        }
    }
    
    if ( 
equaliszData"HP" ) ) {
        if ( 
iFrags >= g_Items[1][0] ) {
            
Handle_HPid );
            
menu_destroymenu );
            return 
PLUGIN_HANDLED;
        }
    }
    
    if ( 
equaliszData"Speed" ) ) {
        if ( 
iFrags >= g_Items[2][0] ) {
            
Handle_Speedid );
            
menu_destroymenu );
            return 
PLUGIN_HANDLED;
        }
    }
    
    if ( 
equaliszData"Hook" ) ) {
        if ( 
iFrags >= g_Items[3][0] ) {
            
Handle_Hookid );
            
menu_destroymenu );
            return 
PLUGIN_HANDLED;
        }
    }
    
    if ( 
equaliszData"God" ) ) {
        if ( 
iFrags >= g_Items[4][0] ) {
            
Handle_GodModeid );
            
menu_destroymenu );
            return 
PLUGIN_HANDLED;
        }
    }
    
    
client_print_coloridid"^4[%s] ^1%L"g_TagLANG_PLAYER"NOT_ENOUGH" );
    
menu_destroymenu );
    return 
PLUGIN_HANDLED;
}

/**
 * Glow chapter
 * 1. Handle_Glow : for handling after main menu
 * 2. Glow_Menu_Handler: for handling color menu
 * 3. Glow_Timer: ticking clock for glow
 */

public Handle_Glow(id) {
    if ( ! 
is_user_aliveid ) || ! ( cs_get_user_team(id) == CS_TEAM_CT || cs_get_user_team(id) == CS_TEAM_T ) ) {
        
client_print_coloridid"^4[%s] ^1%L"g_TagLANG_PLAYER"CANT_BUY" );
        return 
PLUGIN_HANDLED;
    }
    if ( 
g_GlowCounter[id] > ) {
        
client_print_coloridid"^4[%s] ^1%L"g_TagLANG_PLAYER"ALREADY_GLOW" );
        return 
PLUGIN_HANDLED;
    }
    
    
menu_displayidg_GlowMenu );
    return 
PLUGIN_HANDLED;
}

public 
Glow_Menu_Handler(idmenuitem) {
    if ( 
item == MENU_EXIT ) {
        
menu_destroymenu );
        return 
PLUGIN_HANDLED;
    }
    new 
iRediGreeniBlue;
    
    switch( 
item ) {
        case 
0: {
            
iRed 255;
            
iGreen 0;
            
iBlue 0;
        }
        case 
1: {
            
iRed 0;
            
iGreen 255;
            
iBlue 0;
        }
        case 
2: {
            
iRed 0;
            
iGreen 0;
            
iBlue 255;
        }
        case 
3: {
            
iRed 128;
            
iGreen 0;
            
iBlue 128;
        }
        case 
4: {
            
iRed 0;
            
iGreen 255;
            
iBlue 255;
        }
        case 
5: {
            
iRed 255;
            
iGreen 255;
            
iBlue 0;
        }
        case 
6: {
            
iRed 0;
            
iGreen 0;
            
iBlue 0;
        }
        case 
7: {
            
iRed 255;
            
iGreen 255;
            
iBlue 255;
        }
        case 
8: {
            
iRed random_num(0255);
            
iGreen random_num(0255);
            
iBlue random_num(0255);
        }
    }
    
    
mset_user_fragsidget_user_fragsid ) - g_Items[0][0] );
    
    
g_GlowCounter[id] = g_Items[0][1];
    
    new 
Params[1];
    
Params[0] = id;
    
g_GlowRGB[id][0] = iRed;
    
g_GlowRGB[id][1] = iGreen;
    
g_GlowRGB[id][2] = iBlue;
    
    
set_task1.0"Glow_Timer"_ParamssizeofParams ), "b" );
    
set_user_renderingidkRenderFxGlowShelliRediGreeniBluekRenderTransAlpha20 );
    
    
client_print_coloridid"^4[%s] ^1%L"g_TagLANG_PLAYER"HAVE_GLOW" );
    
Flash_PlayeridiRediGreeniBlue );
    return 
PLUGIN_HANDLED;
}

public 
Glow_Timer(Params[], Task_ID) {
    new 
id Params[0];
    
    
g_GlowCounter[id] = g_GlowCounter[id] - 1;
    
    if ( 
g_GlowCounter[id] > ) {
        
client_printidprint_center"%L"LANG_PLAYER"GLOW_TIMER"g_GlowCounter[id] );
    } else {
        if ( 
is_user_connectedid ) )
            
set_user_renderingid );
            
        
remove_taskTask_ID );
        
client_print_coloridid"^4[%s] ^1%L"g_TagLANG_PLAYER"GLOW_EXPIRED" );
    }
}

/**
 * HP Chapter
 * Handle_HP : just give the hp
 */
public Handle_HP(id) {
    if ( ! 
is_user_aliveid ) || ! ( cs_get_user_team(id) == CS_TEAM_CT || cs_get_user_team(id) == CS_TEAM_T ) ) {
        
client_print_coloridid"^4[%s] ^1%L"g_TagLANG_PLAYER"CANT_BUY" );
        return 
PLUGIN_HANDLED;
    }
    
mset_user_fragsidget_user_frags(id) - g_Items[1][0] );
    
set_user_healthidget_user_healthid ) + g_Items[1][1] );
    
client_printidprint_center"%L"LANG_PLAYER"HAVE_HP"g_Items[1][1] );
    
    
Flash_Player(id25500); // Red
    
return PLUGIN_HANDLED;
}

/**
 * Speed Chapter
 * Handle_Speed: just handle after returning from main menu
 * Speed_Timer: time tick for speeding
 */
public Handle_Speed(id) {
    if ( ! 
is_user_aliveid ) || ! ( cs_get_user_team(id) == CS_TEAM_CT || cs_get_user_team(id) == CS_TEAM_T ) ) {
        
client_print_coloridid"^4[%s] ^1%L"g_TagLANG_PLAYER"CANT_BUY" );
        return 
PLUGIN_HANDLED;
    }
    if ( 
g_SpeedCounter[id] > ) {
        
client_print_coloridid"^4[%s] ^1%L"g_TagLANG_PLAYER"ALREADY_SPEED" );
        return 
PLUGIN_HANDLED;
    }
    
    
mset_user_fragsidget_user_frags(id) - g_Items[2][0] );
    
g_SpeedCounter[id] = g_Items[2][1];
    
    new 
Param[1];
    
Param[0] = id;
    
set_task1.0"Speed_Timer"_Paramsizeof(Param), "b" );
    
    
set_user_maxspeedidget_user_maxspeedid ) + 500.0 ); // If it's too high, just change 500.0 to any value you do want
    
client_print_coloridid"^4[%s] ^1%L"g_TagLANG_PLAYER"HAVE_SPEED" );
    
Flash_Playerid1280255 );
    return 
PLUGIN_HANDLED;
}

public 
Speed_Timer(Params[], Task_ID) {
    new 
id Params[0];
    
    
g_SpeedCounter[id] = g_SpeedCounter[id] - 1;
    
    if ( 
g_SpeedCounter[id] > ) {
        
client_printidprint_center"%L"LANG_PLAYER"SPEED_TIMER"g_SpeedCounter[id] );
    } else {
        if ( 
is_user_connectedid ) )
            
set_user_maxspeedidget_user_maxspeedid ) - 500.0 );
            
        
remove_taskTask_ID );
        
client_print_coloridid"^4[%s] ^1%L"g_TagLANG_PLAYER"SPEED_EXPIRED" );
    }
}

/**
 * GodMode Chapter
 * Handle_GodMode: just handle after returning from main menu
 * GodMode_Timer: time tick for speeding
 */
public Handle_GodMode(id) {
    if ( ! 
is_user_aliveid ) || ! ( cs_get_user_team(id) == CS_TEAM_CT || cs_get_user_team(id) == CS_TEAM_T ) ) {
        
client_print_coloridid"^4[%s] ^1%L"g_TagLANG_PLAYER"CANT_BUY" );
        return 
PLUGIN_HANDLED;
    }
    if ( 
g_GodModeCounter[id] > ) {
        
client_print_coloridid"^4[%s] ^1%L"g_TagLANG_PLAYER"ALREADY_GODMODE" );
        return 
PLUGIN_HANDLED;
    }
    
    
mset_user_fragsidget_user_frags(id) - g_Items[4][0] );
    
g_GodModeCounter[id] = g_Items[4][1];
    
    new 
Param[1];
    
Param[0] = id;
    
set_task1.0"GodMode_Timer"_Paramsizeof(Param), "b" );
    
    
set_user_godmodeid);
    
client_print_coloridid"^4[%s] ^1%L"g_TagLANG_PLAYER"HAVE_GODMODE" );
    
Flash_Playerid255255255 );
    return 
PLUGIN_HANDLED;
}

public 
GodMode_Timer(Params[], Task_ID) {
    new 
id Params[0];
    
    
g_GodModeCounter[id] = g_GodModeCounter[id] - 1;
    
    if ( 
g_GodModeCounter[id] > ) {
        
client_printidprint_center"%L"LANG_PLAYER"GODMODE_TIMER"g_GodModeCounter[id] );
    } else {
        if ( 
is_user_connectedid ) )
            
set_user_godmodeid);
            
        
remove_taskTask_ID );
        
client_print_coloridid"^4[%s] ^1%L"g_TagLANG_PLAYER"GODMODE_EXPIRED" );
    }
}

/**
 * Hook Chapter
 * Handle_Hook: just handle after returning from main menu
 * Hook_Timer: time tick for speeding
 */
public Handle_Hook(id) {
    if ( ! 
is_user_aliveid ) || ! ( cs_get_user_team(id) == CS_TEAM_CT || cs_get_user_team(id) == CS_TEAM_T ) ) {
        
client_print_coloridid"^4[%s] ^1%L"g_TagLANG_PLAYER"CANT_BUY" );
        return 
PLUGIN_HANDLED;
    }
    if ( 
g_HookCounter[id] > ) {
        
client_print_coloridid"^4[%s] ^1%L"g_TagLANG_PLAYER"ALREADY_HOOK" );
        return 
PLUGIN_HANDLED;
    }
    
    
mset_user_fragsidget_user_frags(id) - g_Items[3][0] );
    
g_HookCounter[id] = g_Items[3][1];
    
    new 
Param[1];
    
Param[0] = id;
    
set_task1.0"Hook_Timer"_Paramsizeof(Param), "b" );
    
    
server_cmd"amx_givehook %d"id );
    
client_print_coloridid"^4[%s] ^1%L"g_TagLANG_PLAYER"HAVE_HOOK" );
    
client_print_coloridid"^4[%s] ^1%L"g_TagLANG_PLAYER"HOOK_BIND" );
    
Flash_Playerid00255 );
    return 
PLUGIN_HANDLED;
}

public 
Hook_Timer(Params[], Task_ID) {
    new 
id Params[0];
    
    
g_HookCounter[id] = g_HookCounter[id] - 1;
    
    if ( 
g_HookCounter[id] > ) {
        
client_printidprint_center"%L"LANG_PLAYER"HOOK_TIMER"g_HookCounter[id] );
    } else {
        if ( 
is_user_connectedid ) )
            
server_cmd"amx_takehook %d"id );
            
        
remove_taskTask_ID );
        
client_print_coloridid"^4[%s] ^1%L"g_TagLANG_PLAYER"HOOK_EXPIRED" );
    }
}

/************************/
public Do_SetFrags(idlevelcid) {
    if ( ! 
cmd_accessidlevelcid))
        return 
PLUGIN_HANDLED;
    
    new 
PlayerArg[24];
    new 
FragArg[4];
    
    
read_argv1PlayerArg23 );
    
read_argv2FragArg);

    new 
Frags str_to_num(FragArg);
    
    new 
szTargetName[64];
    new 
szAdminName[64];
    new 
szAdminAuthID[128];
    
    
get_user_nameidszAdminNamecharsmaxszAdminName ) );
    
get_user_authididszAdminAuthIDcharsmaxszAdminAuthID ) );
    
    if ( 
PlayerArg[0] == '@') {
        new 
Team 0;
        if ( 
equali(PlayerArg[1], "CT")) {
            
Team 2;
        } else {
            
Team 1;
        }
        
        new 
players[32], num;
        
get_playersplayersnum );
        
        new 
i;
        for ( 
0numi++ ) {
            if ( ! 
Team ) {
                
mset_user_frags(players[i], Frags);
                
copyszTargetName63"All players" );
            } else {
                if (
get_user_team(players[i])== Team) {
                    
mset_user_frags(players[i], Frags);
                    
copyszTargetName63"Certain team" );
                }
            }
        }
    } else {
        new 
player cmd_target(idPlayerArg2);
        if ( ! 
player ) {
            
console_printid"[AMXX] %L"LANG_PLAYER"NO_ACC_COM" );
            return 
PLUGIN_HANDLED;
        } else {
            
get_user_nameplayerszTargetName63 );
            
mset_user_fragsplayerFrags );
        }
    }
    
log_amx"[DM Shop] %s (%s) set %d frags to %s"szAdminNameszAdminAuthIDFragsszTargetName );
    
console_printid"[AMXX] %L"LANG_PLAYER"CON_SET_FRAG" );
    
    return 
PLUGIN_HANDLED;
}

public 
Do_AddFrags(idlevelcid) {
    if ( ! 
cmd_accessidlevelcid))
        return 
PLUGIN_HANDLED;
    
    new 
PlayerArg[24];
    new 
FragArg[4];
    
    
read_argv1PlayerArg23 );
    
read_argv2FragArg);
    
    new 
Frags str_to_num(FragArg);
    
    new 
szTargetName[64];
    new 
szAdminName[64];
    new 
szAdminAuthID[128];
    
    
get_user_nameidszAdminNamecharsmaxszAdminName ) );
    
get_user_authididszAdminAuthIDcharsmaxszAdminAuthID ) );
    
    if ( 
PlayerArg[0] == '@') {
        new 
Team 0;
        if ( 
equali(PlayerArg[1], "CT")) {
            
Team 2;
        } else {
            
Team 1;
        }
        
        new 
players[32], num;
        
get_playersplayersnum );
        
        new 
i;
        for ( 
0numi++ ) {
            if ( ! 
Team ) {
                
mset_user_frags(players[i], get_user_frags(players[i]) + Frags);
                
copyszTargetName63"All Players" );
            } else {
                if (
get_user_team(players[i])== Team) {
                    
mset_user_frags(players[i], get_user_frags(players[i]) + Frags);
                    
copyszTargetName63"Certain team" );
                }
            }
        }
    } else {
        new 
player cmd_target(idPlayerArg2);
        if ( ! 
player ) {
            
console_printid"[AMXX] %L"LANG_PLAYER"NO_ACC_COM" );
            return 
PLUGIN_HANDLED;
        } else {
            
get_user_nameplayerszTargetName63 );
            
mset_user_frags(playerget_user_frags(player) + Frags);
        }
    }
    
log_amx"[DM Shop] %s (%s) added %d frags to %s"szAdminNameszAdminAuthIDFragsszTargetName );
    
console_printid"[AMXX] %L"LANG_PLAYER"CON_FRAG_ADD" );
    
    return 
PLUGIN_HANDLED;
}

public 
Do_ExpireBonus(idlevelcid) {
    if ( ! 
cmd_accessidlevelcid))
        return 
PLUGIN_HANDLED;
    
    new 
PlayerArg[24];
    
    
read_argv1PlayerArg23 );
    
    new 
szTargetName[64];
    new 
szAdminName[64];
    new 
szAdminAuthID[128];
    
    
get_user_nameidszAdminNamecharsmaxszAdminName ) );
    
get_user_authididszAdminAuthIDcharsmaxszAdminAuthID ) );
    
    if ( 
PlayerArg[0] == '@') {
        new 
Team 0;
        if ( 
equali(PlayerArg[1], "CT")) {
            
Team 2;
        } else {
            
Team 1;
        }
        
        new 
players[32], num;
        
get_playersplayersnum );
        
        new 
i;
        for ( 
0numi++ ) {
            if ( ! 
Team ) {
                
copyszTargetName63"All players" );
                new 
idx players[i];
                
g_GlowCounter[idx] = 0;
                
g_SpeedCounter[idx] = 0;
                
g_GodModeCounter[idx] = 0;
                
g_HookCounter[idx] = 0;
                
client_print_coloridxid"^4[%s] ^3%s ^1%L"g_TagszAdminNameLANG_PLAYER"EXPIRED" );
                
            } else {
                if (
get_user_team(players[i])== Team) {
                    
copyszTargetName63"Certain team" );
                    new 
idx players[i];
                    
g_GlowCounter[idx] = 0;
                    
g_SpeedCounter[idx] = 0;
                    
g_GodModeCounter[idx] = 0;
                    
g_HookCounter[idx] = 0;
                    
client_print_coloridxid"^4[%s] ^3%s ^1%L"g_TagszAdminNameLANG_PLAYER"EXPIRED" );
                }
            }
        }
    } else {
        new 
player cmd_target(idPlayerArg2);
        if ( ! 
player ) {
            
console_printid"[AMXX] %L"LANG_PLAYER"NO_ACC_COM" );
            return 
PLUGIN_HANDLED;
        } else {
            
g_GlowCounter[player] = 0;
            
g_SpeedCounter[player] = 0;
            
g_GodModeCounter[player] = 0;
            
g_HookCounter[player] = 0;
            
client_print_colorplayerid"^4[%s] ^3%s ^1%L"g_TagszAdminNameLANG_PLAYER"EXPIRED" );
        }
    }
    
console_printid"[AMXX] %L"LANG_PLAYER"CON_EXPIRED" );
    
    return 
PLUGIN_HANDLED;
}

public 
Fw_Spawn_PostiPlayer ) {
    if ( 
is_user_aliveiPlayer ) ) {
        
client_print_coloriPlayeriPlayer"^4[%s] ^1For opening shop menu, just type ^4/shop ^1in chat."g_Tag );
        if ( 
g_GlowCounter[iPlayer] > )
            
set_user_renderingiPlayerkRenderFxGlowShellg_GlowRGB[iPlayer][0], g_GlowRGB[iPlayer][1], g_GlowRGB[iPlayer][2], kRenderTransAlpha20 );
        
        if ( 
g_HookCounter[iPlayer] > )
            
server_cmd"amx_givehook %d"iPlayer );
        
        if ( 
g_SpeedCounter[iPlayer] > )
            
set_user_maxspeediPlayerget_user_maxspeediPlayer ) + 500.0 );
        
        if ( 
g_GodModeCounter[iPlayer] > )
            
set_user_godmodeiPlayer);
    }
}

public 
Fw_Change_Wepid ) {
    if ( 
g_SpeedCounter[id] > ) {
        
set_user_maxspeedid820.0 ); // It's result of 320.0 (default speed) + 500.0 (added speed)
    
}
}

/** Set up a flash **/
public Flash_PlayeridiRediGreeniBlue ) {
    
message_beginMSG_ONEg_FlashMsg, {0,0,0}, id );
    
write_short1<<12 );
    
write_short1<<10 );
    
write_short1<<12 );
    
write_byteiRed );
    
write_byteiGreen );
    
write_byteiBlue );
    
write_byte50 );
    
message_end( );
}

/** 
 * Set a player frag & Update Scoreboard
 * Thanks to Jhob94 at AlliedMods
 */
public mset_user_frags(idfrags) {
    
set_user_fragsidfrags );
    
message_beginMSG_ALLget_user_msgid"ScoreInfo" ) );
    
write_byteid );
    
write_shortget_user_fragsid ) );
    
write_shortget_user_deathsid ) );
    
write_short);
    
write_shortget_user_teamid ) );
    
message_end();

This one is .txt file

PHP Code:
[en]
CANT_BUY You can't buy anything.
GLOW_ITEM = %s Glow %s[%d Frags] -%s %d Seconds
HP_ITEM = %s +%d HP %s[%d Frags] -%s Until next spawn
SPEED_ITEM = %s Speed %s[%d Frags] -%s %d Seconds
HOOK_ITEM = %s Hook %s[%d Frags] -%s %d Seconds
GOD_ITEM = %s GodMode %s[%d Frags] -%s %d Seconds
BUY_MENU_TITLE = Buy Menu:
COLOR_MENU_TITLE = Select a color:
NOT_ENOUGH = You don'
t have enough frags!
ALREADY_GLOW You already have ^4Glow ^1item!
HAVE_GLOW You have ^4Glow ^1now!
GLOW_TIMER Your Glow will be expired in %d Seconds!
GLOW_EXPIRED Your ^3Glow timer ^1has been expired!
HAVE_HP You've got +%d HP!
HAVE_SPEED = You'
ve got ^4Extra Speeeeeeed! ^1Wheeeezzzz...
SPEED_TIMER Your Speed will return back to normal in %d Seconds
SPEED_EXPIRED 
Your extra speed ^3Returned back to normal ^1!
ALREADY_GODMODE You already have ^4GodMode^1!
HAVE_GODMODE NowYou have ^4GodMode Item^1!
GODMODE_TIMER Your Godmode will be ended in %d Seconds
GODMODE_EXPIRED 
Your Godmode ^3has been expired^1!
ALREADY_HOOK You already have ^4Hook Item^1!
HAVE_HOOK NowYou have ^4Hook Item^1!
HOOK_BIND = For hooking, use ^4+hook ^1bind
HOOK_TIMER 
Your Hook will be taken in %d Seconds
HOOK_EXPIRED 
Your Hook ^3Has been taken!^1
CON_SET_FRAG 
Frag has been set successfully!
CON_FRAG_ADD Frags has been added!
CON_EXPIRED Player bonus expired successfully!
EXPIRED Expired your bonus!

[
fa]
CANT_BUY Shoma Nemitonid Chizi Bekharid
GLOW_ITEM 
= %s Glow %s[%d Frags] -%%d Sanie
HP_ITEM 
= %+%d HP %s[%d Frags] -%s Ta Spawn Baadi
SPEED_ITEM 
= %s Sorat %s[%d Frags] -%%d Sanie
HOOK_ITEM 
= %s Hook %s[%d Frags] -%%d Sanie
GOD_ITEM 
= %s GodMode %s[%d Frags] -%%d Sanie
BUY_MENU_TITLE 
Menu Kharid:
COLOR_MENU_TITLE Yek Rang Ra Entekhab Konid:
NOT_ENOUGH Shoma Frag-e Kaafi Nadarid
ALREADY_GLOW 
Shoma Item ^4Glow ^1Ra Darid!
HAVE_GLOW Shoma Hala ^4Glow ^1Darid!
GLOW_TIMER Glow Shoma Ta %d Sanie Digar Tamam Mishavad!
GLOW_EXPIRED = ^3Zamane Glow Shoma ^1Be Payan Resid!
HAVE_HP Shoma +%d HP Dariaft Kardid!
HAVE_SPEED Shoma Hala ^4Soraat ^1DaridWheeezzzz...
SPEED_TIMER Soraate Shoma Be Halet Ghabl Dar %d Sanie Bar Migardad
SPEED_EXPIRED 
Soraate Shoma ^3Bargasht be halat aval ^1!
ALREADY_GODMODE Shoma ^4GodMode^1 Ra Darid!
HAVE_GODMODE Alan,Shoma ^4GodMode Item^1 Darid!
GODMODE_TIMER GodMode Shoma Dar %d Sanie Tamam Mishavad
GODMODE_EXPIRED 
GodMode Shoma ^3Tamom Shod!
ALREADY_HOOK Shoma ^4Hook ^1Darid!
HAVE_HOOK Shoma Hala ^4Hook ^1Darid!
HOOK_BIND Baraye Zadane Hook Az ^4+hook^1 Estefade Konid.
HOOK_TIMER Hook Shoma %d Sanie Digar Gheire Faal Mishavad.
HOOK_EXPIRED Hook shoma ^3Gerfte Shod!^1
CON_SET_FRAG 
Frag Tanzim Shod!
CON_FRAG_ADD Frag Ezafe Shod!
CON_EXPIRED Jayze Player Ba Movafaghiyat Be Payan Resid!
EXPIRED Jayze Shoma Ra Gereft

[es]
CANT_BUY No puedes comprar nada.
GLOW_ITEM = %s Brillo %s[%d Muertes] -%%d Segundos
HP_ITEM 
= %+%d Vida %s[%d Muertes] -%s Hasta la proxima aparicion
SPEED_ITEM 
= %s Velocidad %s[%d Muertes] -%%d Segundos
HOOK_ITEM 
= %s Gancho %s[%d Muertes] -%%d Segundos
GOD_ITEM 
= %s Invencible %s[%d Muertes] -%%d Segundos
BUY_MENU_TITLE 
Tienda:
COLOR_MENU_TITLE Elige un color:
NOT_ENOUGH No tiene las suficientes muertes!
ALREADY_GLOW Ya tienes ^4Brillo ^1objeto!
HAVE_GLOW Ya tienes ^4Brillo ^1ahora!
GLOW_TIMER Tu brillo se ira dentro de %d segundos!
GLOW_EXPIRED Tu ^3Tiempo de brilllo ^1ha expirado!
HAVE_HP Tienes +%d de vida!
HAVE_SPEED Tienes ^4Velocidad extraaaaaaaa! ^1Rayossss!!...
SPEED_TIMER Tu velocidad volver a la normalidad en %d Segundos
SPEED_EXPIRED 
Tu velocidad extra ^3Ha vuelto a ser normal ^1!
ALREADY_GODMODE Ya tienes ^4Invencibilidad^1!
HAVE_GODMODE Ahora tienes ^4Invencibilidad objeto^1!
GODMODE_TIMER Tu invencibilidad expirara en %d Segundos
GODMODE_EXPIRED 
Tu invenciblidad ^3ha expirado^1!
ALREADY_HOOK Ya posees ^4Gancho objeto^1!
HAVE_HOOK NowYou have ^4Hook Item^1!
HOOK_BIND Para utilizar el ganchousa ^4+hook ^1bind
HOOK_TIMER 
Tu gancho expirara en %d Segundos
HOOK_EXPIRED 
Tu gancho ^3Ha expirado!^1
CON_SET_FRAG 
Las muertes han sido puestas correctamente!
CON_FRAG_ADD Las muertes han sido añadidas!
CON_EXPIRED Los bonus de los jugadores expiraron correctamente!
EXPIRED Tu bonus expiro
__________________

Last edited by SomewhereLost; 10-20-2018 at 23:08.
SomewhereLost is offline
Send a message via Skype™ to SomewhereLost
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 10-21-2018 , 07:50   Re: Issue with registering dictionary
Reply With Quote #2

Check the file enconding. It should be UTF8 without BOM or ANSI. Also, you're using LANG_PLAYER incorrectly.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
SomewhereLost
AlliedModders Donor
Join Date: Mar 2014
Location: Tomorrowland
Old 10-21-2018 , 09:32   Re: Issue with registering dictionary
Reply With Quote #3

How am I supposed to use LANG_PLAYER ? I've other examples too and its used the same way.

EDIT: I just checked it, its UTF-8.
__________________

Last edited by SomewhereLost; 10-21-2018 at 09:38.
SomewhereLost is offline
Send a message via Skype™ to SomewhereLost
Kushfield
Member
Join Date: Jan 2017
Location: Estonia
Old 10-21-2018 , 10:41   Re: Issue with registering dictionary
Reply With Quote #4

LANG_PLAYER should be used only when you're printing out something for all players (using 0 as the id parameter), if you're sending a message to a single player, you should use id instead of LANG_PLAYER.
Kushfield is offline
SomewhereLost
AlliedModders Donor
Join Date: Mar 2014
Location: Tomorrowland
Old 10-21-2018 , 11:50   Re: Issue with registering dictionary
Reply With Quote #5

Thought so, thats the case, I also used id but same result.
__________________
SomewhereLost is offline
Send a message via Skype™ to SomewhereLost
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 10-21-2018 , 12:16   Re: Issue with registering dictionary
Reply With Quote #6

Can you open your lang file in a hex editor and post the first 3 bytes of it?
__________________
klippy is offline
SomewhereLost
AlliedModders Donor
Join Date: Mar 2014
Location: Tomorrowland
Old 10-21-2018 , 12:53   Re: Issue with registering dictionary
Reply With Quote #7

https://imgur.com/a/Bw6IZRL

Is that what you mean?
__________________
SomewhereLost is offline
Send a message via Skype™ to SomewhereLost
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 10-21-2018 , 13:13   Re: Issue with registering dictionary
Reply With Quote #8

Yes, and your file contains BOM. OciXCrom told you it should be without BOM. You will find those 2 as separate encodings in any advanced editor.

Technical note: you can know that by the first 3 bytes: EF BB BF. If you look at the textual representation on the right side of the screenshot you will see that there are 3 "strange" characters before the "[en]", even though "[en]" is what you would see first when you open a text editor.
__________________

Last edited by klippy; 10-21-2018 at 13:15.
klippy is offline
SomewhereLost
AlliedModders Donor
Join Date: Mar 2014
Location: Tomorrowland
Old 10-21-2018 , 13:15   Re: Issue with registering dictionary
Reply With Quote #9

I used some online converters, also tried with notepad ++. How come it still contains BOM...
__________________

Last edited by SomewhereLost; 10-21-2018 at 13:19.
SomewhereLost is offline
Send a message via Skype™ to SomewhereLost
SomewhereLost
AlliedModders Donor
Join Date: Mar 2014
Location: Tomorrowland
Old 10-21-2018 , 13:37   Re: Issue with registering dictionary
Reply With Quote #10

Oh I get it now, Solved.

Thanks
__________________
SomewhereLost is offline
Send a message via Skype™ to SomewhereLost
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:11.


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