Euro System

Pluginuri facute de utilizatorii forumului eXtream.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

User avatar
GhosT ***
Membru, skill +2
Membru, skill +2
Posts: 604
Joined: 04 Dec 2013, 21:52
Detinator Steam: Da
CS Status: Morphin . [ Retras ]
SteamID: Mutulica1428
Reputatie: Fost Moderator ajutator
Location: Dumesti.
Has thanked: 40 times
Been thanked: 99 times
Contact:

25 Jan 2014, 16:49

Descriere: Acest plugin adauga pe server euro ... Are native asa ca va pute-ti face Shop-uri si alte porcarii :D ...
euro_sys.sma Version 1.0 | Afiseaza codul
#include <amxmodx>
#include <nvault>
#include <hamsandwich>
#include <fun>
#include <colorchat>
#include <csx>

#pragma semicolon 1

new const PLUGIN_NAME[] = "Euro System";
new const VERSION_PLUGIN[] = "1.0";
new const AUTOR_NAME[] = "GhosT ***";

new EuroPlayer[32];
new g_vault;

new Suicide_Euro;
new NormalKnifeKill_Euro;
new HeadShotKnifeKill_Euro;
new GrenadeKill_Euro;
new HeadShotKill_Euro;
new NormalKill_Euro;
new Plant_Euro;
new Defuse_Euro;
new Explode_Euro;
new Survive_Euro;

public plugin_init()
{
	register_plugin(PLUGIN_NAME, VERSION_PLUGIN, AUTOR_NAME);
	
	register_clcmd("say /euro", "ShowEuroInfo");
	register_clcmd("say /infoeuro", "EuroInfo");
	
	register_event("DeathMsg", "DeathMsg", "a");
	register_logevent("RoundEnd", 2, "1=Round_End");
	
	g_vault = nvault_open("EuroSystem");
	
	Suicide_Euro = register_cvar("Suicide_Euro", "30");
	NormalKnifeKill_Euro = register_cvar("NormalKnifeKill_Euro", "25");
	HeadShotKnifeKill_Euro = register_cvar("HsKnifeKill_Euro", "30");
	GrenadeKill_Euro = register_cvar("GrenadeKill_Euro", "35");
	HeadShotKill_Euro = register_cvar("HsKill_Euro", "20");
	NormalKill_Euro = register_cvar("Kill_Euro", "15");
	
	Plant_Euro = register_cvar("Plant_Euro", "5");
	Defuse_Euro = register_cvar("Defuse_Euro", "10");
	Explode_Euro = register_cvar("Explode_Euro", "5");
	
	Survive_Euro = register_cvar("Survive_Euro", "5");
}
public client_putinserver(id)
{
	LoadEuro(id);
	
	set_task(5.0, "ShowMessage", id);
}
public ShowMessage(id)
{
	ColorChat(id, BLUE, "^x04 [EURO]^x01 Acest Server Ruleaza^x03 Euro System Plugin^x01 !");
	ColorChat(id, BLUE, "^x04 [EURO]^x01 Created by:^x03 GhosT ***^x01 | Version:^x03 %s !", VERSION_PLUGIN);
}
public client_disconnect(id)
{
	SaveEuro(id);
}
public SaveEuro(id)
{
	new name[32];
	get_user_name(id,name,31);
	
	new vaultkey[64],vaultdata[256]; 
	format(vaultkey,63,"%s-Euro",name);  
	format(vaultdata,255,"%i#", EuroPlayer[id]);
	
	nvault_set(g_vault,vaultkey,vaultdata);
}
public LoadEuro(id)
{
	new name[32];
	get_user_name(id, name, 31);
	
	new vaultkey[64], vaultdata[256];
	format(vaultkey, 63, "%s-Euro", name);
	format(vaultdata, 255, "%i#", EuroPlayer[id]);
	
	nvault_get(g_vault,vaultkey,vaultdata,255);
	replace_all(vaultdata, 255, "#", " ");
	
	new PlayerEuro[32];
	parse(vaultdata, PlayerEuro, 31);
	
	EuroPlayer[id] = str_to_num(PlayerEuro);
}
public plugin_natives()
{
	register_native("get_user_euro", "_get_user_Euro");
	register_native("set_user_euro", "_set_user_Euro");
}
public _get_user_Euro(Plugin, Params)
{
	return EuroPlayer[get_param(1)];
}
public _set_user_Euro(Plugin, Params)
{
	new id = get_param(1);
	EuroPlayer[id] = max(0, get_param(2));
	SaveEuro(id);
	return EuroPlayer[id];
}
native get_user_euro(index);
native set_user_euro(index, amount);

public ShowEuroInfo(id)
{
	ColorChat(id, RED, "^x04 [EURO]^x01 Ai^x03 %i Euro^x01 !", get_user_euro(id));
	
	return PLUGIN_HANDLED;
}
public EuroInfo(id)
{
	ColorChat(id, RED, "^x04 [EURO]^x01 Pentru a face^x03 Euro^x01 omoara cat mai multi inamici !");
	
	return PLUGIN_HANDLED;
}
public DeathMsg(iWpnIndex)
{
	new headshot = read_data(3);
	new Victim = read_data(2);
	new iAttacker = read_data(1);
	new victim_name[32];
	get_user_name(Victim, victim_name, 31);
	new Weapon, HitPoint = get_user_attacker(Victim, Weapon, HitPoint);
	
	if(iAttacker == Victim)
	{
		set_user_euro(iAttacker, get_user_euro(iAttacker) - get_pcvar_num(Suicide_Euro));
		
		set_hudmessage(0, 150, 215, -1.0, -1.0);
		show_hudmessage(iAttacker, "Ai pierdut %i euro! [Suicide]", get_pcvar_num(Suicide_Euro));
	}
	
	if(Weapon == CSW_KNIFE && !headshot && iAttacker != Victim)
	{
		set_user_euro(iAttacker, get_user_euro(iAttacker) + get_pcvar_num(NormalKnifeKill_Euro));
		
		set_hudmessage(0, 150, 215, -1.0, -1.0);
		show_hudmessage(iAttacker, "Ai primit %i euro pentru ca l-ai omorat pe %s ! [Normal Knife Kill]", get_pcvar_num(NormalKnifeKill_Euro), victim_name);
	}
	else if(Weapon == CSW_KNIFE && headshot && iAttacker != Victim)
	{
		set_user_euro(iAttacker, get_user_euro(iAttacker) + get_pcvar_num(HeadShotKnifeKill_Euro));
		
		set_hudmessage(0, 150, 215, -1.0, -1.0);
		show_hudmessage(iAttacker, "Ai primit %i euro pentru ca l-ai omorat pe %s ! [HeadShot Knife Kill]", get_pcvar_num(HeadShotKnifeKill_Euro), victim_name);
	}
	else if(Weapon == CSW_HEGRENADE && iAttacker != Victim)
	{
		set_user_euro(iAttacker, get_user_euro(iAttacker) + get_pcvar_num(GrenadeKill_Euro));
		
		set_hudmessage(0, 150, 215, -1.0, -1.0);
		show_hudmessage(iAttacker, "Ai primit %i euro pentru ca l-ai omorat pe %s ! [Grenade Kill]", get_pcvar_num(GrenadeKill_Euro), victim_name);
	}
	else if(headshot && iAttacker != Victim)
	{
		set_user_euro(iAttacker, get_user_euro(iAttacker) + get_pcvar_num(HeadShotKill_Euro));
		
		set_hudmessage(0, 150, 215, -1.0, -1.0);
		show_hudmessage(iAttacker, "Ai primit %i euro pentru ca l-ai omorat pe %s ! [HeadShot Kill]", get_pcvar_num(GrenadeKill_Euro), victim_name);
	}

	else if(!headshot && iAttacker != Victim)
	{
		set_user_euro(iAttacker, get_user_euro(iAttacker) + get_pcvar_num(NormalKill_Euro));
		
		set_hudmessage(0, 150, 215, -1.0, -1.0);
		show_hudmessage(iAttacker, "Ai primit %i euro pentru ca l-ai omorat pe %s ! [Normal Kill]", get_pcvar_num(GrenadeKill_Euro), victim_name);
	}
}
public bomb_planted(Planter)
{
	set_user_euro(Planter, get_user_euro(Planter) + get_pcvar_num(Plant_Euro));
	
	set_hudmessage(0, 150, 215, -1.0, -1.0);
	show_hudmessage(Planter, "Ai primit %i euro! [Plant Bomb]", get_pcvar_num(Plant_Euro));
}
public bomb_defused(Defuser)
{
	set_user_euro(Defuser, get_user_euro(Defuser) + get_pcvar_num(Defuse_Euro));
	
	set_hudmessage(0, 150, 215, -1.0, -1.0);
	show_hudmessage(Defuser, "Ai primit %i euro! [Defuse Bomb]", get_pcvar_num(Defuse_Euro));
}
public bomb_explode(Planter)
{
	set_user_euro(Planter, get_user_euro(Planter) + get_pcvar_num(Explode_Euro));
	
	set_hudmessage(0, 150, 215, -1.0, -1.0);
	show_hudmessage(Planter, "Ai primit %i euro! [Explode Bomb]", get_pcvar_num(Explode_Euro));
}
public RoundEnd()
{
	new Player[32], iNum;
	get_players(Player, iNum);
	
	for(new i = 0; i <= iNum; i++)
	{
		if(is_user_alive(Player))
		{
			set_user_euro(Player, get_user_euro(Player) + get_pcvar_num(Survive_Euro));
		}
	}
}

euro_sys.sma Version 1.1 | Afiseaza codul
/*==========================================================================================================================================

   Cvars

	Suicide_Euro - Cati euro sa iti ia atunci cand te sinucizi (default: 30)
	NormalKnifeKill_Euro - Cati euro sa iti dea atunci cand omori pe cine cu knife (default: 25)
	HsKnifeKill_Euro - Cati euro sa iti dea atunci cand omori pe cineva cu knife in Head Shot (default: 30)
	GrenadeKill_Euro - Cati euro sa iti dea atunci cand omori pe cineva cu He Grenade (default: 35)
	HsKill_Euro - Cati euro sa iti dea atunci cand omori pe cineva in Head Shot (default: 20)
	NormalKill_Euro - Cati euro sa iti dea atunci cand omori pe cineva [simplu / no-hs / no knife / no he] (default: 15)
	
	Plant_Euro - Cati euro sa iti dea atunci cand plantezi bomba[c4] (default: 5)
	Defuse_Euro - Cati euro sa iti dea atunci cand ai dat defuse la bomba[c4] (default: 10)
	Explode_Euro - Cati euro sa iti dea atunci cand bomba[c4] a explodat (default:5)
	
	Survive_Euro - Cati euro sa iti dea atunci cand esti viu la final de runda (default: 5) 
	
   Comenzi Administrative
   
	amx_euro <name> - afli cate credite are un jucator
	amx_give_euro <name> <amount> - Dai cuiva credite
	amx_take_euro <name> <amount> - Iei cuiva credite
	
   Comenzi Publice
   
	/euro - vezi cati euro ai
	/infoeuro - vezi informatii despre cum sa faci euro
	
   Change Log
   
	Version
		1.0 - 	Lansarea
		1.1 - 	Adaugarea comenzilor administrative [amx_euro / amx_give_euro / amx_take_euro]
   Credits
	--------
	
============================================================================================================================================*/

#include <amxmodx>
#include <amxmisc>
#include <nvault>
#include <hamsandwich>
#include <fun>
#include <colorchat>
#include <csx>

#pragma semicolon 1

new const PLUGIN_NAME[] = "Euro System";
new const VERSION_PLUGIN[] = "1.1";
new const AUTOR_NAME[] = "GhosT ***";

new EuroPlayer[32];
new g_vault;

new Suicide_Euro;
new NormalKnifeKill_Euro;
new HeadShotKnifeKill_Euro;
new GrenadeKill_Euro;
new HeadShotKill_Euro;
new NormalKill_Euro;
new Plant_Euro;
new Defuse_Euro;
new Explode_Euro;
new Survive_Euro;

public plugin_init()
{
	register_plugin(PLUGIN_NAME, VERSION_PLUGIN, AUTOR_NAME);
	
	register_clcmd("say /euro", "ShowEuroInfo");
	register_clcmd("say_team /euro", "ShowEuroInfo");
	
	register_clcmd("say /infoeuro", "EuroInfo");
	register_clcmd("say_team /infoeuro", "EuroInfo");
	
	register_event("DeathMsg", "DeathMsg", "a");
	register_logevent("RoundEnd", 2, "1=Round_End");
	
	register_concmd("amx_euro", "_euro");
	register_concmd("amx_give_euro", "_give_euro", ADMIN_MENU, "<nume> <Amount>");
	register_concmd("amx_take_euro", "_take_euro", ADMIN_MENU, "<nume> <Amount>");
	
	g_vault = nvault_open("EuroSystem");
	
	Suicide_Euro = register_cvar("Suicide_Euro", "30");
	NormalKnifeKill_Euro = register_cvar("NormalKnifeKill_Euro", "25");
	HeadShotKnifeKill_Euro = register_cvar("HsKnifeKill_Euro", "30");
	GrenadeKill_Euro = register_cvar("GrenadeKill_Euro", "35");
	HeadShotKill_Euro = register_cvar("HsKill_Euro", "20");
	NormalKill_Euro = register_cvar("Kill_Euro", "15");
	
	Plant_Euro = register_cvar("Plant_Euro", "5");
	Defuse_Euro = register_cvar("Defuse_Euro", "10");
	Explode_Euro = register_cvar("Explode_Euro", "5");
	
	Survive_Euro = register_cvar("Survive_Euro", "5");
}
public client_putinserver(id)
{
	LoadEuro(id);
	
	set_task(5.0, "ShowMessage", id);
}
public ShowMessage(id)
{
	ColorChat(id, BLUE, "^x04 [EURO]^x01 Acest Server Ruleaza^x03 Euro System Plugin^x01 !");
	ColorChat(id, BLUE, "^x04 [EURO]^x01 Created by:^x03 GhosT ***^x01 | Version:^x03 %s !", VERSION_PLUGIN);
}
public client_disconnect(id)
{
	SaveEuro(id);
}
public SaveEuro(id)
{
	new name[32];
	get_user_name(id,name,31);
	
	new vaultkey[64],vaultdata[256]; 
	format(vaultkey,63,"%s-Euro",name);  
	format(vaultdata,255,"%i#", EuroPlayer[id]);
	
	nvault_set(g_vault,vaultkey,vaultdata);
}
public LoadEuro(id)
{
	new name[32];
	get_user_name(id, name, 31);
	
	new vaultkey[64], vaultdata[256];
	format(vaultkey, 63, "%s-Euro", name);
	format(vaultdata, 255, "%i#", EuroPlayer[id]);
	
	nvault_get(g_vault,vaultkey,vaultdata,255);
	replace_all(vaultdata, 255, "#", " ");
	
	new PlayerEuro[32];
	parse(vaultdata, PlayerEuro, 31);
	
	EuroPlayer[id] = str_to_num(PlayerEuro);
}
public plugin_natives()
{
	register_library( "es" );
	register_native("get_user_euro", "_get_user_Euro");
	register_native("set_user_euro", "_set_user_Euro");
}
public _get_user_Euro(Plugin, Params)
{
	return EuroPlayer[get_param(1)];
}
public _set_user_Euro(Plugin, Params)
{
	new id = get_param(1);
	EuroPlayer[id] = max(0, get_param(2));
	SaveEuro(id);
	return EuroPlayer[id];
}
native get_user_euro(index);
native set_user_euro(index, amount);

public ShowEuroInfo(id)
{
	ColorChat(id, RED, "^x04 [EURO]^x01 Ai^x03 %i^x01 euro !", get_user_euro(id));
	return 1;
}
public EuroInfo(id)
{
	ColorChat(id, RED, "^x04 [EURO]^x01 Pentru a face^x03 Euro^x01 omoara cat mai multi inamici !");
	
	return PLUGIN_HANDLED;
}
public DeathMsg(iWpnIndex)
{
	new headshot = read_data(3);
	new Victim = read_data(2);
	new iAttacker = read_data(1);
	new victim_name[32];
	get_user_name(Victim, victim_name, 31);
	new Weapon, HitPoint = get_user_attacker(Victim, Weapon, HitPoint);
	
	if(iAttacker == Victim)
	{
		set_user_euro(iAttacker, get_user_euro(iAttacker) - get_pcvar_num(Suicide_Euro));
		
		set_hudmessage(0, 150, 215, -1.0, -1.0);
		show_hudmessage(iAttacker, "Ai pierdut %i euro! [Suicide]", get_pcvar_num(Suicide_Euro));
	}
	
	if(Weapon == CSW_KNIFE && !headshot && iAttacker != Victim)
	{
		set_user_euro(iAttacker, get_user_euro(iAttacker) + get_pcvar_num(NormalKnifeKill_Euro));
		
		set_hudmessage(0, 150, 215, -1.0, -1.0);
		show_hudmessage(iAttacker, "Ai primit %i euro pentru ca l-ai omorat pe %s ! [Normal Knife Kill]", get_pcvar_num(NormalKnifeKill_Euro), victim_name);
	}
	else if(Weapon == CSW_KNIFE && headshot && iAttacker != Victim)
	{
		set_user_euro(iAttacker, get_user_euro(iAttacker) + get_pcvar_num(HeadShotKnifeKill_Euro));
		
		set_hudmessage(0, 150, 215, -1.0, -1.0);
		show_hudmessage(iAttacker, "Ai primit %i euro pentru ca l-ai omorat pe %s ! [HeadShot Knife Kill]", get_pcvar_num(HeadShotKnifeKill_Euro), victim_name);
	}
	else if(Weapon == CSW_HEGRENADE && iAttacker != Victim)
	{
		set_user_euro(iAttacker, get_user_euro(iAttacker) + get_pcvar_num(GrenadeKill_Euro));
		
		set_hudmessage(0, 150, 215, -1.0, -1.0);
		show_hudmessage(iAttacker, "Ai primit %i euro pentru ca l-ai omorat pe %s ! [Grenade Kill]", get_pcvar_num(GrenadeKill_Euro), victim_name);
	}
	else if(headshot && iAttacker != Victim)
	{
		set_user_euro(iAttacker, get_user_euro(iAttacker) + get_pcvar_num(HeadShotKill_Euro));
		
		set_hudmessage(0, 150, 215, -1.0, -1.0);
		show_hudmessage(iAttacker, "Ai primit %i euro pentru ca l-ai omorat pe %s ! [HeadShot Kill]", get_pcvar_num(GrenadeKill_Euro), victim_name);
	}

	else if(!headshot && iAttacker != Victim)
	{
		set_user_euro(iAttacker, get_user_euro(iAttacker) + get_pcvar_num(NormalKill_Euro));
		
		set_hudmessage(0, 150, 215, -1.0, -1.0);
		show_hudmessage(iAttacker, "Ai primit %i euro pentru ca l-ai omorat pe %s ! [Normal Kill]", get_pcvar_num(GrenadeKill_Euro), victim_name);
	}
}
public bomb_planted(Planter)
{
	set_user_euro(Planter, get_user_euro(Planter) + get_pcvar_num(Plant_Euro));
	
	set_hudmessage(0, 150, 215, -1.0, -1.0);
	show_hudmessage(Planter, "Ai primit %i euro! [Plant Bomb]", get_pcvar_num(Plant_Euro));
}
public bomb_defused(Defuser)
{
	set_user_euro(Defuser, get_user_euro(Defuser) + get_pcvar_num(Defuse_Euro));
	
	set_hudmessage(0, 150, 215, -1.0, -1.0);
	show_hudmessage(Defuser, "Ai primit %i euro! [Defuse Bomb]", get_pcvar_num(Defuse_Euro));
}
public bomb_explode(Planter)
{
	set_user_euro(Planter, get_user_euro(Planter) + get_pcvar_num(Explode_Euro));
	
	set_hudmessage(0, 150, 215, -1.0, -1.0);
	show_hudmessage(Planter, "Ai primit %i euro! [Explode Bomb]", get_pcvar_num(Explode_Euro));
}
public RoundEnd()
{
	new Player[32], iNum;
	get_players(Player, iNum);
	
	for(new i = 0; i <= iNum; i++)
	{
		if(is_user_alive(Player))
		{
			set_user_euro(Player, get_user_euro(Player) + get_pcvar_num(Survive_Euro));
		}
	}
}
public _euro(id)
{
	new target_name[32];
	
	read_argv(1, target_name, 31);
	
	if(equal(target_name, ""))
	{
		console_print(id, "amx_euro <Nume>");
		return 1;
	}
	
	new iPlayer = cmd_target(id, target_name, 8);
	if(!iPlayer)
	{
		console_print(id, "Jucatorul %s nu a fost gasit !", target_name);
		return 1;
	}
	
	new Player_Name[32];
	get_user_name(iPlayer, Player_Name, 31);
	
	console_print(id, "Jucatorul %s are %i euro !", Player_Name, get_user_euro(iPlayer));
	return 1;
}
public _give_euro(id)
{
	if(get_user_flags(id) & ADMIN_MENU)
	{
		new target_name[32];
		new Amount[10];
		
		read_argv(1, target_name, 31);
		read_argv(2, Amount, 9);
		
		if(equal(target_name, "") || equal(Amount, ""))
		{
			console_print(id, "amx_give_euro <Nume> <Suma>");
			return 1;
		}
		
		new Euro = str_to_num(Amount);
		
		if(Euro <= 0)
		{
			console_print(id, "Trebuie sa scrii o suma mai mare decat 0 !");
			return 1;
		}
		
		new iPlayer = cmd_target(id, target_name, 8);
		
		if(!iPlayer)
		{
			console_print(id, "Jucatorul %s nu a fost gasit !", target_name);
			return 1;
		}
		
		set_user_euro(iPlayer, get_user_euro(iPlayer) + Euro);
		
		new Admin_Name[32];
		new Player_Name[32];
		
		get_user_name(id, Admin_Name, 31);
		get_user_name(iPlayer, Player_Name, 31);
		
		ColorChat(id, RED, "^x04 ADMIN: %s^x01 i-a dat^x03 %d Euro^x01 lui^x04 %s^x01 !", Admin_Name, Euro, Player_Name);
		
		return 1;
	}
	else
	{
		console_print(id, "Nu ai acces la aceasta comanda !");
		return 1;
	}
	
	return 1;
}
public _take_euro(id)
{
	if(get_user_flags(id) & ADMIN_MENU)
	{
		new target_name[32];
		new Amount[10];
		
		read_argv(1, target_name, 31);
		read_argv(2, Amount, 9);
		
		if(equal(target_name, "") || equal(Amount, ""))
		{
			console_print(id, "amx_take_euro <Nume> <Suma>");
			return 1;
		}
		
		new Euro = str_to_num(Amount);
		
		if(Euro <= 0)
		{
			console_print(id, "Trebuie sa scrii o suma mai mare decat 0 !");
			return 1;
		}
		
		new iPlayer = cmd_target(id, target_name, 8);
		
		if(!iPlayer)
		{
			console_print(id, "Jucatorul %s nu a fost gasit !", target_name);
			return 1;
		}
		if(get_user_euro(iPlayer) < Euro)
		{
			console_print(id, "Jucatorul %s are doar %i Euro !", target_name, get_user_euro(iPlayer));
			return 1;
		}
		
		set_user_euro(iPlayer, get_user_euro(iPlayer) - Euro);
		
		new Admin_Name[32];
		new Player_Name[32];
		
		get_user_name(id, Admin_Name, 31);
		get_user_name(iPlayer, Player_Name, 31);
		
		ColorChat(id, RED, "^x04 ADMIN: %s^x01 i-a luat^x03 %d Euro^x01 lui^x04 %s^x01 !", Admin_Name, Euro, Player_Name);
		
		return 1;
	}
	else
	{
		console_print(id, "Nu ai acces la aceasta comanda !");
		return 1;
	}
	
	return 1;
}

Euro System 1.2 | Afiseaza codul
/*==========================================================================================================================================

   Cvars

	HsKill_Euro - Cati euro sa iti dea atunci cand omori pe cineva in Head Shot (default: 20)
	NormalKill_Euro - Cati euro sa iti dea atunci cand omori pe cineva [simplu / no-hs / no knife / no he] (default: 15)
	
   Comenzi Administrative
   
	amx_euro <name> - afli cate credite are un jucator
	amx_give_euro <name> <amount> - Dai cuiva credite
	amx_take_euro <name> <amount> - Iei cuiva credite
	
   Comenzi Publice
   
	/euro - vezi cati euro ai
	
   Change Log
   
	Version
		1.0 - 	Lansarea
		1.1 - 	Adaugarea comenzilor administrative [amx_euro / amx_give_euro / amx_take_euro]
		1.2 - 	Updateuri
   Credits
	--------
	
============================================================================================================================================*/

#include <amxmodx>
#include <amxmisc>
#include <nvault>
#include <hamsandwich>
#include <fun>
#include <colorchat>

#pragma semicolon 1

new const PLUGIN_NAME[] = "Euro System";
new const VERSION_PLUGIN[] = "1.2";
new const AUTOR_NAME[] = "GhosT ***";

new EuroPlayer[32];
new g_vault;

new HeadShotKill_Euro;
new NormalKill_Euro;

public plugin_init()
{
	register_plugin(PLUGIN_NAME, VERSION_PLUGIN, AUTOR_NAME);
	
	register_clcmd("say /euro", "ShowEuroInfo");
	register_clcmd("say_team /euro", "ShowEuroInfo");
	
	register_event("DeathMsg", "DeathMsg", "a");
	
	register_concmd("amx_euro", "_euro");
	register_concmd("amx_give_euro", "_give_euro", ADMIN_MENU, "<nume> <Amount>");
	register_concmd("amx_take_euro", "_take_euro", ADMIN_MENU, "<nume> <Amount>");
	
	g_vault = nvault_open("EuroSystem");
	
	HeadShotKill_Euro = register_cvar("HsKill_Euro", "50");
	NormalKill_Euro = register_cvar("NormalKill_Euro", "30");
}
public client_putinserver(id)
{
	LoadEuro(id);
	
	set_task(5.0, "ShowMessage", id);
}
public client_disconnect(id)
{
	SaveEuro(id);
}
public SaveEuro(id)
{
	new name[32];
	get_user_name(id,name,31);
	
	new vaultkey[64],vaultdata[256]; 
	format(vaultkey,63,"%s-Euro",name);  
	format(vaultdata,255,"%i#", EuroPlayer[id]);
	
	nvault_set(g_vault,vaultkey,vaultdata);
}
public LoadEuro(id)
{
	new name[32];
	get_user_name(id, name, 31);
	
	new vaultkey[64], vaultdata[256];
	format(vaultkey, 63, "%s-Euro", name);
	format(vaultdata, 255, "%i#", EuroPlayer[id]);
	
	nvault_get(g_vault,vaultkey,vaultdata,255);
	replace_all(vaultdata, 255, "#", " ");
	
	new PlayerEuro[32];
	parse(vaultdata, PlayerEuro, 31);
	
	EuroPlayer[id] = str_to_num(PlayerEuro);
}
public plugin_natives()
{
	register_library( "es" );
	register_native("get_user_euro", "_get_user_Euro");
	register_native("set_user_euro", "_set_user_Euro");
}
public _get_user_Euro(Plugin, Params)
{
	return EuroPlayer[get_param(1)];
}
public _set_user_Euro(Plugin, Params)
{
	new id = get_param(1);
	EuroPlayer[id] = max(0, get_param(2));
	SaveEuro(id);
	return EuroPlayer[id];
}
native get_user_euro(index);
native set_user_euro(index, amount);

public ShowEuroInfo(id)
{
	ColorChat(id, RED, "^x04 [EURO]^x01 Ai^x03 %i^x01 euro !", get_user_euro(id));
	return 1;
}
public DeathMsg(iWpnIndex)
{
	new headshot = read_data(3);
	new Victim = read_data(2);
	new iAttacker = read_data(1);
	
	if(iAttacker == Victim)
		return PLUGIN_HANDLED;
		
	else if(headshot)
		set_user_euro(iAttacker, get_user_euro(iAttacker) + get_pcvar_num(HeadShotKill_Euro));

	else
		set_user_euro(iAttacker, get_user_euro(iAttacker) + get_pcvar_num(NormalKill_Euro));
	
	return PLUGIN_CONTINUE;
}
public _euro(id)
{
	new target_name[32];
	
	read_argv(1, target_name, 31);
	
	if(equal(target_name, ""))
	{
		console_print(id, "amx_euro <Nume>");
		return 1;
	}
	
	new iPlayer = cmd_target(id, target_name, 8);
	if(!iPlayer)
	{
		console_print(id, "Jucatorul %s nu a fost gasit !", target_name);
		return 1;
	}
	
	new Player_Name[32];
	get_user_name(iPlayer, Player_Name, 31);
	
	console_print(id, "Jucatorul %s are %i euro !", Player_Name, get_user_euro(iPlayer));
	return 1;
}
public _give_euro(id)
{
	if(get_user_flags(id) & ADMIN_MENU)
	{
		new target_name[32];
		new Amount[10];
		
		read_argv(1, target_name, 31);
		read_argv(2, Amount, 9);
		
		if(equal(target_name, "") || equal(Amount, ""))
		{
			console_print(id, "amx_give_euro <Nume> <Suma>");
			return 1;
		}
		
		new Euro = str_to_num(Amount);
		
		if(Euro <= 0)
		{
			console_print(id, "Trebuie sa scrii o suma mai mare decat 0 !");
			return 1;
		}
		
		new iPlayer = cmd_target(id, target_name, 8);
		
		if(!iPlayer)
		{
			console_print(id, "Jucatorul %s nu a fost gasit !", target_name);
			return 1;
		}
		
		set_user_euro(iPlayer, get_user_euro(iPlayer) + Euro);
		
		new Admin_Name[32];
		new Player_Name[32];
		
		get_user_name(id, Admin_Name, 31);
		get_user_name(iPlayer, Player_Name, 31);
		
		ColorChat(id, RED, "^x04 ADMIN: %s^x01 i-a dat^x03 %d Euro^x01 lui^x04 %s^x01 !", Admin_Name, Euro, Player_Name);
		
		return 1;
	}
	else
	{
		console_print(id, "Nu ai acces la aceasta comanda !");
		return 1;
	}
	
	return 1;
}
public _take_euro(id)
{
	if(get_user_flags(id) & ADMIN_MENU)
	{
		new target_name[32];
		new Amount[10];
		
		read_argv(1, target_name, 31);
		read_argv(2, Amount, 9);
		
		if(equal(target_name, "") || equal(Amount, ""))
		{
			console_print(id, "amx_take_euro <Nume> <Suma>");
			return 1;
		}
		
		new Euro = str_to_num(Amount);
		
		if(Euro <= 0)
		{
			console_print(id, "Trebuie sa scrii o suma mai mare decat 0 !");
			return 1;
		}
		
		new iPlayer = cmd_target(id, target_name, 8);
		
		if(!iPlayer)
		{
			console_print(id, "Jucatorul %s nu a fost gasit !", target_name);
			return 1;
		}
		if(get_user_euro(iPlayer) < Euro)
		{
			console_print(id, "Jucatorul %s are doar %i Euro !", target_name, get_user_euro(iPlayer));
			return 1;
		}
		
		set_user_euro(iPlayer, get_user_euro(iPlayer) - Euro);
		
		new Admin_Name[32];
		new Player_Name[32];
		
		get_user_name(id, Admin_Name, 31);
		get_user_name(iPlayer, Player_Name, 31);
		
		ColorChat(id, RED, "^x04 ADMIN: %s^x01 i-a luat^x03 %d Euro^x01 lui^x04 %s^x01 !", Admin_Name, Euro, Player_Name);
		
		return 1;
	}
	else
	{
		console_print(id, "Nu ai acces la aceasta comanda !");
		return 1;
	}
	
	return 1;
}

euro_system.inc | Afiseaza codul
#if defined _euro_system_included
	#endinput
#endif

#define _euro_system_included
 
//==========================================================================================
 
native get_user_euro(index);

/*
 * Returns a players euro
 * 
 * @param		index - The player index to get euro
 * 
 * @return		The Euro of client
 * 
 */
 
//==========================================================================================

native set_user_euro(index, amount);
 
/*
 * Sets <euro> to player
 * 
 * @param		index - The player index to set euro
 * @param		amount - The amount of euro to set to player
 * 
 * @return		The Euro of client
 * 
 */
 
//==========================================================================================

stock add_user_euro(index, amount)
{
	return set_user_euro(index, get_user_euro(index) + amount);
}
 
/*
 * Add <euro> to player
 * 
 * @param		index - The player index to add euro
 * @param		amount - The amount of euro to add to player
 * 
 * @return		The Euro of client
 * 
 */

//==========================================================================================
 
stock remove_user_euro(index, amount)
{
	return set_user_euro(index, get_user_euro(index) - credits);
}
 
/*
 * Remove <euro> from player
 * 
 * @param		index - The player index to remove euro
 * @param		amount - The amount of euro to remove to player
 * 
 * @return		The Euro of client
 * 
 */

//==========================================================================================
 
stock strip_user_euro(index)
{
	return set_user_euro(index, 0);
}
 
/*
 * Strip <euro> from player
 * 
 * @param		index - The player index to strip euro
 * 
 * @return		The Euro of client
 * 
 */
 
//==========================================================================================


.Sma + .Amxx + .Inc
.Inc

Nume: Euro System
Versiune: 1.0
Link oficial: Aici.

Instalare:
1. Fisierul euro_sys.sma il puneti in addons/amxmodx/scripting !
2. Fisierul euro_sys.amxx il puneti in addons/amxmodx/plugins !
6. Intrati in fisierul addons/amxmodx/configs/plugins.ini si adaugati la urma:

Code: Select all

euro_sys.amxx
7. Alti pasi necesari...
Cvar-uri (se adauga in fisierul amxmodx\configs\amxx.cfg):
Cvaruri | Afiseaza codul
Suicide_Euro - Cati euro sa iti ia atunci cand te sinucizi (default: 30)
NormalKnifeKill_Euro - Cati euro sa iti dea atunci cand omori pe cine cu knife (default: 25)
HsKnifeKill_Euro - Cati euro sa iti dea atunci cand omori pe cineva cu knife in Head Shot (default: 30)
GrenadeKill_Euro - Cati euro sa iti dea atunci cand omori pe cineva cu He Grenade (default: 35)
HsKill_Euro - Cati euro sa iti dea atunci cand omori pe cineva in Head Shot (default: 20)
NormalKill_Euro - Cati euro sa iti dea atunci cand omori pe cineva [simplu / no-hs / no knife / no he] (default: 15)

Plant_Euro - Cati euro sa iti dea atunci cand plantezi bomba[c4] (default: 5)
Defuse_Euro - Cati euro sa iti dea atunci cand ai dat defuse la bomba[c4] (default: 10)
Explode_Euro - Cati euro sa iti dea atunci cand bomba[c4] a explodat (default:5)

Survive_Euro - Cati euro sa iti dea atunci cand esti viu la final de runda (default: 5)
Comenzi administrative (se tasteaza in consola si trebuie sa fiti administrator):
| Afiseaza codul
amx_euro <name> - afli cate credite are un jucator
	amx_give_euro <name> <amount> - Dai cuiva credite
	amx_take_euro <name> <amount> - Iei cuiva credite
Comenzi publice (se tasteaza in joc prin apasarea tastei Y):
Comenzi publice | Afiseaza codul
/euro - vezi cati euro ai
/infoeuro - Afli informatii despre cum sa faci euro
Module necesare (se sterge ; din fata modulului de mai jos; acestea le gasiti in fisierul amxmodx\configs\modules.ini):
| Afiseaza codul
#include <amxmodx>
#include <nvault>
#include <hamsandwich>
#include <fun>
#include <colorchat>
#include <csx>
Imagini :
| Afiseaza codul
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Last edited by GhosT *** on 14 Feb 2014, 15:42, edited 7 times in total.
smileye
Fost moderator
Fost moderator
Posts: 4655
Joined: 12 Jun 2012, 14:18
Detinator Steam: Da
Reputatie: Fost moderator
Has thanked: 258 times
Been thanked: 38 times
Contact:

25 Jan 2014, 17:04

Niste poze sa vedem despre ce e vorba?
User avatar
GhosT ***
Membru, skill +2
Membru, skill +2
Posts: 604
Joined: 04 Dec 2013, 21:52
Detinator Steam: Da
CS Status: Morphin . [ Retras ]
SteamID: Mutulica1428
Reputatie: Fost Moderator ajutator
Location: Dumesti.
Has thanked: 40 times
Been thanked: 99 times
Contact:

25 Jan 2014, 17:10

Acum fac in 15 minute maxim postez si pozele
User avatar
Ulquiorra
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 2054
Joined: 25 Jul 2010, 16:29
Detinator Steam: Da
CS Status: A mai trecut o zi asteptand una mai buna
Detinator server CS: Retras.
SteamID: STEAM_0:1:318247XX
Reputatie: Scripter eXtreamCS
Nick anterior: sPuf ?, a^ml), Loca Tapioca, Askhanar
Fost Moderator ajutator
Location: Braila, Romania.
Has thanked: 214 times
Been thanked: 1131 times
Contact:

25 Jan 2014, 18:53

ai putea face si /euro < nume > :P
""Copilarie, iarta-ma c-am vrut sa fiu om mare.. ""
User avatar
GhosT ***
Membru, skill +2
Membru, skill +2
Posts: 604
Joined: 04 Dec 2013, 21:52
Detinator Steam: Da
CS Status: Morphin . [ Retras ]
SteamID: Mutulica1428
Reputatie: Fost Moderator ajutator
Location: Dumesti.
Has thanked: 40 times
Been thanked: 99 times
Contact:

25 Jan 2014, 19:19

Askhanar wrote:ai putea face si /euro < nume > :P
Acum ma gandesc sa fac mai intai amx_give_euro / amx_take_euro :D
MrFunk
Membru, skill 0
Membru, skill 0
Posts: 75
Joined: 16 Sep 2013, 17:59
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Has thanked: 2 times
Been thanked: 1 time
Contact:

25 Jan 2014, 20:22

GhosT *** wrote:
Askhanar wrote:ai putea face si /euro < nume > :P
Acum ma gandesc sa fac mai intai amx_give_euro / amx_take_euro :D
Iti propun sa faci si:
1. amx_reset_euro Nume / @all // ar fii mult mai simplu.
2. Sa apara in HUD jos stanga, chiar deasupra la HP & AP ceva gen: Euro: Nr. Euro detinuti
3. Cand stai spectator pe cineva, sa apara in HUD pe centru jos, Spectating: Nume, iar dedesubt sa apara: Euro: Nr. Euro
Intrebare: Euro`ii se salveaza pe fiecare mapa ??
User avatar
GhosT ***
Membru, skill +2
Membru, skill +2
Posts: 604
Joined: 04 Dec 2013, 21:52
Detinator Steam: Da
CS Status: Morphin . [ Retras ]
SteamID: Mutulica1428
Reputatie: Fost Moderator ajutator
Location: Dumesti.
Has thanked: 40 times
Been thanked: 99 times
Contact:

25 Jan 2014, 20:32

MrFunk wrote:
GhosT *** wrote:
Askhanar wrote:ai putea face si /euro < nume > :P
Acum ma gandesc sa fac mai intai amx_give_euro / amx_take_euro :D
Iti propun sa faci si:
1. amx_reset_euro Nume / @all // ar fii mult mai simplu.
2. Sa apara in HUD jos stanga, chiar deasupra la HP & AP ceva gen: Euro: Nr. Euro detinuti
3. Cand stai spectator pe cineva, sa apara in HUD pe centru jos, Spectating: Nume, iar dedesubt sa apara: Euro: Nr. Euro
Intrebare: Euro`ii se salveaza pe fiecare mapa ??
Da euro ii salveaza la fiecare mapa si multumesc pentru ideei ;)

O sa le iau in considerare
User avatar
^ionutz^
Fost moderator
Fost moderator
Posts: 2000
Joined: 05 Oct 2013, 14:12
Detinator Steam: Da
CS Status: activitate scazuta !
SteamID: /id/ionutz_cs/
Reputatie: Fost moderator ajutator
Location: Galati
Has thanked: 46 times
Been thanked: 23 times
Contact:

26 Jan 2014, 10:07

cum as putea face ca la un anumit numar de euro stransi sa primeasca helper spre exemplu
MrFunk
Membru, skill 0
Membru, skill 0
Posts: 75
Joined: 16 Sep 2013, 17:59
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Has thanked: 2 times
Been thanked: 1 time
Contact:

26 Jan 2014, 12:23

Code: Select all

public _take_euro(id)
{
	if(get_user_flags(id) & ADMIN_MENU)
	{
		new target_name[32];
		new Amount[10];
		
		read_argv(1, target_name, 31);
		read_argv(2, Amount, 9);
		
		if(equal(target_name, "") || equal(Amount, ""))
		{
			console_print(id, "amx_give_euro <Nume> <Suma>");
			return 1;
		}
La take euro ai gresit, ai pus tot give ..
Am modificat eu:
| Afiseaza codul
/*==========================================================================================================================================

   Cvars

	Suicide_Euro - Cati euro sa iti ia atunci cand te sinucizi (default: 30)
	NormalKnifeKill_Euro - Cati euro sa iti dea atunci cand omori pe cine cu knife (default: 25)
	HsKnifeKill_Euro - Cati euro sa iti dea atunci cand omori pe cineva cu knife in Head Shot (default: 30)
	GrenadeKill_Euro - Cati euro sa iti dea atunci cand omori pe cineva cu He Grenade (default: 35)
	HsKill_Euro - Cati euro sa iti dea atunci cand omori pe cineva in Head Shot (default: 20)
	NormalKill_Euro - Cati euro sa iti dea atunci cand omori pe cineva [simplu / no-hs / no knife / no he] (default: 15)
	
	Plant_Euro - Cati euro sa iti dea atunci cand plantezi bomba[c4] (default: 5)
	Defuse_Euro - Cati euro sa iti dea atunci cand ai dat defuse la bomba[c4] (default: 10)
	Explode_Euro - Cati euro sa iti dea atunci cand bomba[c4] a explodat (default:5)
	
	Survive_Euro - Cati euro sa iti dea atunci cand esti viu la final de runda (default: 5) 
	
   Comenzi Administrative
   
	amx_euro <name> - afli cate credite are un jucator
	amx_give_euro <name> <amount> - Dai cuiva credite
	amx_take_euro <name> <amount> - Iei cuiva credite
	
   Comenzi Publice
   
	/euro - vezi cati euro ai
	/infoeuro - vezi informatii despre cum sa faci euro
	
   Change Log
   
	Version
		1.0 - 	Lansarea
		1.1 - 	Adaugarea comenzilor administrative [amx_euro / amx_give_euro / amx_take_euro]
   Credits
	--------
	
============================================================================================================================================*/

#include <amxmodx>
#include <amxmisc>
#include <nvault>
#include <hamsandwich>
#include <fun>
#include <colorchat>
#include <csx>

#pragma semicolon 1

new const PLUGIN_NAME[] = "Euro System";
new const VERSION_PLUGIN[] = "1.1";
new const AUTOR_NAME[] = "GhosT ***";

new EuroPlayer[32];
new g_vault;

new Suicide_Euro;
new NormalKnifeKill_Euro;
new HeadShotKnifeKill_Euro;
new GrenadeKill_Euro;
new HeadShotKill_Euro;
new NormalKill_Euro;
new Plant_Euro;
new Defuse_Euro;
new Explode_Euro;
new Survive_Euro;

public plugin_init()
{
	register_plugin(PLUGIN_NAME, VERSION_PLUGIN, AUTOR_NAME);
	
	register_clcmd("say /euro", "ShowEuroInfo");
	register_clcmd("say_team /euro", "ShowEuroInfo");
	
	register_clcmd("say /infoeuro", "EuroInfo");
	register_clcmd("say_team /infoeuro", "EuroInfo");
	
	register_event("DeathMsg", "DeathMsg", "a");
	register_logevent("RoundEnd", 2, "1=Round_End");
	
	register_concmd("amx_euro", "_euro");
	register_concmd("amx_give_euro", "_give_euro", ADMIN_MENU, "<nume> <Amount>");
	register_concmd("amx_take_euro", "_take_euro", ADMIN_MENU, "<nume> <Amount>");
	
	g_vault = nvault_open("EuroSystem");
	
	Suicide_Euro = register_cvar("Suicide_Euro", "30");
	NormalKnifeKill_Euro = register_cvar("NormalKnifeKill_Euro", "25");
	HeadShotKnifeKill_Euro = register_cvar("HsKnifeKill_Euro", "30");
	GrenadeKill_Euro = register_cvar("GrenadeKill_Euro", "35");
	HeadShotKill_Euro = register_cvar("HsKill_Euro", "20");
	NormalKill_Euro = register_cvar("Kill_Euro", "15");
	
	Plant_Euro = register_cvar("Plant_Euro", "5");
	Defuse_Euro = register_cvar("Defuse_Euro", "10");
	Explode_Euro = register_cvar("Explode_Euro", "5");
	
	Survive_Euro = register_cvar("Survive_Euro", "5");
}
public client_putinserver(id)
{
	LoadEuro(id);
	
	set_task(5.0, "ShowMessage", id);
}
public ShowMessage(id)
{
	ColorChat(id, BLUE, "^x04 [EURO]^x01 Acest Server Ruleaza^x03 Euro System Plugin^x01 !");
	ColorChat(id, BLUE, "^x04 [EURO]^x01 Created by:^x03 GhosT ***^x01 | Version:^x03 %s !", VERSION_PLUGIN);
}
public client_disconnect(id)
{
	SaveEuro(id);
}
public SaveEuro(id)
{
	new name[32];
	get_user_name(id,name,31);
	
	new vaultkey[64],vaultdata[256]; 
	format(vaultkey,63,"%s-Euro",name);  
	format(vaultdata,255,"%i#", EuroPlayer[id]);
	
	nvault_set(g_vault,vaultkey,vaultdata);
}
public LoadEuro(id)
{
	new name[32];
	get_user_name(id, name, 31);
	
	new vaultkey[64], vaultdata[256];
	format(vaultkey, 63, "%s-Euro", name);
	format(vaultdata, 255, "%i#", EuroPlayer[id]);
	
	nvault_get(g_vault,vaultkey,vaultdata,255);
	replace_all(vaultdata, 255, "#", " ");
	
	new PlayerEuro[32];
	parse(vaultdata, PlayerEuro, 31);
	
	EuroPlayer[id] = str_to_num(PlayerEuro);
}
public plugin_natives()
{
	register_library( "es" );
	register_native("get_user_euro", "_get_user_Euro");
	register_native("set_user_euro", "_set_user_Euro");
}
public _get_user_Euro(Plugin, Params)
{
	return EuroPlayer[get_param(1)];
}
public _set_user_Euro(Plugin, Params)
{
	new id = get_param(1);
	EuroPlayer[id] = max(0, get_param(2));
	SaveEuro(id);
	return EuroPlayer[id];
}
native get_user_euro(index);
native set_user_euro(index, amount);

public ShowEuroInfo(id)
{
	ColorChat(id, RED, "^x04 [EURO]^x01 Ai^x03 %i^x01 euro !", get_user_euro(id));
	return 1;
}
public EuroInfo(id)
{
	ColorChat(id, RED, "^x04 [EURO]^x01 Pentru a face^x03 Euro^x01 omoara cat mai multi inamici !");
	
	return PLUGIN_HANDLED;
}
public DeathMsg(iWpnIndex)
{
	new headshot = read_data(3);
	new Victim = read_data(2);
	new iAttacker = read_data(1);
	new victim_name[32];
	get_user_name(Victim, victim_name, 31);
	new Weapon, HitPoint = get_user_attacker(Victim, Weapon, HitPoint);
	
	if(iAttacker == Victim)
	{
		set_user_euro(iAttacker, get_user_euro(iAttacker) - get_pcvar_num(Suicide_Euro));
		
		set_hudmessage(0, 150, 215, -1.0, -1.0);
		show_hudmessage(iAttacker, "Ai pierdut %i euro! [Suicide]", get_pcvar_num(Suicide_Euro));
	}
	
	if(Weapon == CSW_KNIFE && !headshot && iAttacker != Victim)
	{
		set_user_euro(iAttacker, get_user_euro(iAttacker) + get_pcvar_num(NormalKnifeKill_Euro));
		
		set_hudmessage(0, 150, 215, -1.0, -1.0);
		show_hudmessage(iAttacker, "Ai primit %i euro pentru ca l-ai omorat pe %s ! [Normal Knife Kill]", get_pcvar_num(NormalKnifeKill_Euro), victim_name);
	}
	else if(Weapon == CSW_KNIFE && headshot && iAttacker != Victim)
	{
		set_user_euro(iAttacker, get_user_euro(iAttacker) + get_pcvar_num(HeadShotKnifeKill_Euro));
		
		set_hudmessage(0, 150, 215, -1.0, -1.0);
		show_hudmessage(iAttacker, "Ai primit %i euro pentru ca l-ai omorat pe %s ! [HeadShot Knife Kill]", get_pcvar_num(HeadShotKnifeKill_Euro), victim_name);
	}
	else if(Weapon == CSW_HEGRENADE && iAttacker != Victim)
	{
		set_user_euro(iAttacker, get_user_euro(iAttacker) + get_pcvar_num(GrenadeKill_Euro));
		
		set_hudmessage(0, 150, 215, -1.0, -1.0);
		show_hudmessage(iAttacker, "Ai primit %i euro pentru ca l-ai omorat pe %s ! [Grenade Kill]", get_pcvar_num(GrenadeKill_Euro), victim_name);
	}
	else if(headshot && iAttacker != Victim)
	{
		set_user_euro(iAttacker, get_user_euro(iAttacker) + get_pcvar_num(HeadShotKill_Euro));
		
		set_hudmessage(0, 150, 215, -1.0, -1.0);
		show_hudmessage(iAttacker, "Ai primit %i euro pentru ca l-ai omorat pe %s ! [HeadShot Kill]", get_pcvar_num(GrenadeKill_Euro), victim_name);
	}

	else if(!headshot && iAttacker != Victim)
	{
		set_user_euro(iAttacker, get_user_euro(iAttacker) + get_pcvar_num(NormalKill_Euro));
		
		set_hudmessage(0, 150, 215, -1.0, -1.0);
		show_hudmessage(iAttacker, "Ai primit %i euro pentru ca l-ai omorat pe %s ! [Normal Kill]", get_pcvar_num(GrenadeKill_Euro), victim_name);
	}
}
public bomb_planted(Planter)
{
	set_user_euro(Planter, get_user_euro(Planter) + get_pcvar_num(Plant_Euro));
	
	set_hudmessage(0, 150, 215, -1.0, -1.0);
	show_hudmessage(Planter, "Ai primit %i euro! [Plant Bomb]", get_pcvar_num(Plant_Euro));
}
public bomb_defused(Defuser)
{
	set_user_euro(Defuser, get_user_euro(Defuser) + get_pcvar_num(Defuse_Euro));
	
	set_hudmessage(0, 150, 215, -1.0, -1.0);
	show_hudmessage(Defuser, "Ai primit %i euro! [Defuse Bomb]", get_pcvar_num(Defuse_Euro));
}
public bomb_explode(Planter)
{
	set_user_euro(Planter, get_user_euro(Planter) + get_pcvar_num(Explode_Euro));
	
	set_hudmessage(0, 150, 215, -1.0, -1.0);
	show_hudmessage(Planter, "Ai primit %i euro! [Explode Bomb]", get_pcvar_num(Explode_Euro));
}
public RoundEnd()
{
	new Player[32], iNum;
	get_players(Player, iNum);
	
	for(new i = 0; i <= iNum; i++)
	{
		if(is_user_alive(Player))
		{
			set_user_euro(Player, get_user_euro(Player) + get_pcvar_num(Survive_Euro));
		}
	}
}
public _euro(id)
{
	new target_name[32];
	
	read_argv(1, target_name, 31);
	
	if(equal(target_name, ""))
	{
		console_print(id, "amx_euro <Nume>");
		return 1;
	}
	
	new iPlayer = cmd_target(id, target_name, 8);
	if(!iPlayer)
	{
		console_print(id, "Jucatorul %s nu a fost gasit !", target_name);
		return 1;
	}
	
	new Player_Name[32];
	get_user_name(iPlayer, Player_Name, 31);
	
	console_print(id, "Jucatorul %s are %i euro !", Player_Name, get_user_euro(iPlayer));
	return 1;
}
public _give_euro(id)
{
	if(get_user_flags(id) & ADMIN_MENU)
	{
		new target_name[32];
		new Amount[10];
		
		read_argv(1, target_name, 31);
		read_argv(2, Amount, 9);
		
		if(equal(target_name, "") || equal(Amount, ""))
		{
			console_print(id, "amx_give_euro <Nume> <Suma>");
			return 1;
		}
		
		new Euro = str_to_num(Amount);
		
		if(Euro <= 0)
		{
			console_print(id, "Trebuie sa scrii o suma mai mare decat 0 !");
			return 1;
		}
		
		new iPlayer = cmd_target(id, target_name, 8);
		
		if(!iPlayer)
		{
			console_print(id, "Jucatorul %s nu a fost gasit !", target_name);
			return 1;
		}
		
		set_user_euro(iPlayer, get_user_euro(iPlayer) + Euro);
		
		new Admin_Name[32];
		new Player_Name[32];
		
		get_user_name(id, Admin_Name, 31);
		get_user_name(iPlayer, Player_Name, 31);
		
		ColorChat(id, RED, "^x04 ADMIN: %s^x01 i-a dat^x03 %d Euro^x01 lui^x04 %s^x01 !", Admin_Name, Euro, Player_Name);
		
		return 1;
	}
	else
	{
		console_print(id, "Nu ai acces la aceasta comanda !");
		return 1;
	}
	
	return 1;
}
public _take_euro(id)
{
	if(get_user_flags(id) & ADMIN_MENU)
	{
		new target_name[32];
		new Amount[10];
		
		read_argv(1, target_name, 31);
		read_argv(2, Amount, 9);
		
		if(equal(target_name, "") || equal(Amount, ""))
		{
			console_print(id, "amx_take_euro <Nume> <Suma>");
			return 1;
		}
		
		new Euro = str_to_num(Amount);
		
		if(Euro <= 0)
		{
			console_print(id, "Trebuie sa scrii o suma mai mare decat 0 !");
			return 1;
		}
		
		new iPlayer = cmd_target(id, target_name, 8);
		
		if(!iPlayer)
		{
			console_print(id, "Jucatorul %s nu a fost gasit !", target_name);
			return 1;
		}
		if(get_user_euro(iPlayer) < Euro)
		{
			console_print(id, "Jucatorul %s are doar %i Euro !", target_name, get_user_euro(iPlayer));
			return 1;
		}
		
		set_user_euro(iPlayer, get_user_euro(iPlayer) - Euro);
		
		new Admin_Name[32];
		new Player_Name[32];
		
		get_user_name(id, Admin_Name, 31);
		get_user_name(iPlayer, Player_Name, 31);
		
		ColorChat(id, RED, "^x04 ADMIN: %s^x01 i-a luat^x03 %d Euro^x01 lui^x04 %s^x01 !", Admin_Name, Euro, Player_Name);
		
		return 1;
	}
	else
	{
		console_print(id, "Nu ai acces la aceasta comanda !");
		return 1;
	}
	
	return 1;
}
User avatar
GhosT ***
Membru, skill +2
Membru, skill +2
Posts: 604
Joined: 04 Dec 2013, 21:52
Detinator Steam: Da
CS Status: Morphin . [ Retras ]
SteamID: Mutulica1428
Reputatie: Fost Moderator ajutator
Location: Dumesti.
Has thanked: 40 times
Been thanked: 99 times
Contact:

26 Jan 2014, 13:16

Am observat si eu acum , mersi :)
User avatar
GhosT ***
Membru, skill +2
Membru, skill +2
Posts: 604
Joined: 04 Dec 2013, 21:52
Detinator Steam: Da
CS Status: Morphin . [ Retras ]
SteamID: Mutulica1428
Reputatie: Fost Moderator ajutator
Location: Dumesti.
Has thanked: 40 times
Been thanked: 99 times
Contact:

26 Jan 2014, 13:24

^ionutz^ wrote:cum as putea face ca la un anumit numar de euro stransi sa primeasca helper spre exemplu
| Afiseaza codul
#include <amxmodx>
#include <euro_system>

#define PLUGIN "Give Rank"
#define VERSION "1.0"
#define AUTHOR "GhosT ***"

new euro_necesari, give_flag;

new flags_give[32];

public plugin_init()
{
	register_plugin( PLUGIN,VERSION,AUTHOR );
	
	euro_necesari = register_cvar("euro_necesari", "1000");
	give_flag = register_cvar("give_flag", "abcde");
	
	register_event("DeathMsg", "DeathMsg", "a");
}
public DeathMsg()
{
	new iAttacker = read_data(1);
	
	if(get_user_euro(iAttacker) >= get_pcvar_num(euro_necesari))
	{
		set_user_flags(iAttacker, get_pcvar_string(give_flag, flags_give, 31));
	}
}
Cvaruri :

euro_necesari - cati euro trebuie pentru a primi gradul respectiv
give_flag - Ce flaguri sa aiba ["LITERELE HELPERULU in cazu' tau (ex: give_flag "abyt")
MrFunk
Membru, skill 0
Membru, skill 0
Posts: 75
Joined: 16 Sep 2013, 17:59
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Has thanked: 2 times
Been thanked: 1 time
Contact:

26 Jan 2014, 18:35

Doar o problema prezinta. Atunci cand modifici numerele de la cvar-uri, cel pentru kill normal tot la fel ramane (adica 15).
Post Reply

Return to “Pluginuri eXtream”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 6 guests