This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

Translate from french to english please


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BAMHS
Junior Member
Join Date: Dec 2010
Old 07-14-2013 , 12:02   Translate from french to english please
Reply With Quote #1

Code:
#include <amxmodx>
#include <cstrike>
#include <fun>
#include <hamsandwich>
#include <fakemeta>
#include <engine>

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

#define VERSION "1.0"

#define IsPlayer(%1) ( 1 <= %1 <= g_iMaxPlayers )

#define Ham_Player_ResetMaxSpeed Ham_Item_PreFrame

#pragma semicolon 1

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

new const g_prefix[] = "[Base Builder Shop]";
new const g_ModelSuperKnife[] = "models/furien_superknife.mdl";

new bool:g_bHasSuperKnife[33];
new bool:g_bHasSuperSpeed[33];

new g_iMaxPlayers;

new g_pCvarCostSuperCut,
	g_pCvarCostLowGrav,
	g_pCvarQuantityLowGrav,
	g_pCvarCostSpeed,
	g_pCvarQuantitySpeed,
	g_pCvarQuantityHealthCT,
	g_pCvarCostHealthCT,
	g_pCvarCostHE,
	g_pCvarCostFlash,
	g_pCvarCostSmoke,
	g_pCvarCostM249,
	g_pCvarCostG3SG9,
	g_pCvarQuantityHealthT1,
	g_pCvarCostHealthT1,
	g_pCvarQuantityHealthT2,
	g_pCvarCostHealthT2,
	g_pCvarCostInvisinsibilite,
	g_pCvarTimeInvisinsibilite;

public plugin_init()
{
	register_plugin("Base Builder Shop", VERSION, "Kid");

	register_clcmd("say /shop", "ShowShop");
	register_clcmd("say_team /shop", "ShowShop");
	register_clcmd("say shop", "ShowShop");
	register_clcmd("say_team shop", "ShowShop");

	// Cvars Mixtes
	g_pCvarCostSuperCut = register_cvar("shopbb_supercut", "10000");
	g_pCvarCostLowGrav = register_cvar("shopbb_grav", "8000");
	g_pCvarQuantityLowGrav = register_cvar("shopbb_quant_grav", "0.150");
	g_pCvarCostSpeed = register_cvar("shopbb_speed", "8000");
	g_pCvarQuantitySpeed = register_cvar("shopbb_quantity_speed", "400.0");
	
	// Cvars CT
	g_pCvarQuantityHealthCT = register_cvar("shopbb_vie_ct", "150");
	g_pCvarCostHealthCT = register_cvar("shopbb_prix_vie_ct", "5000");
	g_pCvarCostHE = register_cvar("shopbb_he", "2500");
	g_pCvarCostFlash = register_cvar("shopbb_flash", "2500");
	g_pCvarCostSmoke = register_cvar("shopbb_smoke", "2500");
	g_pCvarCostM249 = register_cvar("shopbb_m249", "8000");
	g_pCvarCostG3SG9 = register_cvar("shopbb_g3sg9", "8000");
	
	// Cvars T
	g_pCvarQuantityHealthT1 = register_cvar("shopbb_health_t1", "2000");
	g_pCvarCostHealthT1 = register_cvar("shopbb_prix_health_t1", "8000");
	g_pCvarQuantityHealthT2 = register_cvar("shopbb_health_t2", "5000");
	g_pCvarCostHealthT2 = register_cvar("shopbb_prix_health_t2", "16000");
	g_pCvarCostInvisinsibilite = register_cvar("shopbb_invins", "10000");
	g_pCvarTimeInvisinsibilite = register_cvar("shopbb_time_invins", "5.0");

	RegisterHam(Ham_Spawn, "player", "Player_Spawn_Post", 1);
	RegisterHam(Ham_TakeDamage, "player", "ham_TakeDamage_Pre");
	RegisterHam(Ham_Item_Deploy, "weapon_knife", "ham_ItemDeploy_Post", 1);
	RegisterHam(Ham_Player_ResetMaxSpeed, "player", "Player_ResetMaxSpeed",  1);
	
	g_iMaxPlayers = get_maxplayers();
}
 
public client_putinserver( id )
{ 
	g_bHasSuperKnife[id] = false;
	g_bHasSuperSpeed[id] = false;
}
 
public ShowShop(id)
{
	if ( is_user_alive(id) )
	{
		new Text[64];
		
		if(cs_get_user_team(id) == CS_TEAM_T)
		{
			new menu1 = menu_create("\y[\rZombie Shop\y]", "ZombieShop");
			formatex(Text, charsmax(Text), "\wVitesse \y[\r%d $\y]", get_pcvar_num(g_pCvarCostSpeed));
			menu_additem(menu1, Text, "0");
			formatex(Text, charsmax(Text), "\wGravity \y[\r%d $\y]", get_pcvar_num(g_pCvarCostLowGrav));
			menu_additem(menu1, Text, "1");
			formatex(Text, charsmax(Text), "\wSuper Cut \y[\r%d $\y]", get_pcvar_num(g_pCvarCostSuperCut));
			menu_additem(menu1, Text, "2");
			formatex(Text, charsmax(Text), "\w+%d HP \y[\r%d $\y]", get_pcvar_num(g_pCvarQuantityHealthT1), get_pcvar_num(g_pCvarCostHealthT1));
			menu_additem(menu1, Text, "3");
			formatex(Text, charsmax(Text), "\w+%d HP \y[\r%d $\y]", get_pcvar_num(g_pCvarQuantityHealthT2), get_pcvar_num(g_pCvarCostHealthT2));
			menu_additem(menu1, Text, "4");
			formatex(Text, charsmax(Text), "\wInvincible \y[\r%d $\y]", get_pcvar_num(g_pCvarCostInvisinsibilite));
			menu_additem(menu1, Text, "5");

			menu_setprop(menu1, MPROP_EXITNAME, "Quitter");

			menu_display(id, menu1);
		}

		else if(cs_get_user_team(id) == CS_TEAM_CT)
		{
			new menu2 = menu_create ("\y[\rBase Builder Shop\y]", "BaseBuilderShop");	
			formatex(Text, charsmax(Text), "\wSuper Cut \y[\r%d $\y]", get_pcvar_num(g_pCvarCostSuperCut));
			menu_additem(menu2, Text, "1");
			formatex(Text, charsmax(Text), "\wVitesse \y[\r%d $\y]", get_pcvar_num(g_pCvarCostSpeed));
			menu_additem(menu2, Text, "2");
			formatex(Text, charsmax(Text), "\wGravity \y[\r%d $\y]", get_pcvar_num(g_pCvarCostLowGrav));
			menu_additem(menu2, Text, "3");
			formatex(Text, charsmax(Text), "\w+%d HP \y[\r%d $\y]", get_pcvar_num(g_pCvarQuantityHealthCT), get_pcvar_num(g_pCvarCostHealthCT));
			menu_additem(menu2, Text, "4");
			formatex(Text, charsmax(Text), "\wGrenade \y[\r%d $\y]", get_pcvar_num(g_pCvarCostHE));
			menu_additem(menu2, Text, "5");
			formatex(Text, charsmax(Text), "\wFlash \y[\r%d $\y]", get_pcvar_num(g_pCvarCostFlash));
			menu_additem(menu2, Text, "6");
			formatex(Text, charsmax(Text), "\wSmoke \y[\r%d $\y]", get_pcvar_num(g_pCvarCostSmoke));
			menu_additem(menu2, Text, "7");
			formatex(Text, charsmax(Text), "\wM249 \y[\r%d $\y]", get_pcvar_num(g_pCvarCostM249));
			menu_additem(menu2, Text, "8");
			formatex(Text, charsmax(Text), "\wG3SG9 \y[\r%d $\y]", get_pcvar_num(g_pCvarCostG3SG9));
			menu_additem(menu2, Text, "9");
			menu_addblank(menu2, 0);
			menu_additem(menu2, "Quitter", "10");

			menu_setprop(menu2, MPROP_PERPAGE, 0);

			menu_display(id, menu2);
		}
	}
}

public ZombieShop(id, menu1, item)
{
	if (item == MENU_EXIT || !is_user_alive(id) || cs_get_user_team(id) != CS_TEAM_T) 
	{
		menu_destroy(menu1);
		return PLUGIN_HANDLED;
	}
	
	new iMoney = cs_get_user_money(id);

	switch(item)
	{
		case 0:
		{
			if ( iMoney >= get_pcvar_num(g_pCvarCostSpeed))
			{
				cs_set_user_money(id, iMoney - get_pcvar_num(g_pCvarCostSpeed));
				g_bHasSuperSpeed[id] = true;
				set_user_maxspeed(id, get_pcvar_float(g_pCvarQuantitySpeed));
				client_print_color(id, DontChange, "^4%s ^1Tu viens d'acheter la ^3Super Speed^1!", g_prefix);
			}
				
			else
			{
				client_print_color(id, DontChange, "^4%s ^1Tu n'as pas assez d'^3argent^1!", g_prefix);
			}
		}

		case 1:
		{
			if ( iMoney >= get_pcvar_num(g_pCvarCostLowGrav))
			{
				cs_set_user_money(id, iMoney - get_pcvar_num(g_pCvarCostLowGrav));
				set_user_gravity(id, get_pcvar_float(g_pCvarQuantityLowGrav));
				client_print_color(id, DontChange, "^4%s ^1Tu viens d'acheter la ^3Low Gravity^1!", g_prefix);
			}

			else
			{
				client_print_color(id, DontChange, "^4%s ^1Tu n'as pas assez d'^3argent^1!", g_prefix);
			}
		}

		case 2:
		{
			if ( iMoney >= get_pcvar_num(g_pCvarCostSuperCut))
			{
				cs_set_user_money(id, iMoney - get_pcvar_num(g_pCvarCostSuperCut));
				g_bHasSuperKnife[id] = true;
				client_print_color(id, DontChange, "^4%s ^1Tu viens d'acheter un ^3Super Cut^1!", g_prefix);
			}

			else
			{
				client_print_color(id, DontChange, "^4%s ^1Tu n'as pas assez d'^3argent^1!", g_prefix);
			}
		}
       
		case 3:
		{
			if ( iMoney >= get_pcvar_num(g_pCvarCostHealthT1))
			{             
				cs_set_user_money(id, iMoney - get_pcvar_num(g_pCvarCostHealthT1));
				set_user_health(id, get_user_health(id) + get_pcvar_num(g_pCvarQuantityHealthT1));
				client_print_color(id, DontChange, "^4%s ^1Tu viens d'acheter ^3%d HP^1!", g_prefix, get_pcvar_num(g_pCvarQuantityHealthT1));
			}

			else
			{
				client_print_color(id, DontChange, "^4%s ^1Tu n'as pas assez d'^3argent^1!", g_prefix);
			}
		}
       
		case 4:
		{
			if ( iMoney >= get_pcvar_num(g_pCvarCostHealthT2))
			{
				cs_set_user_money(id, iMoney - get_pcvar_num(g_pCvarCostHealthT2));
				set_user_health(id, get_user_health(id) + get_pcvar_num(g_pCvarQuantityHealthT2));
				client_print_color(id, DontChange, "^4%s ^1Tu viens d'acheter ^3%d HP^1!", g_prefix, get_pcvar_num(g_pCvarQuantityHealthT2));
			}

			else
			{
				client_print_color(id, DontChange, "^4%s ^1Tu n'as pas assez d'^3argent^1!", g_prefix);
			}
		}
	  
		case 5:
		{
			if ( iMoney >= get_pcvar_num(g_pCvarCostInvisinsibilite))
			{
				cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(g_pCvarCostInvisinsibilite));
				set_user_godmode(id, 1);
				set_task(0.0 + get_pcvar_float(g_pCvarTimeInvisinsibilite), "RemoveGodMode", 1);
				client_print_color(id, DontChange, "^4%s ^1Tu viens d'acheter l'^3invinsibilite^1 pour^3 quelques secondes^1!", g_prefix);
			}

			else
			{
				client_print_color(id, DontChange, "^4%s ^1Tu n'as pas assez d'^3argent^1!", g_prefix);
			}
		}	  
	}
	menu_destroy(menu1);
	return PLUGIN_HANDLED;
}

public RemoveGodMode(id)
{
	set_user_godmode(id, 0);
	client_print_color(id, DontChange, "^4%s ^1Tu n'es plus invincible!", g_prefix);
}

public BaseBuilderShop(id, menu2, item)
{
	if (item == 10 || !is_user_alive(id) || cs_get_user_team(id) != CS_TEAM_CT) 
	{
		menu_destroy(menu2);
		return PLUGIN_HANDLED;
	}
	
	new iMoney = cs_get_user_money(id);

	switch(item+1)
	{
		case 1:
		{
			if ( iMoney >= get_pcvar_num(g_pCvarCostSuperCut))
			{
				cs_set_user_money(id, iMoney - get_pcvar_num(g_pCvarCostSuperCut));
				g_bHasSuperKnife[id] = true;
				client_print_color(id, DontChange, "^4%s ^1Tu viens d'acheter un ^3Super Cut^1!", g_prefix);
			}

			else
			{
				client_print_color(id, DontChange, "^4%s ^1Tu n'as pas assez d'^3argent^1!", g_prefix);
			}
		}

		case 2:
		{
			if ( iMoney >= get_pcvar_num(g_pCvarCostSpeed))
			{             
				cs_set_user_money(id, iMoney - get_pcvar_num(g_pCvarCostSpeed));
				g_bHasSuperSpeed[id] = true;
				set_user_maxspeed(id, get_pcvar_float(g_pCvarQuantitySpeed));
				client_print_color(id, DontChange, "^4%s ^1Tu viens d'acheter la ^3Super Speed^1!", g_prefix);
			}

			else
			{
				client_print_color(id, DontChange, "^4%s ^1Tu n'as pas assez d'^3argent^1!", g_prefix);
			}
		}
       
		case 3:
		{
			if ( iMoney >= get_pcvar_num(g_pCvarCostLowGrav))
			{
				cs_set_user_money(id, iMoney - get_pcvar_num(g_pCvarCostLowGrav));
				set_user_gravity(id, get_pcvar_float(g_pCvarQuantityLowGrav));
				client_print_color(id, DontChange, "^4%s ^1Tu viens d'acheter la ^3Low Gravity^1!", g_prefix);
			}
                
			else
			{
				client_print_color(id, DontChange, "^4%s ^1Tu n'as pas assez d'^3argent^1!", g_prefix);
			}
		}
       
		case 4:
		{
			if ( iMoney >= get_pcvar_num(g_pCvarCostHealthCT))
			{             
				cs_set_user_money(id, iMoney - get_pcvar_num(g_pCvarCostHealthCT));
				set_user_health(id, get_user_health(id) + get_pcvar_num(g_pCvarQuantityHealthCT));
				client_print_color(id, DontChange, "^4%s ^1Tu viens d'acheter ^3%d HP^1!", g_prefix, get_pcvar_num(g_pCvarQuantityHealthCT));
			}

			else
			{
				client_print_color(id, DontChange, "^4%s ^1Tu n'as pas assez d'^3argent^1!", g_prefix);
			}
		}

		case 5:
		{
			if ( iMoney >= get_pcvar_num(g_pCvarCostHE))
			{
				cs_set_user_money(id, iMoney - get_pcvar_num(g_pCvarCostHE));
				give_item(id, "weapon_hegrenade");
				client_print_color(id, DontChange, "^4%s ^1Tu viens d'acheter une ^3HE^1!", g_prefix);
			}

			else
			{
				client_print_color(id, DontChange, "^4%s ^1Tu n'as pas assez d'^3argent^1!", g_prefix);
			}
		}

		case 6:
		{
			if ( iMoney >= get_pcvar_num(g_pCvarCostFlash))
			{
				cs_set_user_money(id, iMoney - get_pcvar_num(g_pCvarCostFlash));
				give_item(id, "weapon_flashbang");
				client_print_color(id, DontChange, "^4%s ^1Tu viens d'acheter une ^3Flash^1!", g_prefix);
			}
					
			else
			{
				client_print_color(id, DontChange, "^4%s ^1Tu n'as pas assez d'^3argent^1!", g_prefix);
			}
		}

		case 7:
		{
			if ( iMoney >= get_pcvar_num(g_pCvarCostSmoke))
			{
				cs_set_user_money(id, iMoney - get_pcvar_num(g_pCvarCostSmoke));
				give_item(id, "weapon_smokegrenade");
				client_print_color(id, DontChange, "^4%s ^1Tu viens d'acheter une ^3Smoke^1!", g_prefix);
			}
				
			else
			{
				client_print_color(id, DontChange, "^4%s ^1Tu n'as pas assez d'^3argent^1!", g_prefix);
			}
		}

		case 8:
		{
			if ( iMoney >= get_pcvar_num(g_pCvarCostM249))
			{
				cs_set_user_money(id, iMoney - get_pcvar_num(g_pCvarCostM249));
				give_item(id, "weapon_m249");
				cs_set_user_bpammo(id, CSW_M249, 200);
				client_print_color(id, DontChange, "^4%s ^1Tu viens d'acheter une ^3M249^1!", g_prefix);
			}
				
			else
			{
				client_print_color(id, DontChange, "^4%s ^1Tu n'as pas assez d'^3argent^1!", g_prefix);
			}
		}

		case 9:
		{
			if ( iMoney >= get_pcvar_num(g_pCvarCostG3SG9))
			{
				cs_set_user_money(id, iMoney - get_pcvar_num(g_pCvarCostG3SG9));
				give_item(id, "weapon_g3sg1");
				cs_set_user_bpammo(id, CSW_G3SG1, 90);
				client_print_color(id, DontChange, "^4%s ^1Tu viens d'acheter une ^3G3SG1^1!", g_prefix);
			}
			
			else
			{
				client_print_color(id, DontChange, "^4%s ^1Tu n'as pas assez d'^3argent^1!", g_prefix);
			}
		}		
	}
	menu_destroy(menu2);
	return PLUGIN_HANDLED;
}
 
public Player_Spawn_Post( id )
{
	if(is_user_alive(id))
	{
		client_print(id, print_chat, "Tape /shop dans le chat pour acheter un item!");
		g_bHasSuperKnife[id] = false;
		g_bHasSuperSpeed[id] = false;
	}
}
 
public client_disconnect(id)
{
	g_bHasSuperKnife[id] = false;
	g_bHasSuperSpeed[id] = false;
}
 
 
public plugin_precache()
{
	precache_model(g_ModelSuperKnife);
}
 
public ham_TakeDamage_Pre(victim, inflictor, attacker, Float:damage, damage_bits)
{
	if ( IsPlayer(attacker) && g_bHasSuperKnife[attacker] && is_user_alive(attacker) && inflictor == attacker && get_user_weapon(attacker) == CSW_KNIFE )
	{
		SetHamParamFloat( 4, damage * 77 );
	}
}
 
 
public ham_ItemDeploy_Post(weapon_ent)
{
	static owner;
	owner = get_pdata_cbase(weapon_ent, 41, 4);

	if(is_user_alive(owner) && g_bHasSuperKnife[owner])
	{
		set_pev(owner, pev_viewmodel2, g_ModelSuperKnife);
	}
}

public Player_ResetMaxSpeed(id)
{
    if( is_user_alive(id) && get_user_maxspeed(id) !=  -1.0 && g_bHasSuperSpeed[id])
    {
        set_user_maxspeed(id, get_pcvar_float(g_pCvarQuantitySpeed));
    }
}

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[i];

				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;
}
BAMHS is offline
K1d0x
Senior Member
Join Date: Apr 2012
Location: Copenhagen, Denmark
Old 07-15-2013 , 04:58   Re: Translate from french to english please
Reply With Quote #2

PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fun>
#include <hamsandwich>
#include <fakemeta>
#include <engine>

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

#define VERSION "1.0"

#define IsPlayer(%1) ( 1 <= %1 <= g_iMaxPlayers )

#define Ham_Player_ResetMaxSpeed Ham_Item_PreFrame

#pragma semicolon 1

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

new const 
g_prefix[] = "[Base Builder Shop]";
new const 
g_ModelSuperKnife[] = "models/furien_superknife.mdl";

new 
bool:g_bHasSuperKnife[33];
new 
bool:g_bHasSuperSpeed[33];

new 
g_iMaxPlayers;

new 
g_pCvarCostSuperCut,
    
g_pCvarCostLowGrav,
    
g_pCvarQuantityLowGrav,
    
g_pCvarCostSpeed,
    
g_pCvarQuantitySpeed,
    
g_pCvarQuantityHealthCT,
    
g_pCvarCostHealthCT,
    
g_pCvarCostHE,
    
g_pCvarCostFlash,
    
g_pCvarCostSmoke,
    
g_pCvarCostM249,
    
g_pCvarCostG3SG9,
    
g_pCvarQuantityHealthT1,
    
g_pCvarCostHealthT1,
    
g_pCvarQuantityHealthT2,
    
g_pCvarCostHealthT2,
    
g_pCvarCostInvisinsibilite,
    
g_pCvarTimeInvisinsibilite;

public 
plugin_init()
{
    
register_plugin("Base Builder Shop"VERSION"Kid");

    
register_clcmd("say /shop""ShowShop");
    
register_clcmd("say_team /shop""ShowShop");
    
register_clcmd("say shop""ShowShop");
    
register_clcmd("say_team shop""ShowShop");

    
// Cvars Mixtes
    
g_pCvarCostSuperCut register_cvar("shopbb_supercut""10000");
    
g_pCvarCostLowGrav register_cvar("shopbb_grav""8000");
    
g_pCvarQuantityLowGrav register_cvar("shopbb_quant_grav""0.150");
    
g_pCvarCostSpeed register_cvar("shopbb_speed""8000");
    
g_pCvarQuantitySpeed register_cvar("shopbb_quantity_speed""400.0");
    
    
// Cvars CT
    
g_pCvarQuantityHealthCT register_cvar("shopbb_vie_ct""150");
    
g_pCvarCostHealthCT register_cvar("shopbb_prix_vie_ct""5000");
    
g_pCvarCostHE register_cvar("shopbb_he""2500");
    
g_pCvarCostFlash register_cvar("shopbb_flash""2500");
    
g_pCvarCostSmoke register_cvar("shopbb_smoke""2500");
    
g_pCvarCostM249 register_cvar("shopbb_m249""8000");
    
g_pCvarCostG3SG9 register_cvar("shopbb_g3sg9""8000");
    
    
// Cvars T
    
g_pCvarQuantityHealthT1 register_cvar("shopbb_health_t1""2000");
    
g_pCvarCostHealthT1 register_cvar("shopbb_prix_health_t1""8000");
    
g_pCvarQuantityHealthT2 register_cvar("shopbb_health_t2""5000");
    
g_pCvarCostHealthT2 register_cvar("shopbb_prix_health_t2""16000");
    
g_pCvarCostInvisinsibilite register_cvar("shopbb_invins""10000");
    
g_pCvarTimeInvisinsibilite register_cvar("shopbb_time_invins""5.0");

    
RegisterHam(Ham_Spawn"player""Player_Spawn_Post"1);
    
RegisterHam(Ham_TakeDamage"player""ham_TakeDamage_Pre");
    
RegisterHam(Ham_Item_Deploy"weapon_knife""ham_ItemDeploy_Post"1);
    
RegisterHam(Ham_Player_ResetMaxSpeed"player""Player_ResetMaxSpeed",  1);
    
    
g_iMaxPlayers get_maxplayers();
}
 
public 
client_putinserverid )

    
g_bHasSuperKnife[id] = false;
    
g_bHasSuperSpeed[id] = false;
}
 
public 
ShowShop(id)
{
    if ( 
is_user_alive(id) )
    {
        new 
Text[64];
        
        if(
cs_get_user_team(id) == CS_TEAM_T)
        {
            new 
menu1 menu_create("\y[\rZombie Shop\y]""ZombieShop");
            
formatex(Textcharsmax(Text), "\wSpeed \y[\r%d $\y]"get_pcvar_num(g_pCvarCostSpeed));
            
menu_additem(menu1Text"0");
            
formatex(Textcharsmax(Text), "\wGravity \y[\r%d $\y]"get_pcvar_num(g_pCvarCostLowGrav));
            
menu_additem(menu1Text"1");
            
formatex(Textcharsmax(Text), "\wSuper Cut \y[\r%d $\y]"get_pcvar_num(g_pCvarCostSuperCut));
            
menu_additem(menu1Text"2");
            
formatex(Textcharsmax(Text), "\w+%d HP \y[\r%d $\y]"get_pcvar_num(g_pCvarQuantityHealthT1), get_pcvar_num(g_pCvarCostHealthT1));
            
menu_additem(menu1Text"3");
            
formatex(Textcharsmax(Text), "\w+%d HP \y[\r%d $\y]"get_pcvar_num(g_pCvarQuantityHealthT2), get_pcvar_num(g_pCvarCostHealthT2));
            
menu_additem(menu1Text"4");
            
formatex(Textcharsmax(Text), "\wGodMode \y[\r%d $\y]"get_pcvar_num(g_pCvarCostInvisinsibilite));
            
menu_additem(menu1Text"5");

            
menu_setprop(menu1MPROP_EXITNAME"Quit");

            
menu_display(idmenu1);
        }

        else if(
cs_get_user_team(id) == CS_TEAM_CT)
        {
            new 
menu2 menu_create ("\y[\rBase Builder Shop\y]""BaseBuilderShop");    
            
formatex(Textcharsmax(Text), "\wSuper Cut \y[\r%d $\y]"get_pcvar_num(g_pCvarCostSuperCut));
            
menu_additem(menu2Text"1");
            
formatex(Textcharsmax(Text), "\wSpeed \y[\r%d $\y]"get_pcvar_num(g_pCvarCostSpeed));
            
menu_additem(menu2Text"2");
            
formatex(Textcharsmax(Text), "\wGravity \y[\r%d $\y]"get_pcvar_num(g_pCvarCostLowGrav));
            
menu_additem(menu2Text"3");
            
formatex(Textcharsmax(Text), "\w+%d HP \y[\r%d $\y]"get_pcvar_num(g_pCvarQuantityHealthCT), get_pcvar_num(g_pCvarCostHealthCT));
            
menu_additem(menu2Text"4");
            
formatex(Textcharsmax(Text), "\wGrenade \y[\r%d $\y]"get_pcvar_num(g_pCvarCostHE));
            
menu_additem(menu2Text"5");
            
formatex(Textcharsmax(Text), "\wFlash \y[\r%d $\y]"get_pcvar_num(g_pCvarCostFlash));
            
menu_additem(menu2Text"6");
            
formatex(Textcharsmax(Text), "\wSmoke \y[\r%d $\y]"get_pcvar_num(g_pCvarCostSmoke));
            
menu_additem(menu2Text"7");
            
formatex(Textcharsmax(Text), "\wM249 \y[\r%d $\y]"get_pcvar_num(g_pCvarCostM249));
            
menu_additem(menu2Text"8");
            
formatex(Textcharsmax(Text), "\wG3SG9 \y[\r%d $\y]"get_pcvar_num(g_pCvarCostG3SG9));
            
menu_additem(menu2Text"9");
            
menu_addblank(menu20);
            
menu_additem(menu2"Quit""10");

            
menu_setprop(menu2MPROP_PERPAGE0);

            
menu_display(idmenu2);
        }
    }
}

public 
ZombieShop(idmenu1item)
{
    if (
item == MENU_EXIT || !is_user_alive(id) || cs_get_user_team(id) != CS_TEAM_T
    {
        
menu_destroy(menu1);
        return 
PLUGIN_HANDLED;
    }
    
    new 
iMoney cs_get_user_money(id);

    switch(
item)
    {
        case 
0:
        {
            if ( 
iMoney >= get_pcvar_num(g_pCvarCostSpeed))
            {
                
cs_set_user_money(idiMoney get_pcvar_num(g_pCvarCostSpeed));
                
g_bHasSuperSpeed[id] = true;
                
set_user_maxspeed(idget_pcvar_float(g_pCvarQuantitySpeed));
                
client_print_color(idDontChange"^4%s ^1You just buy the ^3Super Speed^1!"g_prefix);
            }
                
            else
            {
                
client_print_color(idDontChange"^4%s ^1You do not have enough ^3money^1!"g_prefix);
            }
        }

        case 
1:
        {
            if ( 
iMoney >= get_pcvar_num(g_pCvarCostLowGrav))
            {
                
cs_set_user_money(idiMoney get_pcvar_num(g_pCvarCostLowGrav));
                
set_user_gravity(idget_pcvar_float(g_pCvarQuantityLowGrav));
                
client_print_color(idDontChange"^4%s ^1You just buy the ^3Low Gravity^1!"g_prefix);
            }

            else
            {
                
client_print_color(idDontChange"^4%s ^1You do no have enough ^3money^1!"g_prefix);
            }
        }

        case 
2:
        {
            if ( 
iMoney >= get_pcvar_num(g_pCvarCostSuperCut))
            {
                
cs_set_user_money(idiMoney get_pcvar_num(g_pCvarCostSuperCut));
                
g_bHasSuperKnife[id] = true;
                
client_print_color(idDontChange"^4%s ^1You just bought a ^3Super Cut^1!"g_prefix);
            }

            else
            {
                
client_print_color(idDontChange"^4%s ^1You do no have enough ^3money^1!"g_prefix);
            }
        }
       
        case 
3:
        {
            if ( 
iMoney >= get_pcvar_num(g_pCvarCostHealthT1))
            {             
                
cs_set_user_money(idiMoney get_pcvar_num(g_pCvarCostHealthT1));
                
set_user_health(idget_user_health(id) + get_pcvar_num(g_pCvarQuantityHealthT1));
                
client_print_color(idDontChange"^4%s ^1You just bought ^3%d HP^1!"g_prefixget_pcvar_num(g_pCvarQuantityHealthT1));
            }

            else
            {
                
client_print_color(idDontChange"^4%s ^1You do no have enough ^3money^1!"g_prefix);
            }
        }
       
        case 
4:
        {
            if ( 
iMoney >= get_pcvar_num(g_pCvarCostHealthT2))
            {
                
cs_set_user_money(idiMoney get_pcvar_num(g_pCvarCostHealthT2));
                
set_user_health(idget_user_health(id) + get_pcvar_num(g_pCvarQuantityHealthT2));
                
client_print_color(idDontChange"^4%s ^1You just bought ^3%d HP^1!"g_prefixget_pcvar_num(g_pCvarQuantityHealthT2));
            }

            else
            {
                
client_print_color(idDontChange"^4%s ^1You do not have enough ^3money^1!"g_prefix);
            }
        }
      
        case 
5:
        {
            if ( 
iMoney >= get_pcvar_num(g_pCvarCostInvisinsibilite))
            {
                
cs_set_user_money(idcs_get_user_money(id) - get_pcvar_num(g_pCvarCostInvisinsibilite));
                
set_user_godmode(id1);
                
set_task(0.0 get_pcvar_float(g_pCvarTimeInvisinsibilite), "RemoveGodMode"1);
                
client_print_color(idDontChange"^4%s ^1You just bought ^3godmode^1 for^3 a few seconds^1!"g_prefix);
            }

            else
            {
                
client_print_color(idDontChange"^4%s ^1You do not have enough ^3money^1!"g_prefix);
            }
        }      
    }
    
menu_destroy(menu1);
    return 
PLUGIN_HANDLED;
}

public 
RemoveGodMode(id)
{
    
set_user_godmode(id0);
    
client_print_color(idDontChange"^4%s ^1You're not invincible anymore!"g_prefix);
}

public 
BaseBuilderShop(idmenu2item)
{
    if (
item == 10 || !is_user_alive(id) || cs_get_user_team(id) != CS_TEAM_CT
    {
        
menu_destroy(menu2);
        return 
PLUGIN_HANDLED;
    }
    
    new 
iMoney cs_get_user_money(id);

    switch(
item+1)
    {
        case 
1:
        {
            if ( 
iMoney >= get_pcvar_num(g_pCvarCostSuperCut))
            {
                
cs_set_user_money(idiMoney get_pcvar_num(g_pCvarCostSuperCut));
                
g_bHasSuperKnife[id] = true;
                
client_print_color(idDontChange"^4%s ^1You just bought a ^3Super Cut^1!"g_prefix);
            }

            else
            {
                
client_print_color(idDontChange"^4%s ^1You do not have enough ^3money^1!"g_prefix);
            }
        }

        case 
2:
        {
            if ( 
iMoney >= get_pcvar_num(g_pCvarCostSpeed))
            {             
                
cs_set_user_money(idiMoney get_pcvar_num(g_pCvarCostSpeed));
                
g_bHasSuperSpeed[id] = true;
                
set_user_maxspeed(idget_pcvar_float(g_pCvarQuantitySpeed));
                
client_print_color(idDontChange"^4%s ^1You just buy the ^3Super Speed^1!"g_prefix);
            }

            else
            {
                
client_print_color(idDontChange"^4%s ^1You do not have enough ^3money^1!"g_prefix);
            }
        }
       
        case 
3:
        {
            if ( 
iMoney >= get_pcvar_num(g_pCvarCostLowGrav))
            {
                
cs_set_user_money(idiMoney get_pcvar_num(g_pCvarCostLowGrav));
                
set_user_gravity(idget_pcvar_float(g_pCvarQuantityLowGrav));
                
client_print_color(idDontChange"^4%s ^1You just buy the ^3Low Gravity^1!"g_prefix);
            }
                
            else
            {
                
client_print_color(idDontChange"^4%s ^1You do not have enough ^3money^1!"g_prefix);
            }
        }
       
        case 
4:
        {
            if ( 
iMoney >= get_pcvar_num(g_pCvarCostHealthCT))
            {             
                
cs_set_user_money(idiMoney get_pcvar_num(g_pCvarCostHealthCT));
                
set_user_health(idget_user_health(id) + get_pcvar_num(g_pCvarQuantityHealthCT));
                
client_print_color(idDontChange"^4%s ^1You just bought ^3%d HP^1!"g_prefixget_pcvar_num(g_pCvarQuantityHealthCT));
            }

            else
            {
                
client_print_color(idDontChange"^4%s ^1You do not have enough ^3money^1!"g_prefix);
            }
        }

        case 
5:
        {
            if ( 
iMoney >= get_pcvar_num(g_pCvarCostHE))
            {
                
cs_set_user_money(idiMoney get_pcvar_num(g_pCvarCostHE));
                
give_item(id"weapon_hegrenade");
                
client_print_color(idDontChange"^4%s ^1You just bought one ^3HE^1!"g_prefix);
            }

            else
            {
                
client_print_color(idDontChange"^4%s ^1You do not have enough ^3money^1!"g_prefix);
            }
        }

        case 
6:
        {
            if ( 
iMoney >= get_pcvar_num(g_pCvarCostFlash))
            {
                
cs_set_user_money(idiMoney get_pcvar_num(g_pCvarCostFlash));
                
give_item(id"weapon_flashbang");
                
client_print_color(idDontChange"^4%s ^1You just bought one ^3Flash^1!"g_prefix);
            }
                    
            else
            {
                
client_print_color(idDontChange"^4%s ^1You do not have enough ^3money^1!"g_prefix);
            }
        }

        case 
7:
        {
            if ( 
iMoney >= get_pcvar_num(g_pCvarCostSmoke))
            {
                
cs_set_user_money(idiMoney get_pcvar_num(g_pCvarCostSmoke));
                
give_item(id"weapon_smokegrenade");
                
client_print_color(idDontChange"^4%s ^1You just bought one ^3Smoke^1!"g_prefix);
            }
                
            else
            {
                
client_print_color(idDontChange"^4%s ^1You do not have enough ^3money^1!"g_prefix);
            }
        }

        case 
8:
        {
            if ( 
iMoney >= get_pcvar_num(g_pCvarCostM249))
            {
                
cs_set_user_money(idiMoney get_pcvar_num(g_pCvarCostM249));
                
give_item(id"weapon_m249");
                
cs_set_user_bpammo(idCSW_M249200);
                
client_print_color(idDontChange"^4%s ^1You just bought one ^3M249^1!"g_prefix);
            }
                
            else
            {
                
client_print_color(idDontChange"^4%s ^1You do not have enough ^3money^1!"g_prefix);
            }
        }

        case 
9:
        {
            if ( 
iMoney >= get_pcvar_num(g_pCvarCostG3SG9))
            {
                
cs_set_user_money(idiMoney get_pcvar_num(g_pCvarCostG3SG9));
                
give_item(id"weapon_g3sg1");
                
cs_set_user_bpammo(idCSW_G3SG190);
                
client_print_color(idDontChange"^4%s ^1You just bought one ^3G3SG1^1!"g_prefix);
            }
            
            else
            {
                
client_print_color(idDontChange"^4%s ^1You do not have enough ^3money^1!"g_prefix);
            }
        }        
    }
    
menu_destroy(menu2);
    return 
PLUGIN_HANDLED;
}
 
public 
Player_Spawn_Postid )
{
    if(
is_user_alive(id))
    {
        
client_print(idprint_chat"Type /shop in chat to buy an item !");
        
g_bHasSuperKnife[id] = false;
        
g_bHasSuperSpeed[id] = false;
    }
}
 
public 
client_disconnect(id)
{
    
g_bHasSuperKnife[id] = false;
    
g_bHasSuperSpeed[id] = false;
}
 
 
public 
plugin_precache()
{
    
precache_model(g_ModelSuperKnife);
}
 
public 
ham_TakeDamage_Pre(victiminflictorattackerFloat:damagedamage_bits)
{
    if ( 
IsPlayer(attacker) && g_bHasSuperKnife[attacker] && is_user_alive(attacker) && inflictor == attacker && get_user_weapon(attacker) == CSW_KNIFE )
    {
        
SetHamParamFloat4damage 77 );
    }
}
 
 
public 
ham_ItemDeploy_Post(weapon_ent)
{
    static 
owner;
    
owner get_pdata_cbase(weapon_ent414);

    if(
is_user_alive(owner) && g_bHasSuperKnife[owner])
    {
        
set_pev(ownerpev_viewmodel2g_ModelSuperKnife);
    }
}

public 
Player_ResetMaxSpeed(id)
{
    if( 
is_user_alive(id) && get_user_maxspeed(id) !=  -1.0 && g_bHasSuperSpeed[id])
    {
        
set_user_maxspeed(idget_pcvar_float(g_pCvarQuantitySpeed));
    }
}

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

stock client_print_color(idiColor=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 == )
        {
            
copy(szMessage[1], charsmax(szMessage)-1szMsg);
        }
        else
        {
            
vformat(szMessage[1], charsmax(szMessage)-1szMsg4);
        }

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

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

            
// Send the message
            
Send_SayText(ididszMessage);

            
// restore TeamInfo
            
Send_TeamInfo(ididszTeam);
        }
        else
        {
            
Send_SayText(ididszMessage);
        }
    } 

    
// 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(iPlayersiNum"ch");
        if( !
iNum )
        {
            return 
0;
        }

        new 
iFool iPlayers[0];

        new 
iMlNumberij;
        new Array:
aStoreML ArrayCreate();
        if( 
iParams >= // ML can be used
        
{
            for(
j=4j<iParamsj++)
            {
                
// 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] = getarg1i++ ) ) ) {}
                    if( 
GetLangTransKey(szMessage) != TransKey_Bad )
                    {
                        
// Store that arg as LANG_PLAYER so we can alter it later
                        
ArrayPushCell(aStoreMLj++);

                        
// 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 == )
            {
                
copy(szMessage[1], charsmax(szMessage)-1szMsg);
            }
            else
            {
                
vformat(szMessage[1], charsmax(szMessage)-1szMsg4);
            }

            if( 
iColor )
            {
                new 
szTeam[11];
                
get_user_team(iFoolszTeamcharsmax(szTeam));
                
Send_TeamInfo(0iFoolg_szTeamName[iColor]);
                
Send_SayText(0iFoolszMessage);
                
Send_TeamInfo(0iFoolszTeam);
            }
            else
            {
                
Send_SayText(0iFoolszMessage);
            }
        }

        
// 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(iFoolszTeamcharsmax(szTeam));
                
copy(szFakeTeamcharsmax(szFakeTeam), g_szTeamName[iColor]);
            }

            for( 
0iNumi++ )
            {
                
id iPlayers[i];

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

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

                if( 
iColor )
                {
                    
Send_TeamInfo(idiFoolszFakeTeam);
                    
Send_SayText(idiFoolszMessage);
                    
Send_TeamInfo(idiFoolszTeam);
                }
                else
                {
                    
Send_SayText(idiFoolszMessage);
                }
            }
            
ArrayDestroy(aStoreML);
        }
    }
    return 
1;
}

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

stock Send_SayText(iReceiveriPlayerIdszMessage[])
{
    static 
iSayText 0;
    if( !
iSayText )
    {
        
iSayText get_user_msgid("SayText");
    }
    
message_begin(iReceiver MSG_ONE_UNRELIABLE MSG_BROADCASTiSayText, .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"szFileNamecharsmax(szFileName));
    
format(szFileNamecharsmax(szFileName), "%s/lang/%s"szFileNamefilename);
    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(fpszBuffercharsmax(szBuffer));
        
trim(szBuffer);

        if( 
szBuffer[0] == '[' )
        {
            
strtok(szBuffer[1], szLangcharsmax(szLang), szBuffer1']');
        }
        else if( 
szBuffer[0] )
        {
            
strbreak(szBufferszKeycharsmax(szKey), szTranslationcharsmax(szTranslation));
            
iKey GetLangTransKey(szKey);
            if( 
iKey != TransKey_Bad )
            {
                while( 
replace(szTranslationcharsmax(szTranslation), "!g""^4") ){}
                while( 
replace(szTranslationcharsmax(szTranslation), "!t""^3") ){}
                while( 
replace(szTranslationcharsmax(szTranslation), "!n""^1") ){}
                
AddTranslation(szLangiKeyszTranslation[2]);
            }
        }
    }
    
    
fclose(fp);
    return 
1;

__________________
I Hate people who can hate me !
K1d0x is offline
Send a message via Yahoo to K1d0x Send a message via Skype™ to K1d0x
BAMHS
Junior Member
Join Date: Dec 2010
Old 07-16-2013 , 16:16   Re: Translate from french to english please
Reply With Quote #3

cheers bro! u a life saver!

Lock this plz.
BAMHS is offline
BAMHS
Junior Member
Join Date: Dec 2010
Old 07-16-2013 , 19:28   Re: Translate from french to english please
Reply With Quote #4

SuperKnife not working!
BAMHS is offline
K1d0x
Senior Member
Join Date: Apr 2012
Location: Copenhagen, Denmark
Old 07-17-2013 , 12:30   Re: Translate from french to english please
Reply With Quote #5

Not working to buy, or you buy but doesn't have power?
__________________
I Hate people who can hate me !
K1d0x is offline
Send a message via Yahoo to K1d0x Send a message via Skype™ to K1d0x
BAMHS
Junior Member
Join Date: Dec 2010
Old 07-17-2013 , 14:20   Re: Translate from french to english please
Reply With Quote #6

it works actually, but u need to swap weapons quick, if on build phase u got no weapons and u buy it doesnt work. Also if prep phase on u lose ur super knife. thanks for the translation anyway.

Last edited by BAMHS; 07-17-2013 at 14:39.
BAMHS is offline
Reply



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 14:42.


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