Cerere Plugin Furien shop

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 .
User avatar
DaNNe.
Fost moderator
Fost moderator
Posts: 2808
Joined: 08 Nov 2013, 20:43
Detinator Steam: Da
CS Status: Activitate scăzută
SteamID: /id/FurienMaster
Reputatie: Nick anterior: DnD. Gold, Emrys
0.5/3
Fost moderator ajutator
Fost Membru Club eXtreamCS (doua luni)
Has thanked: 230 times
Been thanked: 128 times
Contact:

22 Dec 2013, 15:30

scosmynnnn wrote:Ce e ala helmet ? =))
Casca. Pune doar armura ca e bine.
Contact: Activitate scazuta.
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

22 Dec 2013, 15:33

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

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

#pragma semicolon 1

new const sKnife[66] = "models/superknife/v_knife.mdl";

new bool:g_bKnife[33];

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR);
	
	register_event("CurWeapon", "evCurweapon", "be", "1=1");
	register_logevent("round_start", 2, "1=Round_Start");
	
	register_clcmd("say /shop","cmdShop");
}
public cmdShop(id)
{
	if(get_user_team(id) == 1 && is_user_alive(id))
	{
		set_task(0.1,"shopf",id);
	}
	if(get_user_team(id) == 2 && is_user_alive(id))
	{
		set_task(0.1,"shopct",id);
	}
}
public shopf(id)
{
	static menu;
	menu = menu_create ("\yShop \rFurieni","furien_menu");
	
	menu_additem ( menu,"\w SuperKnife\y[\r10000$\y]","1", 0 );
	menu_additem ( menu,"\w HeGrenade\y[\r3000$\y]","2", 0 );
	menu_additem ( menu,"\w +50 HP/y[\r3000$\y]","3", 0 );
	menu_additem ( menu,"\w +50 AP+Helmet\y[\r500$\y]","4", 0 );
	
	menu_setprop ( menu, MPROP_NUMBER_COLOR,"\y");
	menu_setprop ( menu, MPROP_EXIT, MEXIT_ALL );
	
	menu_display ( id, menu, 0 );
	return 0;
}

public furien_menu ( id, menu, item )
{
	if ( item == MENU_EXIT )
	{
		menu_destroy ( menu );
		return 1;
	}
	
	new data [ 6 ], szName [ 64 ];
	new access, callback;
	
	menu_item_getinfo ( menu, item, access, data, charsmax ( data ), szName, charsmax ( szName ), callback );
	
	new key = str_to_num ( data );
	
	switch ( key )
	{
		case 1:
		{
			if(cs_get_user_money(id) >= 10000)
			{
				g_bKnife[id] = true;
				cs_set_user_money(id, cs_get_user_money(id) - 10000);
			}
			else
			{
				client_print(id, print_chat, "Nu ai suficienti bani !");
				return 1;
			}
		}
		case 2:
		{
			if(cs_get_user_money(id) >= 3000)
			{
				give_item ( id,"weapon_hegrenade" );
				cs_set_user_money(id, cs_get_user_money(id) - 3000);
			}
			else
			{
				client_print(id, print_chat, "Nu ai suficienti bani !");
				return 1;
			}
		}
		case 3:
		{
			if(cs_get_user_money(id) >= 3000)
			{
				set_user_health(id, get_user_health(id) + 50);
				cs_set_user_money(id, cs_get_user_money(id) - 3000);
			}
			else
			{
				client_print(id, print_chat, "Nu ai suficienti bani !");
				return 1;
			}
		}
		case 4:
		{
			if(cs_get_user_money(id) >= 500)
			{
				set_user_armor(id, get_user_armor(id) + 50);
				give_item(id, "item_assaultsuit");
				cs_set_user_money(id, cs_get_user_money(id) - 500);
			}
			else
			{
				client_print(id, print_chat, "Nu ai suficienti bani !");
				return 1;
			}
		}
	}
	menu_destroy ( menu );
	return 1;
}
public shopct( id )
{
	static menu;
	menu = menu_create ("\yShop \rFurieni","anti_menu");
	
	menu_additem ( menu,"\w DefuseKit\y[\r500$\y]","1", 0 );
	menu_additem ( menu,"\w HeGrenade\y[\r6000$\y]","2", 0 );
	menu_additem ( menu,"\w +50 HP\y[\r3000$\y]","3", 0 );
	menu_additem ( menu,"\w +50 AP+Helmet\y[\r500$\y]","4", 0 );
	
	menu_setprop ( menu, MPROP_NUMBER_COLOR,"\y");
	menu_setprop ( menu, MPROP_EXIT, MEXIT_ALL );
	
	menu_display ( id, menu, 0 );
	return 0;
}

public anti_menu ( id, menu, item )
{
	if ( item == MENU_EXIT )
	{
		menu_destroy ( menu );
		return 1;
	}
	
	new data [ 6 ], szName [ 64 ];
	new access, callback;
	
	menu_item_getinfo ( menu, item, access, data, charsmax ( data ), szName, charsmax ( szName ), callback );
	
	new key = str_to_num ( data );
	
	switch ( key )
	{
		case 1:
		{
			if(cs_get_user_money(id) >= 500)
			{
				give_item(id, "item_thighpack");
				cs_set_user_money(id, cs_get_user_money(id) - 500);
			}
			else
			{
				client_print(id, print_chat, "Nu ai suficienti bani !");
				return 1;
			}
		}
		case 2:
		{
			if(cs_get_user_money(id) >= 6000)
			{
				give_item ( id,"weapon_hegrenade" );
				cs_set_user_money(id, cs_get_user_money(id) - 6000);
			}
			else
			{
				client_print(id, print_chat, "Nu ai suficienti bani !");
				return 1;
			}
		}
		case 3:
		{
			if(cs_get_user_money(id) >= 3000)
			{
				set_user_health(id, get_user_health(id) + 50);
				cs_set_user_money(id, cs_get_user_money(id) - 3000);
			}
			else
			{
				client_print(id, print_chat, "Nu ai suficienti bani !");
				return 1;
			}
		}
		case 4:
		{
			if(cs_get_user_money(id) >= 500)
			{
				set_user_armor(id, get_user_armor(id) + 50);
				give_item(id, "item_assaultsuit");
				cs_set_user_money(id, cs_get_user_money(id) - 500);
			}
			else
			{
				client_print(id, print_chat, "Nu ai suficienti bani !");
				return 1;
			}
		}
	}
	menu_destroy ( menu );
	return 1;
}
public evCurweapon(id)
{
	if(g_bKnife[id])
	{
		if(get_user_weapon(id) == CSW_KNIFE)
		{
			set_pev(id, pev_viewmodel2, sKnife);
		}
	}
}
public round_start( )
{
	new iPlayers[32], iNum;
	get_players(iPlayers, iNum);
	for(new i = 0; i < iNum; i++)
	{
		g_bKnife[ iPlayers[ i ] ] = false;
	}
}
public client_disconnect(id)
	g_bKnife[id] = false;
	
public client_putinsevrer(id)
	g_bKnife[id] = false;
	
public plugin_precache()
{
	precache_model(sKnife);
}
La superknife il faci tu.. adica iti adaugi tu modelul ;)

il adaugi in models,faci un folder cu numele superknife si in superknife adaugi v_knife.mdl.

EDIT1: Stai asa ca am uitat sa iti multiplic damage-ul la knife..revin.
User avatar
EuSemakka
Membru, skill +1
Membru, skill +1
Posts: 301
Joined: 26 Nov 2013, 17:40
Detinator Steam: Da
Detinator server CS: Furien.FaraLaG.Ro
Has thanked: 38 times
Been thanked: 7 times

22 Dec 2013, 15:58

Merge Shopul da la tero numi arata lama... e doar mana goala.... :|
cand apas pe 123 e doar tinta... si mana goala..
Last edited by EuSemakka on 22 Dec 2013, 16:00, edited 1 time in total.
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

22 Dec 2013, 16:00

Pai ai adaugat knife ? :)) ca trebuie sa faci cum ti-am spus eu mai sus..altfel nu are cum sa mearga,ia pune modelele aici sa vad ce ai tu,ca ti-am facut doar la V
User avatar
EuSemakka
Membru, skill +1
Membru, skill +1
Posts: 301
Joined: 26 Nov 2013, 17:40
Detinator Steam: Da
Detinator server CS: Furien.FaraLaG.Ro
Has thanked: 38 times
Been thanked: 7 times

22 Dec 2013, 16:07

Am adaugat tot....la t imi arata doar bomba in mana si dupa ce o plantez imi arata doar tinta si nu merge niciun bind...
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

22 Dec 2013, 16:08

Stai asa ca iti pun eu un model,il si testez.
User avatar
Adventx
Membru, skill +4
Membru, skill +4
Posts: 1785
Joined: 17 Sep 2013, 20:44
Detinator Steam: Da
Reputatie: Fost moderator ajutator
Has thanked: 125 times
Been thanked: 142 times
Contact:

22 Dec 2013, 16:12

Foloseste modul ala de mau sus care ti l-am dat, asta e shopul default, si o sa merga tot cum trebue, uite in folderul furien/items/weapons.ini setezi "weapon_knife" "3" de aia nu iti apare knife ;)
User avatar
EuSemakka
Membru, skill +1
Membru, skill +1
Posts: 301
Joined: 26 Nov 2013, 17:40
Detinator Steam: Da
Detinator server CS: Furien.FaraLaG.Ro
Has thanked: 38 times
Been thanked: 7 times

22 Dec 2013, 16:15

adventx wrote:Foloseste modul ala de mau sus care ti l-am dat, asta e shopul default, si o sa merga tot cum trebue, uite in folderul furien/items/weapons.ini setezi "weapon_knife" "3" de aia nu iti apare knife ;)
Numi place cum arata shopul ala... am incercat si asa si tot nu merge
Last edited by EuSemakka on 22 Dec 2013, 16:32, edited 1 time in total.
User avatar
Adventx
Membru, skill +4
Membru, skill +4
Posts: 1785
Joined: 17 Sep 2013, 20:44
Detinator Steam: Da
Reputatie: Fost moderator ajutator
Has thanked: 125 times
Been thanked: 142 times
Contact:

22 Dec 2013, 16:16

macar ai vazut cum e shopul?
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:

22 Dec 2013, 16:17

| Afiseaza codul
#include <amxmodx>
#include <cstrike>
#include <fakemeta_util>
#include <fun>
#include <hamsandwich>
#include <colorchat>

#define PLUGIN "Jail Break Shop"
#define VERSION "1.0"
#define AUTHOR "GhosT"

new const szPrefix[] = "[SHOP]"
new const sk_model[66] = "models/v_super_knife.mdl"

new bool:SK[32];

public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	register_clcmd("say /shop", "shop")
	register_clcmd("say_team /shop", "shop")
	register_clcmd("say shop", "shop")
	register_clcmd("say_team shop", "shop")
	register_concmd("shop", "shop")
	
	register_event("CurWeapon", "CurWeap", "be", "1=1");
	RegisterHam(Ham_TakeDamage, "player", "SK_Damage");
}
public plugin_precache()
{
	precache_model(sk_model)
}
public client_putinserver(id)
{
	SK[id] = false
}
public client_disconnect(id)
{
	client_putinserver(id)
}
public shop(id)
{
	if(get_user_team(id) == 1)
	{
		shop_te(id)
	}
	if(get_user_team(id) == 2)
	{
		shop_ct(id)
	}
	if(!is_user_alive(id))
	{
		ColorChat(id, GREEN, "%s^x03 Nu poti folosi shop-l cand esti mort !", szPrefix)
		return 1
	}
	return 1
}
public shop_te(id)
{
	new menu = menu_create("\yFurien Shop", "give_te")
	
	menu_additem(menu, "Super Knife		\y$10000", "1", 0)
	menu_additem(menu, "He Grenade		\y$3000", "2", 0)
	menu_additem(menu, "50 HP		\y$3000", "3", 0)
	menu_additem(menu, "50 AP + Halmet	\y$500", "4", 0)
	
	menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
	menu_display(id, menu, 0)
}
public shop_ct(id)
{
	new menu = menu_create("\yAnti-Furien Shop", "give_ct")
	
	menu_additem(menu, "He Grenade		\y$6000", "1", 0)
	menu_additem(menu, "Defuse Kit		\y$500", "2", 0)
	menu_additem(menu, "50 HP		\y$3000", "3", 0)
	menu_additem(menu, "50 AP + Halmet	\y$500", "4", 0)
	
	menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
	menu_display(id, menu, 0)
}
public give_te(id, item, menu)
{
	if(item == MEXIT_ALL)
	{
		return 1;
	}
	new iMoney = cs_get_user_money(id)
	new access, callback, data[6], szName[64];
	
	menu_item_getinfo(menu, item, access, data,charsmax(data), szName,charsmax(szName), callback);
	new key = str_to_num(data)
	
	switch(key)
	{
		case 1:
		{
			if(iMoney < 10000)
			{
				ColorChat(id, GREEN, "%s^x03 Nu poti cumpara acest item din lipsa de bani !", szPrefix)
				return 1;
			}
			else
			{
				ColorChat(id, GREEN, "%s^x03 Ai cumparat^x04 Super Knife^x03 !", szPrefix)
				cs_set_user_money(id, iMoney - 10000)
				SK[id] = true;
				CurWeap(id)
				return 1;
			}
		}
		case 2:
		{
			if(iMoney  < 3000)
			{
				ColorChat(id, GREEN, "%s^x03 Nu poti cumpara acest item din lipsa de bani !", szPrefix)
				return 1;
			}
			else
			{
				ColorChat(id, GREEN, "%s^x03 Ai cumparat^x04 He Grenade^x03 !", szPrefix)
				cs_set_user_money(id, iMoney - 3000)
				give_item(id, "weapon_hegrenade")
				return 1;
			}
		}
		case 3:
		{
			new iHealth = get_user_health(id)
			if(iMoney < 3000)
			{
				ColorChat(id, GREEN, "%s^x03 Nu poti cumpara acest item din lipsa de bani !", szPrefix)
				return 1;
			}
			else
			{
				ColorChat(id, GREEN, "%s^x03 Ai cumparat^x04 50 HP^x03 !", szPrefix)
				cs_set_user_money(id, iMoney - 3000)
				set_user_health(id, iHealth + 50)
				if(iHealth > 200)
				{
					ColorChat(id, GREEN, "%s^x03 Nu mai poti cumpara Health , ai atins limita maxima !", szPrefix)
					return 1;
				}
				return 1;
			}
		}
		case 4:
		{
			new iArmor = get_user_armor(id)
			if(iMoney < 500)
			{
				ColorChat(id, GREEN, "%s^x03 Nu poti cumpara acest item din lipsa de bani !", szPrefix)
				return 1;
			}
			else
			{
				ColorChat(id, GREEN, "%s^x03 Ai cumparat^x04 50 AP^x03 !", szPrefix)
				cs_set_user_money(id, iMoney - 500)
				set_user_armor(id, iArmor + 50)
				give_item(id, "item_assaultsuit");
				if(iArmor > 500)
				{
					ColorChat(id, GREEN, "%s^x03 Nu mai poti cumpara Armor , ai atins limita maxima !", szPrefix)
					return 1;
				}	
				return 1;
			}
		}
	}
	menu_destroy(menu)
	return 1;
}
public give_ct(id, item, menu)
{
	if(item == MEXIT_ALL)
	{
		return 1;
	}
	new iMoney = cs_get_user_money(id)
	new access, callback, data[6], szName[64];
	
	menu_item_getinfo(menu, item, access, data,charsmax(data), szName,charsmax(szName), callback);
	new key = str_to_num(data)
	
	switch(key)
	{
		case 1:
		{
			if(iMoney < 6000)
			{
				ColorChat(id, GREEN, "%s^x03 Nu poti cumpara acest item din lipsa de bani !", szPrefix)
				return 1;
			}
			else
			{
				ColorChat(id, GREEN, "%s^x03 Ai cumparat^x04 He Grenade^x03 !", szPrefix)
				cs_set_user_money(id, iMoney - 6000)
				give_item(id, "weapon_hegrenade")
				return 1;
			}
		}
		case 2:
		{
			if(iMoney < 500)
			{
				ColorChat(id, GREEN, "%s^x03 Nu poti cumpara acest item din lipsa de bani !", szPrefix)
				return 1;
			}
			else
			{
				ColorChat(id, GREEN, "%s^x03 Ai cumparat^x04 Defuse Kit^x03 !", szPrefix)
				cs_set_user_money(id, iMoney - 500)
				give_item(id, "item_thighpack")
				return 1;
			}
		}
		case 3:
		{
			new iHealth = get_user_health(id)
			if(iMoney < 3000)
			{
				ColorChat(id, GREEN, "%s^x03 Nu poti cumpara acest item din lipsa de bani !", szPrefix)
				return 1;
			}
			else
			{
				ColorChat(id, GREEN, "%s^x03 Ai cumparat^x04 50 HP^x03 !", szPrefix)
				cs_set_user_money(id, iMoney - 3000)
				set_user_health(id, iHealth + 50)
				if(iHealth > 200)
				{
					ColorChat(id, GREEN, "%s^x03 Nu mai poti cumpara Health , ai atins limita maxima !", szPrefix)
					return 1;
				}
				return 1;
			}
		}
		case 4:
		{
			new iArmor = get_user_armor(id)
			if(iMoney < 500)
			{
				ColorChat(id, GREEN, "%s^x03 Nu poti cumpara acest item din lipsa de bani !", szPrefix)
				return 1;
			}
			else
			{
				ColorChat(id, GREEN, "%s^x03 Ai cumparat^x04 50 AP^x03 !", szPrefix)
				cs_set_user_money(id, iMoney - 500)
				set_user_armor(id, iArmor + 50)
				give_item(id, "item_assaultsuit");
				if(iArmor > 500)
				{
					ColorChat(id, GREEN, "%s^x03 Nu mai poti cumpara Armor , ai atins limita maxima !", szPrefix)
					return 1;
				}
				return 1;
			}
		}
	}
	menu_destroy(menu)
	return 1;
}
public CurWeap(id)
{
	if(get_user_weapon(id) == CSW_KNIFE && SK[id])
	{
		set_pev(id, pev_viewmodel2, sk_model)
	}
}
public SK_Damage(iVictim, iInflictor, iAttacker, Float:fDamage, iDamageBits)
{
	if(get_user_weapon(iAttacker) == CSW_KNIFE && SK[iAttacker])
	{
		SetHamParamFloat( 4, fDamage * 2.5);
		return HAM_HANDLED;
	}
	return HAM_IGNORED;
}
Daca nu ai rezolvat ... :-"

Daca vrei cu tot cu modele da click aici ==> http://www.girlshare.ro/33093428.5
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

22 Dec 2013, 16:31

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

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

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

new g_iMaxPlayers;

#pragma semicolon 1

new const vKnife[66] = "models/superknife/v_super_knife1.mdl";
new const pKnife[66] = "models/superknife/p_super_knife1.mdl";

new bool:g_bKnife[33];

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR);
	
	register_event("CurWeapon", "evCurweapon", "be", "1=1");
	register_logevent("round_start", 2, "1=Round_Start");
	
	register_clcmd("say /shop","cmdShop");
	
	RegisterHam ( Ham_TakeDamage, "player", "fwd_takedamage" );
	g_iMaxPlayers = get_maxplayers ( );
}
public cmdShop(id)
{
	if(get_user_team(id) == 1 && is_user_alive(id))
	{
		set_task(0.1,"shopf",id);
	}
	if(get_user_team(id) == 2 && is_user_alive(id))
	{
		set_task(0.1,"shopct",id);
	}
}
public shopf(id)
{
	static menu;
	menu = menu_create ("\yShop \rFurieni","furien_menu");
	
	menu_additem ( menu,"\w SuperKnife\y[\r10000$\y]","1", 0 );
	menu_additem ( menu,"\w HeGrenade\y[\r3000$\y]","2", 0 );
	menu_additem ( menu,"\w +50 HP\y[\r3000$\y]","3", 0 );
	menu_additem ( menu,"\w +50 AP+Helmet\y[\r500$\y]","4", 0 );
	
	menu_setprop ( menu, MPROP_NUMBER_COLOR,"\y");
	menu_setprop ( menu, MPROP_EXIT, MEXIT_ALL );
	
	menu_display ( id, menu, 0 );
	return 0;
}

public furien_menu ( id, menu, item )
{
	if ( item == MENU_EXIT )
	{
		menu_destroy ( menu );
		return 1;
	}
	
	new data [ 6 ], szName [ 64 ];
	new access, callback;
	
	menu_item_getinfo ( menu, item, access, data, charsmax ( data ), szName, charsmax ( szName ), callback );
	
	new key = str_to_num ( data );
	
	switch ( key )
	{
		case 1:
		{
			if(cs_get_user_money(id) >= 10000)
			{
				g_bKnife[id] = true;
				cs_set_user_money(id, cs_get_user_money(id) - 10000);
			}
			else
			{
				client_print(id, print_chat, "Nu ai suficienti bani !");
				return 1;
			}
		}
		case 2:
		{
			if(cs_get_user_money(id) >= 3000)
			{
				give_item ( id,"weapon_hegrenade" );
				cs_set_user_money(id, cs_get_user_money(id) - 3000);
			}
			else
			{
				client_print(id, print_chat, "Nu ai suficienti bani !");
				return 1;
			}
		}
		case 3:
		{
			if(cs_get_user_money(id) >= 3000)
			{
				set_user_health(id, get_user_health(id) + 50);
				cs_set_user_money(id, cs_get_user_money(id) - 3000);
			}
			else
			{
				client_print(id, print_chat, "Nu ai suficienti bani !");
				return 1;
			}
		}
		case 4:
		{
			if(cs_get_user_money(id) >= 500)
			{
				set_user_armor(id, get_user_armor(id) + 50);
				give_item(id, "item_assaultsuit");
				cs_set_user_money(id, cs_get_user_money(id) - 500);
			}
			else
			{
				client_print(id, print_chat, "Nu ai suficienti bani !");
				return 1;
			}
		}
	}
	menu_destroy ( menu );
	return 1;
}
public shopct( id )
{
	static menu;
	menu = menu_create ("\yShop \rFurieni","anti_menu");
	
	menu_additem ( menu,"\w DefuseKit\y[\r500$\y]","1", 0 );
	menu_additem ( menu,"\w HeGrenade\y[\r6000$\y]","2", 0 );
	menu_additem ( menu,"\w +50 HP\y[\r3000$\y]","3", 0 );
	menu_additem ( menu,"\w +50 AP+Helmet\y[\r500$\y]","4", 0 );
	
	menu_setprop ( menu, MPROP_NUMBER_COLOR,"\y");
	menu_setprop ( menu, MPROP_EXIT, MEXIT_ALL );
	
	menu_display ( id, menu, 0 );
	return 0;
}

public anti_menu ( id, menu, item )
{
	if ( item == MENU_EXIT )
	{
		menu_destroy ( menu );
		return 1;
	}
	
	new data [ 6 ], szName [ 64 ];
	new access, callback;
	
	menu_item_getinfo ( menu, item, access, data, charsmax ( data ), szName, charsmax ( szName ), callback );
	
	new key = str_to_num ( data );
	
	switch ( key )
	{
		case 1:
		{
			if(cs_get_user_money(id) >= 500)
			{
				give_item(id, "item_thighpack");
				cs_set_user_money(id, cs_get_user_money(id) - 500);
			}
			else
			{
				client_print(id, print_chat, "Nu ai suficienti bani !");
				return 1;
			}
		}
		case 2:
		{
			if(cs_get_user_money(id) >= 6000)
			{
				give_item ( id,"weapon_hegrenade" );
				cs_set_user_money(id, cs_get_user_money(id) - 6000);
			}
			else
			{
				client_print(id, print_chat, "Nu ai suficienti bani !");
				return 1;
			}
		}
		case 3:
		{
			if(cs_get_user_money(id) >= 3000)
			{
				set_user_health(id, get_user_health(id) + 50);
				cs_set_user_money(id, cs_get_user_money(id) - 3000);
			}
			else
			{
				client_print(id, print_chat, "Nu ai suficienti bani !");
				return 1;
			}
		}
		case 4:
		{
			if(cs_get_user_money(id) >= 500)
			{
				set_user_armor(id, get_user_armor(id) + 50);
				give_item(id, "item_assaultsuit");
				cs_set_user_money(id, cs_get_user_money(id) - 500);
			}
			else
			{
				client_print(id, print_chat, "Nu ai suficienti bani !");
				return 1;
			}
		}
	}
	menu_destroy ( menu );
	return 1;
}
public evCurweapon(id)
{
	if(get_user_weapon(id) == CSW_KNIFE && g_bKnife[id])
	{
		set_pev(id, pev_viewmodel2, vKnife);
		set_pev(id, pev_weaponmodel2, pKnife);
	}
}
public round_start( )
{
	new iPlayers[32], iNum;
	get_players(iPlayers, iNum);
	for(new i = 0; i < iNum; i++)
	{
		g_bKnife[ iPlayers[ i ] ] = false;
	}
}
public fwd_takedamage( iVictim, iInflictor, iAttacker, Float:fDamage )
{
	if ( iInflictor == iAttacker && IsPlayer ( iAttacker ) && get_user_weapon( iAttacker ) == CSW_KNIFE && g_bKnife[ iAttacker ])
	{
		SetHamParamFloat ( 4, fDamage * 2.0 );
		return HAM_HANDLED;
	}
	return HAM_IGNORED;
}
public client_disconnect(id)
	g_bKnife[id] = false;

public client_putinsevrer(id)
	g_bKnife[id] = false;

public plugin_precache()
{
	precache_model(vKnife);
	precache_model(pKnife);
}
Models: http://www32.zippyshare.com/v/61243391/file.html

Am testat,merge 100%

EDIT1: Asta e putin mai frumos la aspect,cand nu are bani de acel item ii apare in meniu ca nu are bani !
| Afiseaza codul
#include <amxmodx>
#include <fun>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>

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

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

new g_iMaxPlayers;

#pragma semicolon 1

new const vKnife[66] = "models/superknife/v_super_knife1.mdl";
new const pKnife[66] = "models/superknife/p_super_knife1.mdl";

new bool:g_bKnife[33];

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR);
	
	register_event("CurWeapon", "evCurweapon", "be", "1=1");
	register_logevent("round_start", 2, "1=Round_Start");
	
	register_clcmd("say /shop","cmdShop");
	
	RegisterHam ( Ham_TakeDamage, "player", "fwd_takedamage" );
	g_iMaxPlayers = get_maxplayers ( );
}
public cmdShop(id)
{
	if(get_user_team(id) == 1 && is_user_alive(id))
	{
		set_task(0.1,"shopf",id);
	}
	if(get_user_team(id) == 2 && is_user_alive(id))
	{
		set_task(0.1,"shopct",id);
	}
}
public shopf(id)
{
	static menu;
	menu = menu_create ("\yShop \rFurieni","furien_menu");
	
	if(cs_get_user_money(id) >= 10000)
	{
		menu_additem ( menu,"\w SuperKnife\y[\r10000$\y]","1", 0 );
	}
	else
	{
	menu_additem ( menu,"\w SuperKnife\y[\rNO MONEY\y]","1", 0 );
	}
	
	if(cs_get_user_money(id) >= 3000)
	{
		menu_additem ( menu,"\w HeGrenade\y[\r3000$\y]","2", 0 );
	}
	else
	{
		menu_additem ( menu,"\w HeGrenade\y[\rNO MONEY\y]","2", 0 );
	}
	
	if(cs_get_user_money(id) >= 3000)
	{
	menu_additem ( menu,"\w +50 HP\y[\r3000$\y]","3", 0 );
	}
	else
	{
		menu_additem ( menu,"\w +50 HP\y[\rNO MONEY\y]","3", 0 );
	}
	
	if(cs_get_user_money(id) >= 3000)
	{
	menu_additem ( menu,"\w +50 AP+Helmet\y[\r500$\y]","4", 0 );
	}
	else
	{
	menu_additem ( menu,"\w +50 AP+Helmet\y[\rNO MONEY\y]","4", 0 );
	}
	
	menu_setprop ( menu, MPROP_NUMBER_COLOR,"\y");
	menu_setprop ( menu, MPROP_EXIT, MEXIT_ALL );
	
	menu_display ( id, menu, 0 );
	return 0;
}

public furien_menu ( id, menu, item )
{
	if ( item == MENU_EXIT )
	{
		menu_destroy ( menu );
		return 1;
	}
	
	new data [ 6 ], szName [ 64 ];
	new access, callback;
	
	menu_item_getinfo ( menu, item, access, data, charsmax ( data ), szName, charsmax ( szName ), callback );
	
	new key = str_to_num ( data );
	
	switch ( key )
	{
		case 1:
		{
			if(cs_get_user_money(id) >= 10000)
			{
				g_bKnife[id] = true;
				cs_set_user_money(id, cs_get_user_money(id) - 10000);
			}
			else
			{
				client_print(id, print_chat, "Nu ai suficienti bani !");
				return 1;
			}
		}
		case 2:
		{
			if(cs_get_user_money(id) >= 3000)
			{
				give_item ( id,"weapon_hegrenade" );
				cs_set_user_money(id, cs_get_user_money(id) - 3000);
			}
			else
			{
				client_print(id, print_chat, "Nu ai suficienti bani !");
				return 1;
			}
		}
		case 3:
		{
			if(cs_get_user_money(id) >= 3000)
			{
				set_user_health(id, get_user_health(id) + 50);
				cs_set_user_money(id, cs_get_user_money(id) - 3000);
			}
			else
			{
				client_print(id, print_chat, "Nu ai suficienti bani !");
				return 1;
			}
		}
		case 4:
		{
			if(cs_get_user_money(id) >= 500)
			{
				set_user_armor(id, get_user_armor(id) + 50);
				give_item(id, "item_assaultsuit");
				cs_set_user_money(id, cs_get_user_money(id) - 500);
			}
			else
			{
				client_print(id, print_chat, "Nu ai suficienti bani !");
				return 1;
			}
		}
	}
	menu_destroy ( menu );
	return 1;
}
public shopct( id )
{
	static menu;
	menu = menu_create ("\yShop \rFurieni","anti_menu");
	
	if(cs_get_user_money(id) >= 500)
	{
	menu_additem ( menu,"\w DefuseKit\y[\r500$\y]","1", 0 );
	}
	else
	{
	menu_additem ( menu,"\w DefuseKit\y[\rNO MONEY\y]","1", 0 );
	}
	
	if(cs_get_user_money(id) >= 6000)
	{
	menu_additem ( menu,"\w HeGrenade\y[\r6000$\y]","2", 0 );
	}
	else
	{
	menu_additem ( menu,"\w HeGrenade\y[\rNO MONEY\y]","2", 0 );
	}
	
	if(cs_get_user_money(id) >= 3000)
	{
	menu_additem ( menu,"\w +50 HP\y[\r3000$\y]","3", 0 );
	}
	else
	{
	menu_additem ( menu,"\w +50 HP\y[\rNO MONEY\y]","3", 0 );
	}
	
	if(cs_get_user_money(id) >= 500)
	{
	menu_additem ( menu,"\w +50 AP+Helmet\y[\r500$\y]","4", 0 );
	}
	else
	{
	menu_additem ( menu,"\w +50 AP+Helmet\y[\rNO MONEY\y]","4", 0 );
	}
	
	
	menu_additem ( menu,"\w +50 AP+Helmet\y[\r500$\y]","4", 0 );
	
	menu_setprop ( menu, MPROP_NUMBER_COLOR,"\y");
	menu_setprop ( menu, MPROP_EXIT, MEXIT_ALL );
	
	menu_display ( id, menu, 0 );
	return 0;
}

public anti_menu ( id, menu, item )
{
	if ( item == MENU_EXIT )
	{
		menu_destroy ( menu );
		return 1;
	}
	
	new data [ 6 ], szName [ 64 ];
	new access, callback;
	
	menu_item_getinfo ( menu, item, access, data, charsmax ( data ), szName, charsmax ( szName ), callback );
	
	new key = str_to_num ( data );
	
	switch ( key )
	{
		case 1:
		{
			if(cs_get_user_money(id) >= 500)
			{
				give_item(id, "item_thighpack");
				cs_set_user_money(id, cs_get_user_money(id) - 500);
			}
			else
			{
				client_print(id, print_chat, "Nu ai suficienti bani !");
				return 1;
			}
		}
		case 2:
		{
			if(cs_get_user_money(id) >= 6000)
			{
				give_item ( id,"weapon_hegrenade" );
				cs_set_user_money(id, cs_get_user_money(id) - 6000);
			}
			else
			{
				client_print(id, print_chat, "Nu ai suficienti bani !");
				return 1;
			}
		}
		case 3:
		{
			if(cs_get_user_money(id) >= 3000)
			{
				set_user_health(id, get_user_health(id) + 50);
				cs_set_user_money(id, cs_get_user_money(id) - 3000);
			}
			else
			{
				client_print(id, print_chat, "Nu ai suficienti bani !");
				return 1;
			}
		}
		case 4:
		{
			if(cs_get_user_money(id) >= 500)
			{
				set_user_armor(id, get_user_armor(id) + 50);
				give_item(id, "item_assaultsuit");
				cs_set_user_money(id, cs_get_user_money(id) - 500);
			}
			else
			{
				client_print(id, print_chat, "Nu ai suficienti bani !");
				return 1;
			}
		}
	}
	menu_destroy ( menu );
	return 1;
}
public evCurweapon(id)
{
	if(get_user_weapon(id) == CSW_KNIFE && g_bKnife[id])
	{
		set_pev(id, pev_viewmodel2, vKnife);
		set_pev(id, pev_weaponmodel2, pKnife);
	}
}
public round_start( )
{
	new iPlayers[32], iNum;
	get_players(iPlayers, iNum);
	for(new i = 0; i < iNum; i++)
	{
		g_bKnife[ iPlayers[ i ] ] = false;
	}
}
public fwd_takedamage( iVictim, iInflictor, iAttacker, Float:fDamage )
{
	if ( iInflictor == iAttacker && IsPlayer ( iAttacker ) && get_user_weapon( iAttacker ) == CSW_KNIFE && g_bKnife[ iAttacker ])
	{
		SetHamParamFloat ( 4, fDamage * 2.0 );
		return HAM_HANDLED;
	}
	return HAM_IGNORED;
}
public client_disconnect(id)
	g_bKnife[id] = false;

public client_putinsevrer(id)
	g_bKnife[id] = false;

public plugin_precache()
{
	precache_model(vKnife);
	precache_model(pKnife);
}
Aceleasi modele de le-am uploadat mai sus !
User avatar
EuSemakka
Membru, skill +1
Membru, skill +1
Posts: 301
Joined: 26 Nov 2013, 17:40
Detinator Steam: Da
Detinator server CS: Furien.FaraLaG.Ro
Has thanked: 38 times
Been thanked: 7 times

22 Dec 2013, 16:53

AI testat modelul ??
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: Google [Bot] and 8 guests