[inchis] [Cerere] Diferite pluginuri

Categoria cu cereri de pluginuri si nu numai.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Forum rules
Accesează link-ul pentru a putea vedea regulile forumului

Daca doriti sa vi se modifice un plugin, va rugam postati aici .
Locked
K-Lumea
Membru, skill 0
Membru, skill 0
Posts: 17
Joined: 01 Dec 2013, 01:04
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Has thanked: 2 times
Contact:

17 Dec 2013, 23:00

Apelez din nou la voi , as avea nevoie de urmatoarele plugine :

1. Un plugin prin care sa seteze tuturor
I. TERORISTILOR la fiecare spawn :
- in caz ca sunt playeri : 400 HP , 500 SPEED , 400 AP
- in caz ca sunt ADMIN(admin_level_h) : 600 HP , 600 SPEED , 400 AP


II. CT la fiecare spawn :
- in caz ca sunt playeri : 150 HP
- in caz ca sunt ADMIN(admin_level_h) : 250 HP

2. Pluginul de arme CSDM setat doar pentru CT ( sa apara doar la CT meniul de arme , la fiecare spawn)

3. Un plugin care sa ofere un anumit reward cand omori un inamic :
- Daca omori un Tero : 4000 $
- Daca omori un CT : 5000 $

As aprecia enorm daca m-ati putea ajuta ! O seara faina !
Rapidserver
Cosmin
Fost moderator
Fost moderator
Posts: 9366
Joined: 06 Jul 2013, 21:08
Detinator Steam: Da
Detinator server CS: Nu
Reputatie: Fost eXtream Mod
Fost Scripter eXtreamCS
Nume anterior: scosmynnnn
Has thanked: 492 times
Been thanked: 546 times

17 Dec 2013, 23:30

| Afiseaza codul
#include <amxmodx>
#include <hamsandwich>
#include <fun>

#define PLUGIN "Avantaje"
#define VERSION "1.0"
#define AUTHOR "C0sm1N"

#pragma semicolon 1

new bool:g_bSpeed[ 33 ], bool:g_bSpeed2[ 33 ];

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR);
	RegisterHam(Ham_Spawn,"player","_ham_spawn_post",1);
	register_event("CurWeapon","event_curweapon","be","1=1");
}
public _ham_spawn_post( )
{
	new iPlayers[32], iNum;
	get_players(iPlayers, iNum);
	for(new i = 0; i < iNum; i++)
	{
		if(get_user_team(iPlayers) == 1 && is_user_alive(iPlayers))
		{
			if(get_user_flags(iPlayers) & ADMIN_LEVEL_H) {
				
				set_user_health(iPlayers, get_user_health(iPlayers) + 500);
				set_user_armor(iPlayers, get_user_armor(iPlayers) + 300);
				g_bSpeed2[ iPlayers[ i ] ] = true;
				set_user_maxspeed(iPlayers, 600.0);
				
			}
			else {
				set_user_health(iPlayers, get_user_health(iPlayers) + 300);
				set_user_armor(iPlayers[i], get_user_armor(iPlayers[i]) + 300);
				g_bSpeed[ iPlayers[ i ] ] = true;
				set_user_maxspeed(iPlayers[i], 500.0);
			}
		}
		else if(get_user_team(iPlayers[i]) == 2 && is_user_alive(iPlayers[i]))
		{
			if(get_user_flags(iPlayers[i]) & ADMIN_LEVEL_H) {
				
				set_user_health(iPlayers[i], get_user_health(iPlayers[i]) + 250);
			}
			else {
				set_user_health(iPlayers[i], get_user_health(iPlayers[i]) + 50);
			}
		}
	}
}

public event_curweapon( id )
{
	if(g_bSpeed[id])
	{
		set_user_maxspeed(id, 500.0);
	}
	if(g_bSpeed2[id])
	{
		set_user_maxspeed(id, 600.0);
	}
}
public client_disconnect(id)
{
	g_bSpeed[id] = false;
	g_bSpeed2[id] = false;
}

La primul plugin,netestat.
User avatar
cyby
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 1771
Joined: 16 Jul 2011, 20:46
Detinator Steam: Da
Detinator server CS: Da
Reputatie: Scripter eXtreamCS
Fost Moderator ajutator
Location: Bacău
Has thanked: 145 times
Been thanked: 388 times
Contact:

17 Dec 2013, 23:47

Testeaza | Afiseaza codul
#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>

// Credite lui Freestyle pentru meniul de arme. Il puteti gasi aici: http://forums.alliedmods.net/showthread.php?t=190936 .

#define VIP ADMIN_LEVEL_H

native give_item(index, const item[]) // Extras din fun.inc

#define PISTOL_WEAPONS_BIT    (1<<CSW_GLOCK18|1<<CSW_USP|1<<CSW_DEAGLE|1<<CSW_P228|1<<CSW_FIVESEVEN|1<<CSW_ELITE)
#define SHOTGUN_WEAPONS_BIT    (1<<CSW_M3|1<<CSW_XM1014)
#define SUBMACHINE_WEAPONS_BIT    (1<<CSW_TMP|1<<CSW_MAC10|1<<CSW_MP5NAVY|1<<CSW_UMP45|1<<CSW_P90)
#define RIFLE_WEAPONS_BIT    (1<<CSW_FAMAS|1<<CSW_GALIL|1<<CSW_AK47|1<<CSW_SCOUT|1<<CSW_M4A1|1<<CSW_SG550|1<<CSW_SG552|1<<CSW_AUG|1<<CSW_AWP|1<<CSW_G3SG1)
#define MACHINE_WEAPONS_BIT    (1<<CSW_M249)
#define PRIMARY_WEAPONS_BIT    (SHOTGUN_WEAPONS_BIT|SUBMACHINE_WEAPONS_BIT|RIFLE_WEAPONS_BIT|MACHINE_WEAPONS_BIT)
#define SECONDARY_WEAPONS_BIT    (PISTOL_WEAPONS_BIT)
#define IsPrimaryWeapon(%1) ((1<<%1) & PRIMARY_WEAPONS_BIT)
#define IsSecondaryWeapon(%1) ((1<<%1) & PISTOL_WEAPONS_BIT)
#define MIN_WEAPON		CSW_P228
#define MAX_WEAPON 		CSW_P90

new const g_iMaxBPAmmo[ MAX_WEAPON + 1 ] =
{
	0, 52, 0, 90, 1, 32, 0, 100, 90, 1, 120, 100, 100, 90, 90, 90, 100, 120, 30,
	120, 200, 32, 90, 120, 90, 2, 35, 90, 90, 0, 100
}

new const g_szWeaponClassnames[ MAX_WEAPON + 1 ][ ] =
{
	"", "weapon_p228", "", "weapon_scout", "weapon_hegrenade",
	"weapon_xm1014", "weapon_c4", "weapon_mac10", "weapon_aug",
	"weapon_smokegrenade", "weapon_elite", "weapon_fiveseven",
	"weapon_ump45", "weapon_sg550", "weapon_galil", "weapon_famas",
	"weapon_usp", "weapon_glock18", "weapon_awp", "weapon_mp5navy",
	"weapon_m249", "weapon_m3", "weapon_m4a1", "weapon_tmp", "weapon_g3sg1",
	"weapon_flashbang", "weapon_deagle", "weapon_sg552", "weapon_ak47",
	"weapon_knife", "weapon_p90"
}

new const g_szWeaponNames[ MAX_WEAPON + 1 ][ ] =
{
	"", "P228", "", "Schmidt Scout", "", "XM1014 (Auto-Shotgun)", "",
	"Mac-10", "AUG", "", "Dual Elites", "Five-Seven", "UMP-45", "SG-550",
	"Galil", "Famas", "USP", "Glock-18", "AWP", "MP5-Navy", "M249 (Para)",
	"M3 (Pump-Shotgun)", "M4A1", "TMP", "G3SG1", "", "Deagle", "SG-552",
	"AK-47", "", "P90"
}

new g_hWeaponMenu
new g_hPrimaryWeaponMenu
new g_hSecondaryWeaponMenu
new bool:g_bRememberGuns[33]
new g_iPrimaryWeapon[33];
new g_iSecondaryWeapon[33];

public plugin_init()
{
	register_plugin("Furien Gameplay", "1.0", "cyby")
	
	register_event("CurWeapon", "arma_curenta", "be", "1=1")
	RegisterHam(Ham_Spawn, "player", "spawn_post", 1)
	register_event("DeathMsg", "death_event", "a")
	
	register_clcmd("say /guns", "CmdGunsEnable")
}

public arma_curenta(id)
{
	if(!is_user_connected(id))
		return
		
	if(get_user_team(id) == 1)
	{
		if(get_user_flags(id) & VIP)
			set_pev(id, pev_maxspeed, 600.0)
		else
			set_pev(id, pev_maxspeed, 500.0)
	}
}

public spawn_post(id)
{
	if(!is_user_connected(id) || !is_user_alive(id))
		return
		
	switch(get_user_team(id))
	{
		case 1:
		{
			if(get_user_flags(id) & VIP)
				set_pev(id, pev_health, 600.0)
			else
				set_pev(id, pev_health, 400.0)
			set_pev(id, pev_armorvalue, 400.0)
		}
		case 2:
		{
			if(get_user_flags(id) & VIP)
				set_pev(id, pev_health, 250.0)
			else
				set_pev(id, pev_health, 150.0)
				
			if(g_bRememberGuns[id])
				GiveWeapons(id)
			else if(g_iPrimaryWeapon[id] == 0 || g_iSecondaryWeapon[id] == 0)
			{
				menu_display(id, g_hPrimaryWeaponMenu)
			}
			else menu_display(id, g_hWeaponMenu)
		}
	}
}

public death_event()
{
	new attacker, victim;
	attacker = read_data(1)
	victim = read_data(2)
	if(victim == attacker || !is_user_connected(victim) || !is_user_connected(attacker))
		return
		
	switch(get_user_team(victim))
	{
		case 1:
		{
			if(cs_get_user_money(attacker) + 4000 > 16000)
				cs_set_user_money(attacker, 16000)
			else
				cs_set_user_money(attacker, cs_get_user_money(attacker) + 4000)
		}
		case 2:
		{
			if(cs_get_user_money(attacker) + 5000 > 16000)
				cs_set_user_money(attacker, 16000)
			else
				cs_set_user_money(attacker, cs_get_user_money(attacker) + 5000)
		}
	}
}

// De aici nu mai apartine de mine.

public CmdEnableGuns(id)
{
	if(g_bRememberGuns[id])
	{
		color(id, ".v[FURIEN].g Meniul tau pentru arme este din nou.e activ.g.")
		g_bRememberGuns[id] = false
	}
	else
		color(id, ".v[FURIEN].g Meniul tau pentru arme este deja.e activat.g.")
}
	
public client_putinserver(id)
{
	g_bRememberGuns[id] = false
	g_iPrimaryWeapon[id] = 0
	g_iSecondaryWeapon[id] = 0
}

public GunsMenu()
{
	g_hWeaponMenu = menu_create("\ySelecteaza optiunea\w", "WeaponMainMenu_Handler")
	menu_additem(g_hWeaponMenu, "\rArme noi\w", "0")
	menu_additem(g_hWeaponMenu, "\rArmele precedente\w", "1")
	menu_additem(g_hWeaponMenu, "\rArmele precedente + neafisarea meniului\w", "2")
		
	g_hPrimaryWeaponMenu = menu_create("\yMeniul cu arme^nSelecteaza arma primara:\w", "PrimaryWeapons_Handler")
	g_hSecondaryWeaponMenu = menu_create("\yMeniul cu arme^nSelecteaza arma secundara:\w", "SecondaryWeapons_Handler")
	
	new szInfo[3]
	for(new i = MIN_WEAPON; i <= MAX_WEAPON; i++)
	{
		if(IsPrimaryWeapon(i))
		{
			num_to_str(i, szInfo, charsmax(szInfo))
			menu_additem(g_hPrimaryWeaponMenu, g_szWeaponNames, szInfo)
		}
		else if(IsSecondaryWeapon(i))
		{
			num_to_str(i, szInfo, charsmax(szInfo))
			menu_additem(g_hSecondaryWeaponMenu, g_szWeaponNames, szInfo)
		}
		else continue;
	}
}

public WeaponMainMenu_Handler(id, hMenu, iItem)
{
	switch(iItem)
	{
		case 0: menu_display(id, g_hPrimaryWeaponMenu, 0)
		case 1: 
		{
			GiveWeapons(id)
		}
			
		case 2: 
		{
			GiveWeapons(id)
			g_bRememberGuns[id] = true
			color(id, ".v[FURIEN].g Meniul a fost dezactivat. Runda viitoare nu-ti mai apare meniul si auto-selecteaza armele precedente.")
		}
	}
}

public PrimaryWeapons_Handler(id, hMenu, iItem)
{
	if(iItem == MENU_EXIT)
	{	
		menu_destroy(hMenu)
		return PLUGIN_HANDLED
	}
	
	new iAccess, hCallback
	new szData[6]
	menu_item_getinfo(hMenu, iItem, iAccess, szData, charsmax(szData), _, _, hCallback)
	g_iPrimaryWeapon[id] = str_to_num(szData)
	menu_display(id, g_hSecondaryWeaponMenu, 0)
	return PLUGIN_HANDLED
}

public SecondaryWeapons_Handler(id, hMenu, iItem)
{
	if(iItem == MENU_EXIT)
	{
		menu_destroy(hMenu)
		return PLUGIN_HANDLED
	}
	new iAccess, hCallback
	new szData[6]
	menu_item_getinfo(hMenu, iItem, iAccess, szData, charsmax(szData), _, _, hCallback)
	g_iSecondaryWeapon[id] = str_to_num(szData)
	GiveWeapons(id)
	return PLUGIN_HANDLED
}

GiveWeapons(id)
{
	new iPrimary = g_iPrimaryWeapon[id]
	new iSecondary = g_iSecondaryWeapon[id]
	give_item(id, g_szWeaponClassnames[iPrimary])
	give_item(id, g_szWeaponClassnames[iSecondary])
	cs_set_user_bpammo(id, iPrimary, g_iMaxBPAmmo[iPrimary])
	cs_set_user_bpammo(id, iSecondary, g_iMaxBPAmmo[iSecondary])
}

stock color(const id, const input[], any:...)
{
	new count = 1, players[32]
	static msg[191]
	vformat(msg, 190, input, 3)
	
	replace_all(msg, 190, ".v", "^4")
	replace_all(msg, 190, ".g", "^1")
	replace_all(msg, 190, ".e", "^3")
	
	if (id) players[0] = id;
	else get_players(players, count, "ch")
	{
		for (new i = 0; i < count; i++)
		{
			if (is_user_connected(players))
			{
				message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players)
				write_byte(players)
				write_string(msg)
				message_end()
			}
		}
	}
}
89.34.25.17:27015 - XMAS MOD
89.34.25.38:27015 - XMAS MOD
Cosmin
Fost moderator
Fost moderator
Posts: 9366
Joined: 06 Jul 2013, 21:08
Detinator Steam: Da
Detinator server CS: Nu
Reputatie: Fost eXtream Mod
Fost Scripter eXtreamCS
Nume anterior: scosmynnnn
Has thanked: 492 times
Been thanked: 546 times

17 Dec 2013, 23:54

| Afiseaza codul
#include < amxmodx >
#include < cstrike >

#pragma semicolon 1

public plugin_init() {
	register_plugin("PLUGIN", "1.0", "C0sm1N");
	register_event( "DeathMsg", "evDeathMsg", "a" );
}
public evDeathMsg( )
{
	new iKiller, iVictim;
	
	iKiller = read_data(1);
	iVictim = read_data(2);
	
	if(cs_get_user_team(iKiller) == 1)
	{
		if(iKiller != iVictim && is_user_alive(iKiller))
		{
			cs_set_user_money(iKiller, cs_get_user_money(iKiller) + 5000);
		}
	}
	else if(cs_get_user_team(iKiller) == 2)
	{
		if(iKiller != iVictim && is_user_alive(iKiller))
		{
			cs_set_user_money(iKiller, cs_get_user_money(iKiller) + 4000);
		}
	}
}
La 3.. incearca :-?
K-Lumea
Membru, skill 0
Membru, skill 0
Posts: 17
Joined: 01 Dec 2013, 01:04
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Has thanked: 2 times
Contact:

18 Dec 2013, 00:00

cyby wrote:
Testeaza | Afiseaza codul
#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>

// Credite lui Freestyle pentru meniul de arme. Il puteti gasi aici: http://forums.alliedmods.net/showthread.php?t=190936 .

#define VIP ADMIN_LEVEL_H

native give_item(index, const item[]) // Extras din fun.inc

#define PISTOL_WEAPONS_BIT    (1<<CSW_GLOCK18|1<<CSW_USP|1<<CSW_DEAGLE|1<<CSW_P228|1<<CSW_FIVESEVEN|1<<CSW_ELITE)
#define SHOTGUN_WEAPONS_BIT    (1<<CSW_M3|1<<CSW_XM1014)
#define SUBMACHINE_WEAPONS_BIT    (1<<CSW_TMP|1<<CSW_MAC10|1<<CSW_MP5NAVY|1<<CSW_UMP45|1<<CSW_P90)
#define RIFLE_WEAPONS_BIT    (1<<CSW_FAMAS|1<<CSW_GALIL|1<<CSW_AK47|1<<CSW_SCOUT|1<<CSW_M4A1|1<<CSW_SG550|1<<CSW_SG552|1<<CSW_AUG|1<<CSW_AWP|1<<CSW_G3SG1)
#define MACHINE_WEAPONS_BIT    (1<<CSW_M249)
#define PRIMARY_WEAPONS_BIT    (SHOTGUN_WEAPONS_BIT|SUBMACHINE_WEAPONS_BIT|RIFLE_WEAPONS_BIT|MACHINE_WEAPONS_BIT)
#define SECONDARY_WEAPONS_BIT    (PISTOL_WEAPONS_BIT)
#define IsPrimaryWeapon(%1) ((1<<%1) & PRIMARY_WEAPONS_BIT)
#define IsSecondaryWeapon(%1) ((1<<%1) & PISTOL_WEAPONS_BIT)
#define MIN_WEAPON		CSW_P228
#define MAX_WEAPON 		CSW_P90

new const g_iMaxBPAmmo[ MAX_WEAPON + 1 ] =
{
	0, 52, 0, 90, 1, 32, 0, 100, 90, 1, 120, 100, 100, 90, 90, 90, 100, 120, 30,
	120, 200, 32, 90, 120, 90, 2, 35, 90, 90, 0, 100
}

new const g_szWeaponClassnames[ MAX_WEAPON + 1 ][ ] =
{
	"", "weapon_p228", "", "weapon_scout", "weapon_hegrenade",
	"weapon_xm1014", "weapon_c4", "weapon_mac10", "weapon_aug",
	"weapon_smokegrenade", "weapon_elite", "weapon_fiveseven",
	"weapon_ump45", "weapon_sg550", "weapon_galil", "weapon_famas",
	"weapon_usp", "weapon_glock18", "weapon_awp", "weapon_mp5navy",
	"weapon_m249", "weapon_m3", "weapon_m4a1", "weapon_tmp", "weapon_g3sg1",
	"weapon_flashbang", "weapon_deagle", "weapon_sg552", "weapon_ak47",
	"weapon_knife", "weapon_p90"
}

new const g_szWeaponNames[ MAX_WEAPON + 1 ][ ] =
{
	"", "P228", "", "Schmidt Scout", "", "XM1014 (Auto-Shotgun)", "",
	"Mac-10", "AUG", "", "Dual Elites", "Five-Seven", "UMP-45", "SG-550",
	"Galil", "Famas", "USP", "Glock-18", "AWP", "MP5-Navy", "M249 (Para)",
	"M3 (Pump-Shotgun)", "M4A1", "TMP", "G3SG1", "", "Deagle", "SG-552",
	"AK-47", "", "P90"
}

new g_hWeaponMenu
new g_hPrimaryWeaponMenu
new g_hSecondaryWeaponMenu
new bool:g_bRememberGuns[33]
new g_iPrimaryWeapon[33];
new g_iSecondaryWeapon[33];

public plugin_init()
{
	register_plugin("Furien Gameplay", "1.0", "cyby")
	
	register_event("CurWeapon", "arma_curenta", "be", "1=1")
	RegisterHam(Ham_Spawn, "player", "spawn_post", 1)
	register_event("DeathMsg", "death_event", "a")
	
	register_clcmd("say /guns", "CmdGunsEnable")
}

public arma_curenta(id)
{
	if(!is_user_connected(id))
		return
		
	if(get_user_team(id) == 1)
	{
		if(get_user_flags(id) & VIP)
			set_pev(id, pev_maxspeed, 600.0)
		else
			set_pev(id, pev_maxspeed, 500.0)
	}
}

public spawn_post(id)
{
	if(!is_user_connected(id) || !is_user_alive(id))
		return
		
	switch(get_user_team(id))
	{
		case 1:
		{
			if(get_user_flags(id) & VIP)
				set_pev(id, pev_health, 600.0)
			else
				set_pev(id, pev_health, 400.0)
			set_pev(id, pev_armorvalue, 400.0)
		}
		case 2:
		{
			if(get_user_flags(id) & VIP)
				set_pev(id, pev_health, 250.0)
			else
				set_pev(id, pev_health, 150.0)
				
			if(g_bRememberGuns[id])
				GiveWeapons(id)
			else if(g_iPrimaryWeapon[id] == 0 || g_iSecondaryWeapon[id] == 0)
			{
				menu_display(id, g_hPrimaryWeaponMenu)
			}
			else menu_display(id, g_hWeaponMenu)
		}
	}
}

public death_event()
{
	new attacker, victim;
	attacker = read_data(1)
	victim = read_data(2)
	if(victim == attacker || !is_user_connected(victim) || !is_user_connected(attacker))
		return
		
	switch(get_user_team(victim))
	{
		case 1:
		{
			if(cs_get_user_money(attacker) + 4000 > 16000)
				cs_set_user_money(attacker, 16000)
			else
				cs_set_user_money(attacker, cs_get_user_money(attacker) + 4000)
		}
		case 2:
		{
			if(cs_get_user_money(attacker) + 5000 > 16000)
				cs_set_user_money(attacker, 16000)
			else
				cs_set_user_money(attacker, cs_get_user_money(attacker) + 5000)
		}
	}
}

// De aici nu mai apartine de mine.

public CmdEnableGuns(id)
{
	if(g_bRememberGuns[id])
	{
		color(id, ".v[FURIEN].g Meniul tau pentru arme este din nou.e activ.g.")
		g_bRememberGuns[id] = false
	}
	else
		color(id, ".v[FURIEN].g Meniul tau pentru arme este deja.e activat.g.")
}
	
public client_putinserver(id)
{
	g_bRememberGuns[id] = false
	g_iPrimaryWeapon[id] = 0
	g_iSecondaryWeapon[id] = 0
}

public GunsMenu()
{
	g_hWeaponMenu = menu_create("\ySelecteaza optiunea\w", "WeaponMainMenu_Handler")
	menu_additem(g_hWeaponMenu, "\rArme noi\w", "0")
	menu_additem(g_hWeaponMenu, "\rArmele precedente\w", "1")
	menu_additem(g_hWeaponMenu, "\rArmele precedente + neafisarea meniului\w", "2")
		
	g_hPrimaryWeaponMenu = menu_create("\yMeniul cu arme^nSelecteaza arma primara:\w", "PrimaryWeapons_Handler")
	g_hSecondaryWeaponMenu = menu_create("\yMeniul cu arme^nSelecteaza arma secundara:\w", "SecondaryWeapons_Handler")
	
	new szInfo[3]
	for(new i = MIN_WEAPON; i <= MAX_WEAPON; i++)
	{
		if(IsPrimaryWeapon(i))
		{
			num_to_str(i, szInfo, charsmax(szInfo))
			menu_additem(g_hPrimaryWeaponMenu, g_szWeaponNames, szInfo)
		}
		else if(IsSecondaryWeapon(i))
		{
			num_to_str(i, szInfo, charsmax(szInfo))
			menu_additem(g_hSecondaryWeaponMenu, g_szWeaponNames, szInfo)
		}
		else continue;
	}
}

public WeaponMainMenu_Handler(id, hMenu, iItem)
{
	switch(iItem)
	{
		case 0: menu_display(id, g_hPrimaryWeaponMenu, 0)
		case 1: 
		{
			GiveWeapons(id)
		}
			
		case 2: 
		{
			GiveWeapons(id)
			g_bRememberGuns[id] = true
			color(id, ".v[FURIEN].g Meniul a fost dezactivat. Runda viitoare nu-ti mai apare meniul si auto-selecteaza armele precedente.")
		}
	}
}

public PrimaryWeapons_Handler(id, hMenu, iItem)
{
	if(iItem == MENU_EXIT)
	{	
		menu_destroy(hMenu)
		return PLUGIN_HANDLED
	}
	
	new iAccess, hCallback
	new szData[6]
	menu_item_getinfo(hMenu, iItem, iAccess, szData, charsmax(szData), _, _, hCallback)
	g_iPrimaryWeapon[id] = str_to_num(szData)
	menu_display(id, g_hSecondaryWeaponMenu, 0)
	return PLUGIN_HANDLED
}

public SecondaryWeapons_Handler(id, hMenu, iItem)
{
	if(iItem == MENU_EXIT)
	{
		menu_destroy(hMenu)
		return PLUGIN_HANDLED
	}
	new iAccess, hCallback
	new szData[6]
	menu_item_getinfo(hMenu, iItem, iAccess, szData, charsmax(szData), _, _, hCallback)
	g_iSecondaryWeapon[id] = str_to_num(szData)
	GiveWeapons(id)
	return PLUGIN_HANDLED
}

GiveWeapons(id)
{
	new iPrimary = g_iPrimaryWeapon[id]
	new iSecondary = g_iSecondaryWeapon[id]
	give_item(id, g_szWeaponClassnames[iPrimary])
	give_item(id, g_szWeaponClassnames[iSecondary])
	cs_set_user_bpammo(id, iPrimary, g_iMaxBPAmmo[iPrimary])
	cs_set_user_bpammo(id, iSecondary, g_iMaxBPAmmo[iSecondary])
}

stock color(const id, const input[], any:...)
{
	new count = 1, players[32]
	static msg[191]
	vformat(msg, 190, input, 3)
	
	replace_all(msg, 190, ".v", "^4")
	replace_all(msg, 190, ".g", "^1")
	replace_all(msg, 190, ".e", "^3")
	
	if (id) players[0] = id;
	else get_players(players, count, "ch")
	{
		for (new i = 0; i < count; i++)
		{
			if (is_user_connected(players))
			{
				message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players)
				write_byte(players)
				write_string(msg)
				message_end()
			}
		}
	}
}


HP / AP le primeste cum trebuie , lafel si speed . Meniul de arme nu apare deloc .. nici prin comanda .. nici automat . Poti adauga cumva ca cei de la tero sa nu primeasca nici he , nici bomba , ci doar KNIFE ? Deasemenea Tero sa nu poata ridica nimic de jos? Mersi la amandoi pentru efort !
User avatar
cyby
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 1771
Joined: 16 Jul 2011, 20:46
Detinator Steam: Da
Detinator server CS: Da
Reputatie: Scripter eXtreamCS
Fost Moderator ajutator
Location: Bacău
Has thanked: 145 times
Been thanked: 388 times
Contact:

18 Dec 2013, 00:10

| Afiseaza codul
#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>

// Credite lui Freestyle pentru meniul de arme. Il puteti gasi aici: http://forums.alliedmods.net/showthread.php?t=190936 .

#define VIP ADMIN_LEVEL_H

native give_item(index, const item[]) // Extras din fun.inc

#define PISTOL_WEAPONS_BIT    (1<<CSW_GLOCK18|1<<CSW_USP|1<<CSW_DEAGLE|1<<CSW_P228|1<<CSW_FIVESEVEN|1<<CSW_ELITE)
#define SHOTGUN_WEAPONS_BIT    (1<<CSW_M3|1<<CSW_XM1014)
#define SUBMACHINE_WEAPONS_BIT    (1<<CSW_TMP|1<<CSW_MAC10|1<<CSW_MP5NAVY|1<<CSW_UMP45|1<<CSW_P90)
#define RIFLE_WEAPONS_BIT    (1<<CSW_FAMAS|1<<CSW_GALIL|1<<CSW_AK47|1<<CSW_SCOUT|1<<CSW_M4A1|1<<CSW_SG550|1<<CSW_SG552|1<<CSW_AUG|1<<CSW_AWP|1<<CSW_G3SG1)
#define MACHINE_WEAPONS_BIT    (1<<CSW_M249)
#define PRIMARY_WEAPONS_BIT    (SHOTGUN_WEAPONS_BIT|SUBMACHINE_WEAPONS_BIT|RIFLE_WEAPONS_BIT|MACHINE_WEAPONS_BIT)
#define SECONDARY_WEAPONS_BIT    (PISTOL_WEAPONS_BIT)
#define IsPrimaryWeapon(%1) ((1<<%1) & PRIMARY_WEAPONS_BIT)
#define IsSecondaryWeapon(%1) ((1<<%1) & PISTOL_WEAPONS_BIT)
#define MIN_WEAPON		CSW_P228
#define MAX_WEAPON 		CSW_P90

new const g_iMaxBPAmmo[ MAX_WEAPON + 1 ] =
{
	0, 52, 0, 90, 1, 32, 0, 100, 90, 1, 120, 100, 100, 90, 90, 90, 100, 120, 30,
	120, 200, 32, 90, 120, 90, 2, 35, 90, 90, 0, 100
}

new const g_szWeaponClassnames[ MAX_WEAPON + 1 ][ ] =
{
	"", "weapon_p228", "", "weapon_scout", "weapon_hegrenade",
	"weapon_xm1014", "weapon_c4", "weapon_mac10", "weapon_aug",
	"weapon_smokegrenade", "weapon_elite", "weapon_fiveseven",
	"weapon_ump45", "weapon_sg550", "weapon_galil", "weapon_famas",
	"weapon_usp", "weapon_glock18", "weapon_awp", "weapon_mp5navy",
	"weapon_m249", "weapon_m3", "weapon_m4a1", "weapon_tmp", "weapon_g3sg1",
	"weapon_flashbang", "weapon_deagle", "weapon_sg552", "weapon_ak47",
	"weapon_knife", "weapon_p90"
}

new const g_szWeaponNames[ MAX_WEAPON + 1 ][ ] =
{
	"", "P228", "", "Schmidt Scout", "", "XM1014 (Auto-Shotgun)", "",
	"Mac-10", "AUG", "", "Dual Elites", "Five-Seven", "UMP-45", "SG-550",
	"Galil", "Famas", "USP", "Glock-18", "AWP", "MP5-Navy", "M249 (Para)",
	"M3 (Pump-Shotgun)", "M4A1", "TMP", "G3SG1", "", "Deagle", "SG-552",
	"AK-47", "", "P90"
}

new g_hWeaponMenu
new g_hPrimaryWeaponMenu
new g_hSecondaryWeaponMenu
new bool:g_bRememberGuns[33]
new g_iPrimaryWeapon[33];
new g_iSecondaryWeapon[33];

public plugin_init()
{
	register_plugin("Furien Gameplay", "1.0", "cyby")
	
	register_event("CurWeapon", "arma_curenta", "be", "1=1")
	RegisterHam(Ham_Spawn, "player", "spawn_post", 1)
	register_event("DeathMsg", "death_event", "a")
	//Extras din zp
	RegisterHam(Ham_Touch, "weaponbox", "TouchWeapon")
	RegisterHam(Ham_Touch, "armoury_entity", "TouchWeapon")
	RegisterHam(Ham_Touch, "weapon_shield", "TouchWeapon")
	
	register_clcmd("say /guns", "CmdEnableGuns")
}

public arma_curenta(id)
{
	if(!is_user_connected(id))
		return
		
	if(get_user_team(id) == 1)
	{
		if(get_user_flags(id) & VIP)
			set_pev(id, pev_maxspeed, 600.0)
		else
			set_pev(id, pev_maxspeed, 500.0)
	}
}

public spawn_post(id)
{
	if(!is_user_connected(id) || !is_user_alive(id))
		return
		
	switch(get_user_team(id))
	{
		case 1:
		{
			if(get_user_flags(id) & VIP)
				set_pev(id, pev_health, 600.0)
			else
				set_pev(id, pev_health, 400.0)
			set_pev(id, pev_armorvalue, 400.0)
			fm_strip_user_weapons(id)
			give_item(id, "weapon_knife")
		}
		case 2:
		{
			if(get_user_flags(id) & VIP)
				set_pev(id, pev_health, 250.0)
			else
				set_pev(id, pev_health, 150.0)
				
			if(g_bRememberGuns[id])
				GiveWeapons(id)
			else if(g_iPrimaryWeapon[id] == 0 || g_iSecondaryWeapon[id] == 0)
			{
				menu_display(id, g_hPrimaryWeaponMenu)
			}
			else menu_display(id, g_hWeaponMenu)
		}
	}
}

public death_event()
{
	new attacker, victim;
	attacker = read_data(1)
	victim = read_data(2)
	if(victim == attacker || !is_user_connected(victim) || !is_user_connected(attacker))
		return
		
	switch(get_user_team(victim))
	{
		case 1:
		{
			if(cs_get_user_money(attacker) + 4000 > 16000)
				cs_set_user_money(attacker, 16000)
			else
				cs_set_user_money(attacker, cs_get_user_money(attacker) + 4000)
		}
		case 2:
		{
			if(cs_get_user_money(attacker) + 5000 > 16000)
				cs_set_user_money(attacker, 16000)
			else
				cs_set_user_money(attacker, cs_get_user_money(attacker) + 5000)
		}
	}
}

// Extras din ZP
public TouchWeapon(weapon, id)
{
	if(!is_user_connected(id))
		return HAM_IGNORED
	
	if(get_user_team(id) == 1)
		return HAM_SUPERCEDE
	
	return HAM_IGNORED
}

// De aici nu mai apartine de mine.
public CmdEnableGuns(id)
{
	if(g_bRememberGuns[id])
	{
		color(id, ".v[FURIEN].g Meniul tau pentru arme este din nou.e activ.g.")
		g_bRememberGuns[id] = false
	}
	else
		color(id, ".v[FURIEN].g Meniul tau pentru arme este deja.e activat.g.")
}
	
public client_putinserver(id)
{
	g_bRememberGuns[id] = false
	g_iPrimaryWeapon[id] = 0
	g_iSecondaryWeapon[id] = 0
}

public GunsMenu()
{
	g_hWeaponMenu = menu_create("\ySelecteaza optiunea\w", "WeaponMainMenu_Handler")
	menu_additem(g_hWeaponMenu, "\rArme noi\w", "0")
	menu_additem(g_hWeaponMenu, "\rArmele precedente\w", "1")
	menu_additem(g_hWeaponMenu, "\rArmele precedente + neafisarea meniului\w", "2")
		
	g_hPrimaryWeaponMenu = menu_create("\yMeniul cu arme^nSelecteaza arma primara:\w", "PrimaryWeapons_Handler")
	g_hSecondaryWeaponMenu = menu_create("\yMeniul cu arme^nSelecteaza arma secundara:\w", "SecondaryWeapons_Handler")
	
	new szInfo[3]
	for(new i = MIN_WEAPON; i <= MAX_WEAPON; i++)
	{
		if(IsPrimaryWeapon(i))
		{
			num_to_str(i, szInfo, charsmax(szInfo))
			menu_additem(g_hPrimaryWeaponMenu, g_szWeaponNames, szInfo)
		}
		else if(IsSecondaryWeapon(i))
		{
			num_to_str(i, szInfo, charsmax(szInfo))
			menu_additem(g_hSecondaryWeaponMenu, g_szWeaponNames, szInfo)
		}
		else continue;
	}
}

public WeaponMainMenu_Handler(id, hMenu, iItem)
{
	switch(iItem)
	{
		case 0: menu_display(id, g_hPrimaryWeaponMenu, 0)
		case 1: 
		{
			GiveWeapons(id)
		}
			
		case 2: 
		{
			GiveWeapons(id)
			g_bRememberGuns[id] = true
			color(id, ".v[FURIEN].g Meniul a fost dezactivat. Runda viitoare nu-ti mai apare meniul si auto-selecteaza armele precedente.")
		}
	}
}

public PrimaryWeapons_Handler(id, hMenu, iItem)
{
	if(iItem == MENU_EXIT)
	{	
		menu_destroy(hMenu)
		return PLUGIN_HANDLED
	}
	
	new iAccess, hCallback
	new szData[6]
	menu_item_getinfo(hMenu, iItem, iAccess, szData, charsmax(szData), _, _, hCallback)
	g_iPrimaryWeapon[id] = str_to_num(szData)
	menu_display(id, g_hSecondaryWeaponMenu, 0)
	return PLUGIN_HANDLED
}

public SecondaryWeapons_Handler(id, hMenu, iItem)
{
	if(iItem == MENU_EXIT)
	{
		menu_destroy(hMenu)
		return PLUGIN_HANDLED
	}
	new iAccess, hCallback
	new szData[6]
	menu_item_getinfo(hMenu, iItem, iAccess, szData, charsmax(szData), _, _, hCallback)
	g_iSecondaryWeapon[id] = str_to_num(szData)
	GiveWeapons(id)
	return PLUGIN_HANDLED
}

GiveWeapons(id)
{
	new iPrimary = g_iPrimaryWeapon[id]
	new iSecondary = g_iSecondaryWeapon[id]
	give_item(id, g_szWeaponClassnames[iPrimary])
	give_item(id, g_szWeaponClassnames[iSecondary])
	cs_set_user_bpammo(id, iPrimary, g_iMaxBPAmmo[iPrimary])
	cs_set_user_bpammo(id, iSecondary, g_iMaxBPAmmo[iSecondary])
}

stock color(const id, const input[], any:...)
{
	new count = 1, players[32]
	static msg[191]
	vformat(msg, 190, input, 3)
	
	replace_all(msg, 190, ".v", "^4")
	replace_all(msg, 190, ".g", "^1")
	replace_all(msg, 190, ".e", "^3")
	
	if (id) players[0] = id;
	else get_players(players, count, "ch")
	{
		for (new i = 0; i < count; i++)
		{
			if (is_user_connected(players))
			{
				message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players)
				write_byte(players)
				write_string(msg)
				message_end()
			}
		}
	}
}

fm_strip_user_weapons(index)
{
	new iEnt = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "player_weaponstrip"))
	
	if(!pev_valid(iEnt))
		return 0;

	dllfunc(DLLFunc_Spawn, iEnt)
	dllfunc(DLLFunc_Use, iEnt, index)
	engfunc(EngFunc_RemoveEntity, iEnt)
	
	return 1;
}
89.34.25.17:27015 - XMAS MOD
89.34.25.38:27015 - XMAS MOD
K-Lumea
Membru, skill 0
Membru, skill 0
Posts: 17
Joined: 01 Dec 2013, 01:04
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Has thanked: 2 times
Contact:

18 Dec 2013, 00:29

Tot nu apare acel meniu cand incepe runda la CT ...Acum bomba si nici armele nu le mai pot ridica de pe jos , poti scoate bomba de tot de la tero ? sa nu dea nimanui c4 in spawn .

Ar fi mai bine cred daca s-ar introduce optiunea de a nu putea accesa meniul de shop clasic (cel de pe tasta B)
Cosmin
Fost moderator
Fost moderator
Posts: 9366
Joined: 06 Jul 2013, 21:08
Detinator Steam: Da
Detinator server CS: Nu
Reputatie: Fost eXtream Mod
Fost Scripter eXtreamCS
Nume anterior: scosmynnnn
Has thanked: 492 times
Been thanked: 546 times

18 Dec 2013, 00:35

Code: Select all

#include <amxmodx>

public plugin_init() register_concmd("buy","cmdBUY")
public cmdBUY() return PLUGIN_HANDLED
parca asa era pentru faza cu b,nu?
User avatar
cyby
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 1771
Joined: 16 Jul 2011, 20:46
Detinator Steam: Da
Detinator server CS: Da
Reputatie: Scripter eXtreamCS
Fost Moderator ajutator
Location: Bacău
Has thanked: 145 times
Been thanked: 388 times
Contact:

18 Dec 2013, 00:53

| Afiseaza codul
#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>

// Credite lui Freestyle pentru meniul de arme. Il puteti gasi aici: http://forums.alliedmods.net/showthread.php?t=190936 .

#define VIP ADMIN_LEVEL_H

native give_item(index, const item[]) // Extras din fun.inc

#define PISTOL_WEAPONS_BIT    (1<<CSW_GLOCK18|1<<CSW_USP|1<<CSW_DEAGLE|1<<CSW_P228|1<<CSW_FIVESEVEN|1<<CSW_ELITE)
#define SHOTGUN_WEAPONS_BIT    (1<<CSW_M3|1<<CSW_XM1014)
#define SUBMACHINE_WEAPONS_BIT    (1<<CSW_TMP|1<<CSW_MAC10|1<<CSW_MP5NAVY|1<<CSW_UMP45|1<<CSW_P90)
#define RIFLE_WEAPONS_BIT    (1<<CSW_FAMAS|1<<CSW_GALIL|1<<CSW_AK47|1<<CSW_SCOUT|1<<CSW_M4A1|1<<CSW_SG550|1<<CSW_SG552|1<<CSW_AUG|1<<CSW_AWP|1<<CSW_G3SG1)
#define MACHINE_WEAPONS_BIT    (1<<CSW_M249)
#define PRIMARY_WEAPONS_BIT    (SHOTGUN_WEAPONS_BIT|SUBMACHINE_WEAPONS_BIT|RIFLE_WEAPONS_BIT|MACHINE_WEAPONS_BIT)
#define SECONDARY_WEAPONS_BIT    (PISTOL_WEAPONS_BIT)
#define IsPrimaryWeapon(%1) ((1<<%1) & PRIMARY_WEAPONS_BIT)
#define IsSecondaryWeapon(%1) ((1<<%1) & PISTOL_WEAPONS_BIT)
#define MIN_WEAPON		CSW_P228
#define MAX_WEAPON 		CSW_P90

new const g_iMaxBPAmmo[MAX_WEAPON + 1] =
{
	0, 52, 0, 90, 1, 32, 0, 100, 90, 1, 120, 100, 100, 90, 90, 90, 100, 120, 30,
	120, 200, 32, 90, 120, 90, 2, 35, 90, 90, 0, 100
}

new const g_szWeaponClassnames[MAX_WEAPON + 1][] =
{
	"", "weapon_p228", "", "weapon_scout", "weapon_hegrenade",
	"weapon_xm1014", "weapon_c4", "weapon_mac10", "weapon_aug",
	"weapon_smokegrenade", "weapon_elite", "weapon_fiveseven",
	"weapon_ump45", "weapon_sg550", "weapon_galil", "weapon_famas",
	"weapon_usp", "weapon_glock18", "weapon_awp", "weapon_mp5navy",
	"weapon_m249", "weapon_m3", "weapon_m4a1", "weapon_tmp", "weapon_g3sg1",
	"weapon_flashbang", "weapon_deagle", "weapon_sg552", "weapon_ak47",
	"weapon_knife", "weapon_p90"
}

new const g_szWeaponNames[MAX_WEAPON + 1][] =
{
	"", "P228", "", "Schmidt Scout", "", "XM1014 (Auto-Shotgun)", "",
	"Mac-10", "AUG", "", "Dual Elites", "Five-Seven", "UMP-45", "SG-550",
	"Galil", "Famas", "USP", "Glock-18", "AWP", "MP5-Navy", "M249 (Para)",
	"M3 (Pump-Shotgun)", "M4A1", "TMP", "G3SG1", "", "Deagle", "SG-552",
	"AK-47", "", "P90"
}

new const g_weapon_commands[][] = 
{
    "usp", "glock", "deagle", "p228", "elites","fn57", "m3", "xm1014", "mp5", "tmp", "p90",
    "mac10", "ump45", "ak47", "galil", "famas","sg552", "m4a1", "aug", "scout", "awp", "g3sg1",
    "sg550", "m249", "vest", "vesthelm", "flash","hegren", "sgren", "defuser", "nvgs", "shield",
    "primammo", "secammo", "km45", "9x19mm", "nighthawk","228compact", "fiveseven", "12gauge", "autoshotgun",
    "mp", "c90", "cv47", "defender", "clarion", "krieg552","bullpup", "magnum", "d3au1", "krieg550"
}

new const g_block_commands[][] = 
{
    "chooseteam", "buy", "buyammo1", "buyammo2", "buyequip",
    "cl_autobuy", "cl_rebuy", "cl_setautobuy", "cl_setrebuy"
}

new g_StatusIcon
new g_hWeaponMenu
new g_hPrimaryWeaponMenu
new g_hSecondaryWeaponMenu
new bool:g_bRememberGuns[33]
new g_iPrimaryWeapon[33];
new g_iSecondaryWeapon[33];

public plugin_init()
{
	register_plugin("Furien Gameplay", "1.0", "cyby")
	
	register_event("CurWeapon", "arma_curenta", "be", "1=1")
	RegisterHam(Ham_Spawn, "player", "spawn_post", 1)
	register_event("DeathMsg", "death_event", "a")
	//Extras din zp
	RegisterHam(Ham_Touch, "weaponbox", "TouchWeapon")
	RegisterHam(Ham_Touch, "armoury_entity", "TouchWeapon")
	RegisterHam(Ham_Touch, "weapon_shield", "TouchWeapon")
	GunsMenu()
	
	g_StatusIcon = get_user_msgid("StatusIcon")
	register_message(g_StatusIcon, "MsgStatusIcon")
    
	for(new i = 0; i < sizeof(g_block_commands) ; i++) 
		register_clcmd(g_block_commands, "BlockCmd")
	
	register_clcmd("say /guns", "CmdEnableGuns")
}

public arma_curenta(id)
{
	if(!is_user_connected(id))
		return
		
	if(get_user_team(id) == 1)
	{
		if(get_user_flags(id) & VIP)
			set_pev(id, pev_maxspeed, 600.0)
		else
			set_pev(id, pev_maxspeed, 500.0)
	}
}

public client_command(id) 
{ 
	new sArg[13]
	if(read_argv(0, sArg, 12) > 11)
		return PLUGIN_CONTINUE
	for(new i = 0; i < sizeof(g_weapon_commands); i++)
	{
		if(equali(g_weapon_commands, sArg, 0))
			return PLUGIN_HANDLED
	}
	return PLUGIN_CONTINUE
}

public spawn_post(id)
{
	if(!is_user_connected(id) || !is_user_alive(id))
		return
		
	switch(get_user_team(id))
	{
		case 1:
		{
			if(get_user_flags(id) & VIP)
				set_pev(id, pev_health, 600.0)
			else
				set_pev(id, pev_health, 400.0)
			set_pev(id, pev_armorvalue, 400.0)
			set_task(0.05, "give_weapon", id)
		}
		case 2:
		{
			if(get_user_flags(id) & VIP)
				set_pev(id, pev_health, 250.0)
			else
				set_pev(id, pev_health, 150.0)
				
			if(g_bRememberGuns[id])
				GiveWeapons(id)
			else if(g_iPrimaryWeapon[id] == 0 || g_iSecondaryWeapon[id] == 0)
			{
				menu_display(id, g_hPrimaryWeaponMenu)
			}
			else menu_display(id, g_hWeaponMenu)
		}
	}
}

public give_weapon(id)
{
	fm_strip_user_weapons(id)
	give_item(id, "weapon_knife")
}

public death_event()
{
	new attacker, victim;
	attacker = read_data(1)
	victim = read_data(2)
	if(victim == attacker || !is_user_connected(victim) || !is_user_connected(attacker))
		return
		
	switch(get_user_team(victim))
	{
		case 1:
		{
			if(cs_get_user_money(attacker) + 4000 > 16000)
				cs_set_user_money(attacker, 16000)
			else
				cs_set_user_money(attacker, cs_get_user_money(attacker) + 4000)
		}
		case 2:
		{
			if(cs_get_user_money(attacker) + 5000 > 16000)
				cs_set_user_money(attacker, 16000)
			else
				cs_set_user_money(attacker, cs_get_user_money(attacker) + 5000)
		}
	}
}

// Extras din ZP
public TouchWeapon(weapon, id)
{
	if(!is_user_connected(id))
		return HAM_IGNORED
	
	if(get_user_team(id) == 1)
		return HAM_SUPERCEDE
	
	return HAM_IGNORED
}

public BlockCmd(id)
{
	return PLUGIN_HANDLED 
}

public MsgStatusIcon(Msgid, Dest, id)
{
	new szBuyzoneIcon[8]
	get_msg_arg_string(2, szBuyzoneIcon, 7)

	if(equal(szBuyzoneIcon, "buyzone"))
	{
		return PLUGIN_HANDLED
	}
	return PLUGIN_CONTINUE
}  

// De aici nu mai apartine de mine.
public CmdEnableGuns(id)
{
	if(g_bRememberGuns[id])
	{
		color(id, ".v[FURIEN].g Meniul tau pentru arme este din nou.e activ.g.")
		g_bRememberGuns[id] = false
	}
	else
		color(id, ".v[FURIEN].g Meniul tau pentru arme este deja.e activat.g.")
}
	
public client_putinserver(id)
{
	g_bRememberGuns[id] = false
	g_iPrimaryWeapon[id] = 0
	g_iSecondaryWeapon[id] = 0
}

public GunsMenu()
{
	g_hWeaponMenu = menu_create("\ySelecteaza optiunea\w", "WeaponMainMenu_Handler")
	menu_additem(g_hWeaponMenu, "\rArme noi\w", "0")
	menu_additem(g_hWeaponMenu, "\rArmele precedente\w", "1")
	menu_additem(g_hWeaponMenu, "\rArmele precedente + neafisarea meniului\w", "2")
		
	g_hPrimaryWeaponMenu = menu_create("\yMeniul cu arme^nSelecteaza arma primara:\w", "PrimaryWeapons_Handler")
	g_hSecondaryWeaponMenu = menu_create("\yMeniul cu arme^nSelecteaza arma secundara:\w", "SecondaryWeapons_Handler")
	
	new szInfo[3]
	for(new i = MIN_WEAPON; i <= MAX_WEAPON; i++)
	{
		if(IsPrimaryWeapon(i))
		{
			num_to_str(i, szInfo, charsmax(szInfo))
			menu_additem(g_hPrimaryWeaponMenu, g_szWeaponNames, szInfo)
		}
		else if(IsSecondaryWeapon(i))
		{
			num_to_str(i, szInfo, charsmax(szInfo))
			menu_additem(g_hSecondaryWeaponMenu, g_szWeaponNames, szInfo)
		}
		else continue;
	}
}

public WeaponMainMenu_Handler(id, hMenu, iItem)
{
	switch(iItem)
	{
		case 0: menu_display(id, g_hPrimaryWeaponMenu, 0)
		case 1: 
		{
			GiveWeapons(id)
		}
			
		case 2: 
		{
			GiveWeapons(id)
			g_bRememberGuns[id] = true
			color(id, ".v[FURIEN].g Meniul a fost dezactivat. Runda viitoare nu-ti mai apare meniul si auto-selecteaza armele precedente.")
		}
	}
}

public PrimaryWeapons_Handler(id, hMenu, iItem)
{
	if(iItem == MENU_EXIT)
	{	
		menu_destroy(hMenu)
		return PLUGIN_HANDLED
	}
	
	new iAccess, hCallback
	new szData[6]
	menu_item_getinfo(hMenu, iItem, iAccess, szData, charsmax(szData), _, _, hCallback)
	g_iPrimaryWeapon[id] = str_to_num(szData)
	menu_display(id, g_hSecondaryWeaponMenu, 0)
	return PLUGIN_HANDLED
}

public SecondaryWeapons_Handler(id, hMenu, iItem)
{
	if(iItem == MENU_EXIT)
	{
		menu_destroy(hMenu)
		return PLUGIN_HANDLED
	}
	new iAccess, hCallback
	new szData[6]
	menu_item_getinfo(hMenu, iItem, iAccess, szData, charsmax(szData), _, _, hCallback)
	g_iSecondaryWeapon[id] = str_to_num(szData)
	GiveWeapons(id)
	return PLUGIN_HANDLED
}

GiveWeapons(id)
{
	new iPrimary = g_iPrimaryWeapon[id]
	new iSecondary = g_iSecondaryWeapon[id]
	give_item(id, g_szWeaponClassnames[iPrimary])
	give_item(id, g_szWeaponClassnames[iSecondary])
	cs_set_user_bpammo(id, iPrimary, g_iMaxBPAmmo[iPrimary])
	cs_set_user_bpammo(id, iSecondary, g_iMaxBPAmmo[iSecondary])
}

stock color(const id, const input[], any:...)
{
	new count = 1, players[32]
	static msg[191]
	vformat(msg, 190, input, 3)
	
	replace_all(msg, 190, ".v", "^4")
	replace_all(msg, 190, ".g", "^1")
	replace_all(msg, 190, ".e", "^3")
	
	if (id) players[0] = id;
	else get_players(players, count, "ch")
	{
		for (new i = 0; i < count; i++)
		{
			if (is_user_connected(players))
			{
				message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players)
				write_byte(players)
				write_string(msg)
				message_end()
			}
		}
	}
}

stock fm_strip_user_weapons(index)
{
	new iEnt = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "player_weaponstrip"))
	
	if(!pev_valid(iEnt))
		return 0;

	dllfunc(DLLFunc_Spawn, iEnt)
	dllfunc(DLLFunc_Use, iEnt, index)
	engfunc(EngFunc_RemoveEntity, iEnt)
	
	return 1;
}
89.34.25.17:27015 - XMAS MOD
89.34.25.38:27015 - XMAS MOD
User avatar
Mădălin
Fost moderator
Fost moderator
Posts: 4938
Joined: 06 Mar 2013, 21:40
Detinator Steam: Nu
Reputatie: Fost Administrator
Fost manager cs.extream.ro
Has thanked: 17 times
Been thanked: 240 times
Contact:

18 Dec 2013, 12:15

www.phpbb-themes.com - custom designs
Locked

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 15 guests