cerere modificare plugin furien shop clasic

Modificari necesare ale pluginurilor

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
User avatar
NemeSyS17
Membru, skill +1
Membru, skill +1
Posts: 300
Joined: 04 Apr 2017, 23:42
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Has thanked: 6 times
Been thanked: 2 times
Contact:

09 Feb 2020, 16:45

puteti va rog sa mi adaugati la tero superknife pentru vip cu flagul "t"
si la el urmatoare cvars
cum are cel pentru player
fs_sk_damage
la cel petnjru vip sa fie fs_vipsk_damge, si prin el sa setez smg-ul care sa l dea sk ul la vip
si pretu
fs_vipsk_price sa setez pretul
doar vip-ul sa aibe acces sa l cumpere.
cu mesaje ca si celeleate
"[ Furien Shop ] ai cumparat Super knife VIP"
"[ Furien Shop ] ai nevoie de membru vip sa poti cumpara acest item"

Code: Select all

/* Plugin generated by AMXX-Studio */

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

//Like in C ;)
#pragma semicolon 1

//Take Damage
#define IsPlayer(%0)    ( 1 <= %0 <= g_iMaxPlayers )
new g_iMaxPlayers;

//Prefix
new const szPrefix [ ] 		=	 "[ Furien Shop ]";

//Sound
new const PICK_GUN [ ]          =	 "items/gunpickup2.wav";

//SK Models
new const SK [ ] [ ]		= 
{
	"models/v_superknifeclasic.mdl",
	"models/p_knife.mdl"
};

//Cvar's
new sk_price, he_t_price, he_ct_price, defuse_price, hp_price, ap_price;
new sk_damage, max_hp, max_ap;

//Bools
new bool: HasSK[ 33 ];

//Init
public plugin_init( ) 
{
	register_plugin( "Furien Shop", "1.0", "Snow." );
	
	//Open Shop
	register_clcmd( "say", "Func_Say" );
	register_clcmd( "say_team", "Func_Say" );
	register_clcmd( "/shop", "CheckTeam" );
	register_clcmd( "shop", "CheckTeam" );
	
	//Cvar's
	sk_price 	= 	register_cvar( "fs_sk_price", "10000" );
	he_t_price 	= 	register_cvar( "fs_he_t_price", "3000" );
	he_ct_price 	= 	register_cvar( "fs_he_ct_price", "6000" );
	defuse_price 	= 	register_cvar( "fs_defuse_price", "500" );
	hp_price 	= 	register_cvar( "fs_hp_price", "3000" );
	ap_price 	= 	register_cvar( "fs_ap_price", "500" );
	sk_damage 	= 	register_cvar( "fs_sk_damage", "2.0" );
	max_hp 		= 	register_cvar( "fs_max_hp", "200" );
	max_ap 		= 	register_cvar( "fs_max_ap", "300" );
	
	//Ham's
	RegisterHam( Ham_Killed, "player", "Ham_CBasePlayer_Killed_Post", true );
	RegisterHam( Ham_Spawn, "player", "fwHamPlayerSpawnPost", 1 ); 
	RegisterHam( Ham_TakeDamage, "player", "Player_TakeDamage" );
	
	//Curent Weapon
	register_event ( "CurWeapon", "Current_Weapon", "be", "1=1" );
	
	//Max Players
	g_iMaxPlayers = get_maxplayers ( );
}

//Precache
public plugin_precache( ) 
{
	static i;
	for( i = 0 ; i < sizeof ( SK ); i++ ) 
		precache_model( SK [ i ] );

	precache_sound( PICK_GUN );

	return PLUGIN_CONTINUE;
}

//Killed
public Ham_CBasePlayer_Killed_Post( id ) 
     	HasSK[ id ] = false;
	
//Spawn
public fwHamPlayerSpawnPost( id ) 
{
	if( get_user_team(id) == 2 )
     		HasSK[ id ] = false;
}	

//Put in Server
public client_putinserver( id ) 
     	HasSK[ id ] = false;
	
//Open Shop
public Func_Say( id ) 
{
	new szSaid[ 192 ];
	read_args( szSaid, sizeof( szSaid ) -1 );
	
	remove_quotes( szSaid );
	
	if( contain( szSaid, "shop" ) != -1 && !is_user_alive(id))
	{
		CheckTeam( id );
		return 1;
	}
	else if( contain( szSaid, "shop" ) != -1 && is_user_alive(id))
		CheckTeam( id );
	return 0;
}

//Show Model
public Current_Weapon( id ) 
{
	new weapon = get_user_weapon( id );
	
	if( weapon == CSW_KNIFE ) 
	{
		if( HasSK[ id ] == true ) 
		{
			set_pev ( id, pev_viewmodel2, SK[ 0 ] );
			set_pev ( id, pev_weaponmodel2, SK[ 1 ] );
		}
	}
}

//Damage
public Player_TakeDamage( iVictim, iInflictor, iAttacker, Float:fDamage ) 
{
	if ( iInflictor == iAttacker && IsPlayer ( iAttacker ) && HasSK [ iAttacker ] ) 
	{
		SetHamParamFloat ( 4, fDamage * get_pcvar_float( sk_damage ) );
		
		return HAM_HANDLED;
	}
	
	return HAM_IGNORED;
	
}

//Check Team Shop
public CheckTeam( id ) 
{
	if( is_user_alive ( id ) ) 
	{
		if ( get_user_team ( id ) == 1 )
			ShowMenu_T( id );
		if ( get_user_team ( id ) == 2 ) 
			ShowMenu_CT( id );
	}	
}

//T Shop
public ShowMenu_T( id ) 
{
	new menu_t = menu_create( "\rFurien \yShop^n", "T_Menu" );

	new iLine1 [ 200 ];
	new iLine2 [ 200 ];
	new iLine3 [ 200 ];
	new iLine4 [ 200 ];

	formatex( iLine1 , sizeof ( iLine1 ) -1 , "SuperKnife\R\y%i" , get_pcvar_num( sk_price ) );
	formatex( iLine2 , sizeof ( iLine2 ) -1 , "He\R\y%i" , get_pcvar_num( he_t_price ) );
	formatex( iLine3 , sizeof ( iLine3 ) -1 , "HP +50\R\y%i" , get_pcvar_num( hp_price ) );
	formatex( iLine4 , sizeof ( iLine4 ) -1 , "AP +50\R\y%i" , get_pcvar_num( ap_price ) );

	menu_additem( menu_t, iLine1, "1" ); 
	menu_additem( menu_t, iLine2, "2" );
	menu_additem( menu_t, iLine3, "3" );
	menu_additem( menu_t, iLine4, "4" ); 

	menu_setprop( menu_t, MPROP_EXIT, MEXIT_ALL );
	menu_setprop( menu_t, MPROP_NOCOLORS, 1 );
	menu_setprop( menu_t, MPROP_NUMBER_COLOR, "\y" );
	
	menu_display( id, menu_t, 0 );
	
	return PLUGIN_HANDLED;
}

public T_Menu( id, menu_t, item )
{
	if( item == MENU_EXIT || get_user_team( id ) != 1 )
		return PLUGIN_HANDLED;
	
	new  command[ 6 ], name[ 64 ], access, callback;
	
	new price;
	price = cs_get_user_money( id );
	
	menu_item_getinfo( menu_t, item, access, command, sizeof command - 1, name, sizeof name - 1, callback );
	
	switch(item)
	{
		case 0: 
		{
			if( price >= get_pcvar_num( sk_price ) ) 
			{
				if ( !HasSK [ id ] ) 
				{
					//Get Money
					cs_set_user_money( id, price - get_pcvar_num( sk_price ) );

					//Pev SuperKnife
					if( get_user_weapon( id ) == CSW_KNIFE ) 
					{
						set_pev ( id, pev_viewmodel2, SK[ 0 ] );
						set_pev ( id, pev_weaponmodel2, SK[ 1 ] );
					}
					else
						engclient_cmd( id, "weapon_knife" );

					//Give SuperKnife
					HasSK[ id ] = true;

					//Sound
					emit_sound( id, CHAN_ITEM, PICK_GUN, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );	
				}
				else 
					ColorChat( id, "^x04%s^x01 Ai deja^x03 SuperKnife !", szPrefix );
			}
			else 
				ColorChat( id, "^x04%s^x01 Nu ai destui^x03 bani!^x01 Ai nevoie de^x03 %d$ !", szPrefix, get_pcvar_num( sk_price ) );	
		}
		case 1: 
		{
			if( price >= get_pcvar_num( he_t_price ) ) 
			{
				if( ! user_has_weapon( id ,  CSW_HEGRENADE ) ) 
				{
					//Get Money
					cs_set_user_money( id, price - get_pcvar_num( he_t_price ) );

					//Give He
					give_item( id, "weapon_hegrenade" );

				}
				else 
					ColorChat( id, "^x04%s^x01 Ai deja ^x03 He Grenade !", szPrefix );
			}
			else 
				ColorChat( id, "^x04%s^x01 Nu ai destui^x03 bani!^x01 Ai nevoie de^x03 %d$ !", szPrefix, get_pcvar_num( he_t_price ) );		
		}
		case 2: 
		{
			if( price >= get_pcvar_num( hp_price ) ) 
			{
				if( get_user_health( id ) < get_pcvar_num( max_hp ) ) 
				{
					//Get Money
					cs_set_user_money( id, price - get_pcvar_num( hp_price ) );

					//Give Health
					set_user_health( id, get_user_health ( id ) + 50 );

					//Sound
					emit_sound( id, CHAN_ITEM, PICK_GUN, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
					
					//Verify
					if( get_user_health( id ) > get_pcvar_num( max_hp ) )
						set_user_health( id, get_pcvar_num( max_hp ) );
				}
				else 
					ColorChat( id, "^x04%s^x01 Ai atins limita de^x03 %d HP !", szPrefix, get_pcvar_num( max_hp ) );
			}
			else 
				ColorChat( id, "^x04%s^x01 Nu ai destui^x03 bani!^x01 Ai nevoie de^x03 %d$ !", szPrefix, get_pcvar_num( hp_price ) );		
		}
		case 3: 
		{
			if( price >= get_pcvar_num( ap_price ) ) 
			{
				if( get_user_armor ( id ) < get_pcvar_num( max_ap ) ) 
				{
					//Get Money
					cs_set_user_money( id, price - get_pcvar_num( ap_price ) );

					//Give AP
					set_user_armor( id, get_user_armor( id ) + 50 );

					//Sound
					emit_sound( id, CHAN_ITEM, PICK_GUN, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
					
					//Verify
					if( get_user_armor( id ) > get_pcvar_num( max_ap ) )
						set_user_armor( id, get_pcvar_num( max_ap ) );
				}
				else 
					ColorChat( id, "^x04%s^x01 Ai atins limita de^x03 %d AP !", szPrefix, get_pcvar_num( max_ap ) );
			}
			else
				ColorChat( id, "^x04%s^x01 Nu ai destui^x03 bani!^x01 Ai nevoie de^x03 %d$ !", szPrefix, get_pcvar_num( ap_price ) );	
		}	
	}
	menu_destroy( menu_t );
	
	return PLUGIN_HANDLED;
}

//CT Shop
public ShowMenu_CT( id ) 
{
	new menu_ct = menu_create( "\rAnti-Furien \yShop^n", "CT_Menu" );

	new iLine1 [ 200 ];
	new iLine2 [ 200 ];
	new iLine3 [ 200 ];
	new iLine4 [ 200 ];

	formatex( iLine1 , sizeof ( iLine1 ) -1 , "Defuse\R\y%i" , get_pcvar_num( defuse_price ) );
	formatex( iLine2 , sizeof ( iLine2 ) -1 , "He\R\y%i" , get_pcvar_num( he_ct_price ) );
	formatex( iLine3 , sizeof ( iLine3 ) -1 , "HP +50\R\y%i" , get_pcvar_num( hp_price ) );
	formatex( iLine4 , sizeof ( iLine4 ) -1 , "AP +50\R\y%i" , get_pcvar_num( ap_price ) );

	menu_additem( menu_ct, iLine1, "1" ); 
	menu_additem( menu_ct, iLine2, "2" );
	menu_additem( menu_ct, iLine3, "3" );
	menu_additem( menu_ct, iLine4, "4" ); 

	menu_setprop( menu_ct, MPROP_EXIT, MEXIT_ALL );
	menu_setprop( menu_ct, MPROP_NOCOLORS, 1 );
	menu_setprop( menu_ct, MPROP_NUMBER_COLOR, "\y" );
	
	menu_display( id, menu_ct, 0 );
	
	return PLUGIN_HANDLED;
}

public CT_Menu( id, menu_ct, item )
{
	if( item == MENU_EXIT || get_user_team( id ) != 2 )
		return PLUGIN_HANDLED;
	
	new  command[ 6 ], name[ 64 ], access, callback;
	
	new price;
	price = cs_get_user_money( id );
	
	menu_item_getinfo( menu_ct, item, access, command, sizeof command - 1, name, sizeof name - 1, callback );
	
	switch(item)
	{
		case 0: 
		{
			if( price >= get_pcvar_num( defuse_price ) ) 
			{
				if ( !cs_get_user_defuse( id ) ) 
				{
					//Get Money
					cs_set_user_money( id, price - get_pcvar_num( defuse_price ) );

					//Give DefuseKit
					cs_set_user_defuse( id,1 );
		
					//Sound
                                	emit_sound( id, CHAN_ITEM, PICK_GUN, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
				}
				else 
					ColorChat( id, "^x04%s^x01 Ai deja^x03 DefuseKIT !", szPrefix );
			}
			else 
				ColorChat( id, "^x04%s^x01 Nu ai destui^x03 bani!^x01 Ai nevoie de^x03 %d$ !", szPrefix, get_pcvar_num( defuse_price ) );
		}
		case 1: 
		{
			if( price >= get_pcvar_num( he_ct_price ) ) 
			{
				if( ! user_has_weapon( id ,  CSW_HEGRENADE ) ) 
				{
					//Get Money
					cs_set_user_money( id, price - get_pcvar_num( he_ct_price ) );

					//Give He
					give_item( id, "weapon_hegrenade" );	
				}
				else 
					ColorChat( id, "^x04%s^x01 Ai deja^x03 He Grenade !", szPrefix );
			}
			else 
				ColorChat( id, "^x04%s^x01 Nu ai destui^x03 bani!^x01 Ai nevoie de^x03 %d$ !", szPrefix, get_pcvar_num( he_ct_price ) );	
		}
		case 2: 
		{
			if( price >= get_pcvar_num( hp_price ) ) 
			{
				if( get_user_health( id ) < get_pcvar_num( max_hp ) ) 
				{
					//Get Money
					cs_set_user_money( id, price - get_pcvar_num( hp_price ) );

					//Give Health
					set_user_health ( id, get_user_health ( id ) + 50 );

					//Sound
					emit_sound( id, CHAN_ITEM, PICK_GUN, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
					
					//Verify
					if( get_user_health( id ) > get_pcvar_num( max_hp ) )
						set_user_health( id, get_pcvar_num( max_hp ) );
				}
				else 
					ColorChat( id, "^x04%s^x01 Ai atins limita de^x03 %d HP !", szPrefix, get_pcvar_num( max_hp ) );
			}
			else 
				ColorChat( id, "^x04%s^x01 Nu ai destui^x03 bani!^x01 Ai nevoie de^x03 %d$ !", szPrefix, get_pcvar_num( hp_price ) );		
		}
		case 3: 
		{
			if( price >= get_pcvar_num( ap_price ) ) 
			{
				if( get_user_armor( id ) < get_pcvar_num( max_ap ) ) 
				{
					//Get Money
					cs_set_user_money( id,price- get_pcvar_num( ap_price ) );

					//Give AP
					set_user_armor( id, get_user_armor( id ) + 50 );

					//Sound
					emit_sound( id, CHAN_ITEM, PICK_GUN, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
					
					//Verify
					if( get_user_armor( id ) > get_pcvar_num( max_ap ) )
						set_user_armor( id, get_pcvar_num( max_ap ) );
				}
				else 
					ColorChat( id, "^x04%s^x01 Ai atins limita de^x03 %d AP !", szPrefix, get_pcvar_num( max_ap ) );
			}
			else
				ColorChat( id, "^x04%s^x01 Nu ai destui^x03 bani!^x01 Ai nevoie de^x03 %d$ !", szPrefix, get_pcvar_num( ap_price ) );	
		}	
	}
	menu_destroy( menu_ct );
	
	return PLUGIN_HANDLED;
}

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

Code: Select all

www.darknight.ro Recruteaza Moderatori / GFX Designer / Leader MIX
Rapidserver
User avatar
L E V I N
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 3042
Joined: 24 Aug 2011, 11:24
Detinator Steam: Da
CS Status:
Detinator server CS: ☯∴
SteamID: riseofevo
Reputatie: Scripter eXtreamCS
Nume anterior: Adryyy
Location: ҳ̸Ҳ̸ҳ
Has thanked: 39 times
Been thanked: 458 times
Contact:

09 Feb 2020, 22:05

Code: Select all

/* Plugin generated by AMXX-Studio */

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

#pragma tabsize 0

//Like in C ;)	OR NOT
#pragma semicolon 0

#define VIP_FLAG	"t"
#define is_vip(%1)	(get_user_flags(%1)&read_flags(VIP_FLAG))

//Take Damage
#define IsPlayer(%0)    ( 1 <= %0 <= g_iMaxPlayers )
new g_iMaxPlayers;

//Prefix
new const szPrefix [ ] 		=	 "[ Furien Shop ]";

//Sound
new const PICK_GUN [ ]          =	 "items/gunpickup2.wav";

//SK Models
new const SK [ ] [ ]		= 
{
	"models/v_superknifeclasic.mdl",
	"models/p_knife.mdl"
};

new const SKV [ ] [ ]		= 
{
	"models/v_superknifeclasic.mdl",
	"models/p_knife.mdl"
};

//Cvar's
new sk_price, he_t_price, he_ct_price, defuse_price, hp_price, ap_price;
new sk_damage, max_hp, max_ap;
new skv_price,skv_damage

//Bools
new bool: HasSK[ 33 ],bool:HasSKV[33]

//Init
public plugin_init( ) 
{
	register_plugin( "Furien Shop", "1.0", "Snow." );
	
	//Open Shop
	register_clcmd( "say", "Func_Say" );
	register_clcmd( "say_team", "Func_Say" );
	register_clcmd( "/shop", "CheckTeam" );
	register_clcmd( "shop", "CheckTeam" );
	
	//Cvar's
	sk_price 	= 	register_cvar( "fs_sk_price", "10000" );
	skv_price 	= 	register_cvar( "fs_skv_price", "10000" );
	he_t_price 	= 	register_cvar( "fs_he_t_price", "3000" );
	he_ct_price 	= 	register_cvar( "fs_he_ct_price", "6000" );
	defuse_price 	= 	register_cvar( "fs_defuse_price", "500" );
	hp_price 	= 	register_cvar( "fs_hp_price", "3000" );
	ap_price 	= 	register_cvar( "fs_ap_price", "500" );
	sk_damage 	= 	register_cvar( "fs_sk_damage", "2.0" );
	skv_damage 	= 	register_cvar( "fs_skv_damage", "2.0" );
	max_hp 		= 	register_cvar( "fs_max_hp", "200" );
	max_ap 		= 	register_cvar( "fs_max_ap", "300" );
	
	//Ham's
	RegisterHam( Ham_Killed, "player", "Ham_CBasePlayer_Killed_Post", true );
	RegisterHam( Ham_Spawn, "player", "fwHamPlayerSpawnPost", 1 ); 
	RegisterHam( Ham_TakeDamage, "player", "Player_TakeDamage" );
	
	//Curent Weapon
	register_event ( "CurWeapon", "Current_Weapon", "be", "1=1" );
	
	//Max Players
	g_iMaxPlayers = get_maxplayers ( );
}

//Precache
public plugin_precache( ) 
{
	static i;
	for( i = 0 ; i < sizeof ( SK ); i++ ) 
		precache_model( SK [ i ] );
	for( i = 0 ; i < sizeof ( SKV ); i++ ) 
		precache_model( SKV [ i ] );

	precache_sound( PICK_GUN );

	return PLUGIN_CONTINUE;
}

//Killed
public Ham_CBasePlayer_Killed_Post( id ) 
{
     	HasSK[ id ] = false;
	HasSKV[ id ] = false;
}
	
//Spawn
public fwHamPlayerSpawnPost( id ) 
{
	if( get_user_team(id) == 2 )
     		HasSK[ id ] = false;	HasSKV[ id ] = false;
}	

//Put in Server
public client_putinserver( id ) 
{
     	HasSK[ id ] = false;
	HasSKV[ id ] = false;
}
	
//Open Shop
public Func_Say( id ) 
{
	new szSaid[ 192 ];
	read_args( szSaid, sizeof( szSaid ) -1 );
	
	remove_quotes( szSaid );
	
	if( contain( szSaid, "shop" ) != -1 && !is_user_alive(id))
	{
		CheckTeam( id );
		return 1;
	}
	else if( contain( szSaid, "shop" ) != -1 && is_user_alive(id))
		CheckTeam( id );
	return 0;
}

//Show Model
public Current_Weapon( id ) 
{
	new weapon = get_user_weapon( id );
	
	if( weapon == CSW_KNIFE ) 
	{
		if( HasSK[ id ] == true ) 
		{
			set_pev ( id, pev_viewmodel2, SK[ 0 ] );
			set_pev ( id, pev_weaponmodel2, SK[ 1 ] );
		}
		else if( HasSKV[ id ] == true ) 
		{
			set_pev ( id, pev_viewmodel2, SKV[ 0 ] );
			set_pev ( id, pev_weaponmodel2, SKV[ 1 ] );
		}
	}
}

//Damage
public Player_TakeDamage( iVictim, iInflictor, iAttacker, Float:fDamage ) 
{
	if ( iInflictor == iAttacker && IsPlayer ( iAttacker ) && HasSK [ iAttacker ] ) 
	{
		SetHamParamFloat ( 4, fDamage * get_pcvar_float( sk_damage ) );
		
		return HAM_HANDLED;
	}
	if ( iInflictor == iAttacker && IsPlayer ( iAttacker ) && HasSKV [ iAttacker ] ) 
	{
		SetHamParamFloat ( 4, fDamage * get_pcvar_float( skv_damage ) );
		
		return HAM_HANDLED;
	}
	
	return HAM_IGNORED;
	
}

//Check Team Shop
public CheckTeam( id ) 
{
	if( is_user_alive ( id ) ) 
	{
		if ( get_user_team ( id ) == 1 )
			ShowMenu_T( id );
		if ( get_user_team ( id ) == 2 ) 
			ShowMenu_CT( id );
	}	
}

//T Shop
public ShowMenu_T( id ) 
{
	new menu_t = menu_create( "\rFurien \yShop^n", "T_Menu" );

	new iLine1 [ 200 ];
	new iLine2 [ 200 ];
	new iLine3 [ 200 ];
	new iLine4 [ 200 ];
	new iLine5[ 200 ];

	formatex( iLine1 , sizeof ( iLine1 ) -1 , "SuperKnife\R\y%i" , get_pcvar_num( sk_price ) );
	formatex( iLine2 , sizeof ( iLine2 ) -1 , "He\R\y%i" , get_pcvar_num( he_t_price ) );
	formatex( iLine3 , sizeof ( iLine3 ) -1 , "HP +50\R\y%i" , get_pcvar_num( hp_price ) );
	formatex( iLine4 , sizeof ( iLine4 ) -1 , "AP +50\R\y%i" , get_pcvar_num( ap_price ) );
	if(!(HasSK[id]||HasSKV[id]))	formatex( iLine5 , sizeof ( iLine5 ) -1 , "SuperKnifeVIP\R\y%i" , get_pcvar_num( skv_price ) );
	else	formatex( iLine5 , sizeof ( iLine5 ) -1 , "\dSuperKnifeVIP\R\y%i" , get_pcvar_num( skv_price ) );

	menu_additem( menu_t, iLine1, "1" ); 
	menu_additem( menu_t, iLine2, "2" );
	menu_additem( menu_t, iLine3, "3" );
	menu_additem( menu_t, iLine4, "4" ); 
	menu_additem( menu_t, iLine5, "5",is_vip(id) ); 

	menu_setprop( menu_t, MPROP_EXIT, MEXIT_ALL );
	menu_setprop( menu_t, MPROP_NOCOLORS, 1 );
	menu_setprop( menu_t, MPROP_NUMBER_COLOR, "\y" );
	
	menu_display( id, menu_t, 0 );
	
	return PLUGIN_HANDLED;
}

public T_Menu( id, menu_t, item )
{
	if( item == MENU_EXIT || get_user_team( id ) != 1 )
		return PLUGIN_HANDLED;
	
	new  command[ 6 ], name[ 64 ], access, callback;
	
	new price;
	price = cs_get_user_money( id );
	
	menu_item_getinfo( menu_t, item, access, command, sizeof command - 1, name, sizeof name - 1, callback );
	
	switch(item)
	{
		case 0: 
		{
			if( price >= get_pcvar_num( sk_price ) ) 
			{
				if ( !HasSK [ id ] ) 
				{
					//Get Money
					cs_set_user_money( id, price - get_pcvar_num( sk_price ) );

					//Pev SuperKnife
					if( get_user_weapon( id ) == CSW_KNIFE ) 
					{
						set_pev ( id, pev_viewmodel2, SK[ 0 ] );
						set_pev ( id, pev_weaponmodel2, SK[ 1 ] );
					}
					else
						engclient_cmd( id, "weapon_knife" );

					//Give SuperKnife
					HasSK[ id ] = true;

					//Sound
					emit_sound( id, CHAN_ITEM, PICK_GUN, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );	
				}
				else 
					ColorChat( id, "^x04%s^x01 Ai deja^x03 SuperKnife !", szPrefix );
			}
			else 
				ColorChat( id, "^x04%s^x01 Nu ai destui^x03 bani!^x01 Ai nevoie de^x03 %d$ !", szPrefix, get_pcvar_num( sk_price ) );	
		}
		case 1: 
		{
			if( price >= get_pcvar_num( he_t_price ) ) 
			{
				if( ! user_has_weapon( id ,  CSW_HEGRENADE ) ) 
				{
					//Get Money
					cs_set_user_money( id, price - get_pcvar_num( he_t_price ) );

					//Give He
					give_item( id, "weapon_hegrenade" );

				}
				else 
					ColorChat( id, "^x04%s^x01 Ai deja ^x03 He Grenade !", szPrefix );
			}
			else 
				ColorChat( id, "^x04%s^x01 Nu ai destui^x03 bani!^x01 Ai nevoie de^x03 %d$ !", szPrefix, get_pcvar_num( he_t_price ) );		
		}
		case 2: 
		{
			if( price >= get_pcvar_num( hp_price ) ) 
			{
				if( get_user_health( id ) < get_pcvar_num( max_hp ) ) 
				{
					//Get Money
					cs_set_user_money( id, price - get_pcvar_num( hp_price ) );

					//Give Health
					set_user_health( id, get_user_health ( id ) + 50 );

					//Sound
					emit_sound( id, CHAN_ITEM, PICK_GUN, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
					
					//Verify
					if( get_user_health( id ) > get_pcvar_num( max_hp ) )
						set_user_health( id, get_pcvar_num( max_hp ) );
				}
				else 
					ColorChat( id, "^x04%s^x01 Ai atins limita de^x03 %d HP !", szPrefix, get_pcvar_num( max_hp ) );
			}
			else 
				ColorChat( id, "^x04%s^x01 Nu ai destui^x03 bani!^x01 Ai nevoie de^x03 %d$ !", szPrefix, get_pcvar_num( hp_price ) );		
		}
		case 3: 
		{
			if( price >= get_pcvar_num( ap_price ) ) 
			{
				if( get_user_armor ( id ) < get_pcvar_num( max_ap ) ) 
				{
					//Get Money
					cs_set_user_money( id, price - get_pcvar_num( ap_price ) );

					//Give AP
					set_user_armor( id, get_user_armor( id ) + 50 );

					//Sound
					emit_sound( id, CHAN_ITEM, PICK_GUN, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
					
					//Verify
					if( get_user_armor( id ) > get_pcvar_num( max_ap ) )
						set_user_armor( id, get_pcvar_num( max_ap ) );
				}
				else 
					ColorChat( id, "^x04%s^x01 Ai atins limita de^x03 %d AP !", szPrefix, get_pcvar_num( max_ap ) );
			}
			else
				ColorChat( id, "^x04%s^x01 Nu ai destui^x03 bani!^x01 Ai nevoie de^x03 %d$ !", szPrefix, get_pcvar_num( ap_price ) );	
		}	
		case 4: 
		{
			if( price >= get_pcvar_num( skv_price ) ) 
			{
				if ( !(HasSKV [ id ]||HasSK[id]) ) 
				{
					//Get Money
					cs_set_user_money( id, price - get_pcvar_num( skv_price ) );

					//Pev SuperKnife
					if( get_user_weapon( id ) == CSW_KNIFE ) 
					{
						set_pev ( id, pev_viewmodel2, SKV[ 0 ] );
						set_pev ( id, pev_weaponmodel2, SKV[ 1 ] );
					}
					else
						engclient_cmd( id, "weapon_knife" );

					//Give SuperKnife
					HasSKV[ id ] = true;

					//Sound
					emit_sound( id, CHAN_ITEM, PICK_GUN, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );	
				}
				else 
					ColorChat( id, "^x04%s^x01 Ai deja^x03 SuperKnife VIP!", szPrefix );
			}
			else 
				ColorChat( id, "^x04%s^x01 Nu ai destui^x03 bani!^x01 Ai nevoie de^x03 %d$ !", szPrefix, get_pcvar_num( skv_price ) );	
		}
	}
	menu_destroy( menu_t );
	
	return PLUGIN_HANDLED;
}

//CT Shop
public ShowMenu_CT( id ) 
{
	new menu_ct = menu_create( "\rAnti-Furien \yShop^n", "CT_Menu" );

	new iLine1 [ 200 ];
	new iLine2 [ 200 ];
	new iLine3 [ 200 ];
	new iLine4 [ 200 ];

	formatex( iLine1 , sizeof ( iLine1 ) -1 , "Defuse\R\y%i" , get_pcvar_num( defuse_price ) );
	formatex( iLine2 , sizeof ( iLine2 ) -1 , "He\R\y%i" , get_pcvar_num( he_ct_price ) );
	formatex( iLine3 , sizeof ( iLine3 ) -1 , "HP +50\R\y%i" , get_pcvar_num( hp_price ) );
	formatex( iLine4 , sizeof ( iLine4 ) -1 , "AP +50\R\y%i" , get_pcvar_num( ap_price ) );

	menu_additem( menu_ct, iLine1, "1" ); 
	menu_additem( menu_ct, iLine2, "2" );
	menu_additem( menu_ct, iLine3, "3" );
	menu_additem( menu_ct, iLine4, "4" ); 

	menu_setprop( menu_ct, MPROP_EXIT, MEXIT_ALL );
	menu_setprop( menu_ct, MPROP_NOCOLORS, 1 );
	menu_setprop( menu_ct, MPROP_NUMBER_COLOR, "\y" );
	
	menu_display( id, menu_ct, 0 );
	
	return PLUGIN_HANDLED;
}

public CT_Menu( id, menu_ct, item )
{
	if( item == MENU_EXIT || get_user_team( id ) != 2 )
		return PLUGIN_HANDLED;
	
	new  command[ 6 ], name[ 64 ], access, callback;
	
	new price;
	price = cs_get_user_money( id );
	
	menu_item_getinfo( menu_ct, item, access, command, sizeof command - 1, name, sizeof name - 1, callback );
	
	switch(item)
	{
		case 0: 
		{
			if( price >= get_pcvar_num( defuse_price ) ) 
			{
				if ( !cs_get_user_defuse( id ) ) 
				{
					//Get Money
					cs_set_user_money( id, price - get_pcvar_num( defuse_price ) );

					//Give DefuseKit
					cs_set_user_defuse( id,1 );
		
					//Sound
                                	emit_sound( id, CHAN_ITEM, PICK_GUN, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
				}
				else 
					ColorChat( id, "^x04%s^x01 Ai deja^x03 DefuseKIT !", szPrefix );
			}
			else 
				ColorChat( id, "^x04%s^x01 Nu ai destui^x03 bani!^x01 Ai nevoie de^x03 %d$ !", szPrefix, get_pcvar_num( defuse_price ) );
		}
		case 1: 
		{
			if( price >= get_pcvar_num( he_ct_price ) ) 
			{
				if( ! user_has_weapon( id ,  CSW_HEGRENADE ) ) 
				{
					//Get Money
					cs_set_user_money( id, price - get_pcvar_num( he_ct_price ) );

					//Give He
					give_item( id, "weapon_hegrenade" );	
				}
				else 
					ColorChat( id, "^x04%s^x01 Ai deja^x03 He Grenade !", szPrefix );
			}
			else 
				ColorChat( id, "^x04%s^x01 Nu ai destui^x03 bani!^x01 Ai nevoie de^x03 %d$ !", szPrefix, get_pcvar_num( he_ct_price ) );	
		}
		case 2: 
		{
			if( price >= get_pcvar_num( hp_price ) ) 
			{
				if( get_user_health( id ) < get_pcvar_num( max_hp ) ) 
				{
					//Get Money
					cs_set_user_money( id, price - get_pcvar_num( hp_price ) );

					//Give Health
					set_user_health ( id, get_user_health ( id ) + 50 );

					//Sound
					emit_sound( id, CHAN_ITEM, PICK_GUN, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
					
					//Verify
					if( get_user_health( id ) > get_pcvar_num( max_hp ) )
						set_user_health( id, get_pcvar_num( max_hp ) );
				}
				else 
					ColorChat( id, "^x04%s^x01 Ai atins limita de^x03 %d HP !", szPrefix, get_pcvar_num( max_hp ) );
			}
			else 
				ColorChat( id, "^x04%s^x01 Nu ai destui^x03 bani!^x01 Ai nevoie de^x03 %d$ !", szPrefix, get_pcvar_num( hp_price ) );		
		}
		case 3: 
		{
			if( price >= get_pcvar_num( ap_price ) ) 
			{
				if( get_user_armor( id ) < get_pcvar_num( max_ap ) ) 
				{
					//Get Money
					cs_set_user_money( id,price- get_pcvar_num( ap_price ) );

					//Give AP
					set_user_armor( id, get_user_armor( id ) + 50 );

					//Sound
					emit_sound( id, CHAN_ITEM, PICK_GUN, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
					
					//Verify
					if( get_user_armor( id ) > get_pcvar_num( max_ap ) )
						set_user_armor( id, get_pcvar_num( max_ap ) );
				}
				else 
					ColorChat( id, "^x04%s^x01 Ai atins limita de^x03 %d AP !", szPrefix, get_pcvar_num( max_ap ) );
			}
			else
				ColorChat( id, "^x04%s^x01 Nu ai destui^x03 bani!^x01 Ai nevoie de^x03 %d$ !", szPrefix, get_pcvar_num( ap_price ) );	
		}	
	}
	menu_destroy( menu_ct );
	
	return PLUGIN_HANDLED;
}

//Stock ColorChat
stock ColorChat( const id, const input[ ], any:... ) 
{
	new count = 1, players[ 32 ];
	static msg[ 191 ];
	vformat( msg, 190, input, 3 );
	
	replace_all( msg, 190, "!g", "^4" );
	replace_all( msg, 190, "!y", "^1" );
	replace_all( msg, 190, "!t", "^3" );
	
	if( id ) players[ 0 ] = id;
	else get_players( players, count, "ch" ); 
	for( new i = 0; i < count; i++ ) 
	{
			if( is_user_connected( players[ i ] ) ) 
			{
				message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "SayText" ), _, players[ i ] );
				write_byte( players[ i ] );
				write_string( msg );
				message_end( );
			}
	}
}
Faceți cerere bine detaliată aici și respectând modelul dacă vreți ajutor. Nu-mi mai dați add doar pentru a mă avea în lista de prieteni.
Aveți grijă la cei ce încearcă să mă copieze..Puteți lua legătura cu mine dacă aveți o problemă/nelămurire în acest caz! (am cont doar aici & pe csbd.com)
În cazul în care utilizați ceva din addonsurile postate de mine aici, e bine să fiți la curent cu modificările aduse unor plugine, aici, iar dacă sunt ceva probleme sau aveți dvs. probleme nu ezitați să luați legătura cu mine. Actualizarea unor coduri nu se va posta la actual, doar dacă se găsește ceva critic/urgent de remediat, fiind coduri vechi, iar unele refăcute recent.
* Cumpăr orice tip de cont steam cu level 333 sau 666(nu contează vac status, sau jocurile)
* my little store - anunturi/lev-shop-t370037.html
User avatar
NemeSyS17
Membru, skill +1
Membru, skill +1
Posts: 300
Joined: 04 Apr 2017, 23:42
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Has thanked: 6 times
Been thanked: 2 times
Contact:

09 Feb 2020, 22:50

Levin am o problema knife ul pentru vip daca mi l iau runda asta urmatoarea tot la tero fiind fara sa mor nu l mai am , poti face daca nu mor sa l mai am?

Code: Select all

www.darknight.ro Recruteaza Moderatori / GFX Designer / Leader MIX
User avatar
L E V I N
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 3042
Joined: 24 Aug 2011, 11:24
Detinator Steam: Da
CS Status:
Detinator server CS: ☯∴
SteamID: riseofevo
Reputatie: Scripter eXtreamCS
Nume anterior: Adryyy
Location: ҳ̸Ҳ̸ҳ
Has thanked: 39 times
Been thanked: 458 times
Contact:

10 Feb 2020, 16:14

Code: Select all

/* Plugin generated by AMXX-Studio */

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

#pragma tabsize 0

//Like in C ;)	OR NOT
#pragma semicolon 0

#define VIP_FLAG	"t"
#define is_vip(%1)	(get_user_flags(%1)&read_flags(VIP_FLAG))

//Take Damage
#define IsPlayer(%0)    ( 1 <= %0 <= g_iMaxPlayers )
new g_iMaxPlayers;

//Prefix
new const szPrefix [ ] 		=	 "[ Furien Shop ]";

//Sound
new const PICK_GUN [ ]          =	 "items/gunpickup2.wav";

//SK Models
new const SK [ ] [ ]		= 
{
	"models/v_superknifeclasic.mdl",
	"models/p_knife.mdl"
};

new const SKV [ ] [ ]		= 
{
	"models/v_superknifeclasic.mdl",
	"models/p_knife.mdl"
};

//Cvar's
new sk_price, he_t_price, he_ct_price, defuse_price, hp_price, ap_price;
new sk_damage, max_hp, max_ap;
new skv_price,skv_damage

//Bools
new bool: HasSK[ 33 ],bool:HasSKV[33]

//Init
public plugin_init( ) 
{
	register_plugin( "Furien Shop", "1.0", "Snow." );
	
	//Open Shop
	register_clcmd( "say", "Func_Say" );
	register_clcmd( "say_team", "Func_Say" );
	register_clcmd( "/shop", "CheckTeam" );
	register_clcmd( "shop", "CheckTeam" );
	
	//Cvar's
	sk_price 	= 	register_cvar( "fs_sk_price", "10000" );
	skv_price 	= 	register_cvar( "fs_skv_price", "10000" );
	he_t_price 	= 	register_cvar( "fs_he_t_price", "3000" );
	he_ct_price 	= 	register_cvar( "fs_he_ct_price", "6000" );
	defuse_price 	= 	register_cvar( "fs_defuse_price", "500" );
	hp_price 	= 	register_cvar( "fs_hp_price", "3000" );
	ap_price 	= 	register_cvar( "fs_ap_price", "500" );
	sk_damage 	= 	register_cvar( "fs_sk_damage", "2.0" );
	skv_damage 	= 	register_cvar( "fs_skv_damage", "2.0" );
	max_hp 		= 	register_cvar( "fs_max_hp", "200" );
	max_ap 		= 	register_cvar( "fs_max_ap", "300" );
	
	//Ham's
	RegisterHam( Ham_Killed, "player", "Ham_CBasePlayer_Killed_Post", true );
	RegisterHam( Ham_Spawn, "player", "fwHamPlayerSpawnPost", 1 ); 
	RegisterHam( Ham_TakeDamage, "player", "Player_TakeDamage" );
	
	//Curent Weapon
	register_event ( "CurWeapon", "Current_Weapon", "be", "1=1" );
	
	//Max Players
	g_iMaxPlayers = get_maxplayers ( );
}

//Precache
public plugin_precache( ) 
{
	static i;
	for( i = 0 ; i < sizeof ( SK ); i++ ) 
		precache_model( SK [ i ] );
	for( i = 0 ; i < sizeof ( SKV ); i++ ) 
		precache_model( SKV [ i ] );

	precache_sound( PICK_GUN );

	return PLUGIN_CONTINUE;
}

//Killed
public Ham_CBasePlayer_Killed_Post( id ) 
{
     	HasSK[ id ] = false;
	HasSKV[ id ] = false;
}
	
//Spawn
public fwHamPlayerSpawnPost( id ) 
{
	if( cs_get_user_team(id) == CS_TEAM_CT )
	{
     		HasSK[ id ] = false;
		HasSKV[ id ] = false;
	}
}	

//Put in Server
public client_putinserver( id ) 
{
     	HasSK[ id ] = false;
	HasSKV[ id ] = false;
}
	
//Open Shop
public Func_Say( id ) 
{
	new szSaid[ 192 ];
	read_args( szSaid, sizeof( szSaid ) -1 );
	
	remove_quotes( szSaid );
	
	if( contain( szSaid, "shop" ) != -1 && !is_user_alive(id))
	{
		CheckTeam( id );
		return 1;
	}
	else if( contain( szSaid, "shop" ) != -1 && is_user_alive(id))
		CheckTeam( id );
	return 0;
}

//Show Model
public Current_Weapon( id ) 
{
	new weapon = get_user_weapon( id );
	if( weapon == CSW_KNIFE ) 
	{
		if( HasSK[ id ] == true ) 
		{
			set_pev ( id, pev_viewmodel2, SK[ 0 ] );
			set_pev ( id, pev_weaponmodel2, SK[ 1 ] );
		}
		else if( HasSKV[ id ] ) 
		{
			set_pev ( id, pev_viewmodel2, SKV[ 0 ] );
			set_pev ( id, pev_weaponmodel2, SKV[ 1 ] );
		}
	}
}

//Damage
public Player_TakeDamage( iVictim, iInflictor, iAttacker, Float:fDamage ) 
{
	if ( iInflictor == iAttacker && IsPlayer ( iAttacker ) && HasSK [ iAttacker ] ) 
	{
		SetHamParamFloat ( 4, fDamage * get_pcvar_float( sk_damage ) );
		return HAM_HANDLED;
	}
	if ( iInflictor == iAttacker && IsPlayer ( iAttacker ) && HasSKV [ iAttacker ] ) 
	{
		SetHamParamFloat ( 4, fDamage * get_pcvar_float( skv_damage ) );
		return HAM_HANDLED;
	}
	return HAM_IGNORED;
	
}

//Check Team Shop
public CheckTeam( id ) 
{
	if( is_user_alive ( id ) ) 
	{
		if ( get_user_team ( id ) == 1 )
			ShowMenu_T( id );
		if ( get_user_team ( id ) == 2 ) 
			ShowMenu_CT( id );
	}	
}

//T Shop
public ShowMenu_T( id ) 
{
	new menu_t = menu_create( "\rFurien \yShop^n", "T_Menu" );

	new iLine1 [ 200 ];
	new iLine2 [ 200 ];
	new iLine3 [ 200 ];
	new iLine4 [ 200 ];
	new iLine5[ 200 ];

	formatex( iLine1 , sizeof ( iLine1 ) -1 , "SuperKnife\R\y%i" , get_pcvar_num( sk_price ) );
	formatex( iLine2 , sizeof ( iLine2 ) -1 , "He\R\y%i" , get_pcvar_num( he_t_price ) );
	formatex( iLine3 , sizeof ( iLine3 ) -1 , "HP +50\R\y%i" , get_pcvar_num( hp_price ) );
	formatex( iLine4 , sizeof ( iLine4 ) -1 , "AP +50\R\y%i" , get_pcvar_num( ap_price ) );
	if(!(HasSK[id]||HasSKV[id]))	formatex( iLine5 , sizeof ( iLine5 ) -1 , "SuperKnifeVIP\R\y%i" , get_pcvar_num( skv_price ) );
	else	formatex( iLine5 , sizeof ( iLine5 ) -1 , "\dSuperKnifeVIP\R\y%i" , get_pcvar_num( skv_price ) );

	menu_additem( menu_t, iLine1, "1" ); 
	menu_additem( menu_t, iLine2, "2" );
	menu_additem( menu_t, iLine3, "3" );
	menu_additem( menu_t, iLine4, "4" ); 
	menu_additem( menu_t, iLine5, "5",is_vip(id) ); 

	menu_setprop( menu_t, MPROP_EXIT, MEXIT_ALL );
	menu_setprop( menu_t, MPROP_NOCOLORS, 1 );
	menu_setprop( menu_t, MPROP_NUMBER_COLOR, "\y" );
	
	menu_display( id, menu_t, 0 );
	
	return PLUGIN_HANDLED;
}

public T_Menu( id, menu_t, item )
{
	if( item == MENU_EXIT || get_user_team( id ) != 1 )	return PLUGIN_HANDLED;
	
	new command[ 6 ], name[ 64 ], access, callback;
	menu_item_getinfo( menu_t, item, access, command, sizeof command - 1, name, sizeof name - 1, callback );
	
	new price;
	price = cs_get_user_money( id );
	
	switch(item)
	{
		case 0: 
		{
			if( price >= get_pcvar_num( sk_price ) ) 
			{
				if ( !(HasSK [ id ]||HasSKV[id]) ) 
				{
					//Get Money
					cs_set_user_money( id, price - get_pcvar_num( sk_price ) );

					//Pev SuperKnife
					if( get_user_weapon( id ) == CSW_KNIFE ) 
					{
						set_pev ( id, pev_viewmodel2, SK[ 0 ] );
						set_pev ( id, pev_weaponmodel2, SK[ 1 ] );
					}
					else	engclient_cmd( id, "weapon_knife" );

					//Give SuperKnife
					HasSK[ id ] = true;

					//Sound
					emit_sound( id, CHAN_ITEM, PICK_GUN, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );	
				}
				else 
					ColorChat( id, "^x04%s^x01 Ai deja^x03 SuperKnife !", szPrefix );
			}
			else 
				ColorChat( id, "^x04%s^x01 Nu ai destui^x03 bani!^x01 Ai nevoie de^x03 %d$ !", szPrefix, get_pcvar_num( sk_price ) );	
		}
		case 1: 
		{
			if( price >= get_pcvar_num( he_t_price ) ) 
			{
				if( ! user_has_weapon( id ,  CSW_HEGRENADE ) ) 
				{
					//Get Money
					cs_set_user_money( id, price - get_pcvar_num( he_t_price ) );

					//Give He
					give_item( id, "weapon_hegrenade" );

				}
				else 
					ColorChat( id, "^x04%s^x01 Ai deja ^x03 He Grenade !", szPrefix );
			}
			else 
				ColorChat( id, "^x04%s^x01 Nu ai destui^x03 bani!^x01 Ai nevoie de^x03 %d$ !", szPrefix, get_pcvar_num( he_t_price ) );		
		}
		case 2: 
		{
			if( price >= get_pcvar_num( hp_price ) ) 
			{
				if( get_user_health( id ) < get_pcvar_num( max_hp ) ) 
				{
					//Get Money
					cs_set_user_money( id, price - get_pcvar_num( hp_price ) );

					//Give Health
					set_user_health( id, get_user_health ( id ) + 50 );

					//Sound
					emit_sound( id, CHAN_ITEM, PICK_GUN, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
					
					//Verify
					if( get_user_health( id ) > get_pcvar_num( max_hp ) )
						set_user_health( id, get_pcvar_num( max_hp ) );
				}
				else 
					ColorChat( id, "^x04%s^x01 Ai atins limita de^x03 %d HP !", szPrefix, get_pcvar_num( max_hp ) );
			}
			else 
				ColorChat( id, "^x04%s^x01 Nu ai destui^x03 bani!^x01 Ai nevoie de^x03 %d$ !", szPrefix, get_pcvar_num( hp_price ) );		
		}
		case 3: 
		{
			if( price >= get_pcvar_num( ap_price ) ) 
			{
				if( get_user_armor ( id ) < get_pcvar_num( max_ap ) ) 
				{
					//Get Money
					cs_set_user_money( id, price - get_pcvar_num( ap_price ) );

					//Give AP
					set_user_armor( id, get_user_armor( id ) + 50 );

					//Sound
					emit_sound( id, CHAN_ITEM, PICK_GUN, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
					
					//Verify
					if( get_user_armor( id ) > get_pcvar_num( max_ap ) )
						set_user_armor( id, get_pcvar_num( max_ap ) );
				}
				else 
					ColorChat( id, "^x04%s^x01 Ai atins limita de^x03 %d AP !", szPrefix, get_pcvar_num( max_ap ) );
			}
			else
				ColorChat( id, "^x04%s^x01 Nu ai destui^x03 bani!^x01 Ai nevoie de^x03 %d$ !", szPrefix, get_pcvar_num( ap_price ) );	
		}	
		case 4: 
		{
			if( price >= get_pcvar_num( skv_price ) ) 
			{
				if ( !(HasSKV [ id ]||HasSK[id]) ) 
				{
					//Get Money
					cs_set_user_money( id, price - get_pcvar_num( skv_price ) );

					//Pev SuperKnife
					if( get_user_weapon( id ) == CSW_KNIFE ) 
					{
						set_pev ( id, pev_viewmodel2, SKV[ 0 ] );
						set_pev ( id, pev_weaponmodel2, SKV[ 1 ] );
					}
					else
						engclient_cmd( id, "weapon_knife" );

					//Give SuperKnife
					HasSKV[ id ] = true;

					//Sound
					emit_sound( id, CHAN_ITEM, PICK_GUN, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );	
				}
				else 	ColorChat( id, "^x04%s^x01 Ai deja^x03 SuperKnife VIP!", szPrefix );
			}
			else 	ColorChat( id, "^x04%s^x01 Nu ai destui^x03 bani!^x01 Ai nevoie de^x03 %d$ !", szPrefix, get_pcvar_num( skv_price ) );	
		}
	}
	menu_destroy( menu_t );
	return PLUGIN_HANDLED;
}

//CT Shop
public ShowMenu_CT( id ) 
{
	new menu_ct = menu_create( "\rAnti-Furien \yShop^n", "CT_Menu" );

	new iLine1 [ 200 ];
	new iLine2 [ 200 ];
	new iLine3 [ 200 ];
	new iLine4 [ 200 ];

	formatex( iLine1 , sizeof ( iLine1 ) -1 , "Defuse\R\y%i" , get_pcvar_num( defuse_price ) );
	formatex( iLine2 , sizeof ( iLine2 ) -1 , "He\R\y%i" , get_pcvar_num( he_ct_price ) );
	formatex( iLine3 , sizeof ( iLine3 ) -1 , "HP +50\R\y%i" , get_pcvar_num( hp_price ) );
	formatex( iLine4 , sizeof ( iLine4 ) -1 , "AP +50\R\y%i" , get_pcvar_num( ap_price ) );

	menu_additem( menu_ct, iLine1, "1" ); 
	menu_additem( menu_ct, iLine2, "2" );
	menu_additem( menu_ct, iLine3, "3" );
	menu_additem( menu_ct, iLine4, "4" ); 

	menu_setprop( menu_ct, MPROP_EXIT, MEXIT_ALL );
	menu_setprop( menu_ct, MPROP_NOCOLORS, 1 );
	menu_setprop( menu_ct, MPROP_NUMBER_COLOR, "\y" );
	
	menu_display( id, menu_ct, 0 );
	
	return PLUGIN_HANDLED;
}

public CT_Menu( id, menu_ct, item )
{
	if( item == MENU_EXIT || get_user_team( id ) != 2 )
		return PLUGIN_HANDLED;
	
	new  command[ 6 ], name[ 64 ], access, callback;
	
	new price;
	price = cs_get_user_money( id );
	
	menu_item_getinfo( menu_ct, item, access, command, sizeof command - 1, name, sizeof name - 1, callback );
	
	switch(item)
	{
		case 0: 
		{
			if( price >= get_pcvar_num( defuse_price ) ) 
			{
				if ( !cs_get_user_defuse( id ) ) 
				{
					//Get Money
					cs_set_user_money( id, price - get_pcvar_num( defuse_price ) );

					//Give DefuseKit
					cs_set_user_defuse( id,1 );
		
					//Sound
                                	emit_sound( id, CHAN_ITEM, PICK_GUN, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
				}
				else 
					ColorChat( id, "^x04%s^x01 Ai deja^x03 DefuseKIT !", szPrefix );
			}
			else 
				ColorChat( id, "^x04%s^x01 Nu ai destui^x03 bani!^x01 Ai nevoie de^x03 %d$ !", szPrefix, get_pcvar_num( defuse_price ) );
		}
		case 1: 
		{
			if( price >= get_pcvar_num( he_ct_price ) ) 
			{
				if( ! user_has_weapon( id ,  CSW_HEGRENADE ) ) 
				{
					//Get Money
					cs_set_user_money( id, price - get_pcvar_num( he_ct_price ) );

					//Give He
					give_item( id, "weapon_hegrenade" );	
				}
				else 
					ColorChat( id, "^x04%s^x01 Ai deja^x03 He Grenade !", szPrefix );
			}
			else 
				ColorChat( id, "^x04%s^x01 Nu ai destui^x03 bani!^x01 Ai nevoie de^x03 %d$ !", szPrefix, get_pcvar_num( he_ct_price ) );	
		}
		case 2: 
		{
			if( price >= get_pcvar_num( hp_price ) ) 
			{
				if( get_user_health( id ) < get_pcvar_num( max_hp ) ) 
				{
					//Get Money
					cs_set_user_money( id, price - get_pcvar_num( hp_price ) );

					//Give Health
					set_user_health ( id, get_user_health ( id ) + 50 );

					//Sound
					emit_sound( id, CHAN_ITEM, PICK_GUN, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
					
					//Verify
					if( get_user_health( id ) > get_pcvar_num( max_hp ) )
						set_user_health( id, get_pcvar_num( max_hp ) );
				}
				else 
					ColorChat( id, "^x04%s^x01 Ai atins limita de^x03 %d HP !", szPrefix, get_pcvar_num( max_hp ) );
			}
			else 
				ColorChat( id, "^x04%s^x01 Nu ai destui^x03 bani!^x01 Ai nevoie de^x03 %d$ !", szPrefix, get_pcvar_num( hp_price ) );		
		}
		case 3: 
		{
			if( price >= get_pcvar_num( ap_price ) ) 
			{
				if( get_user_armor( id ) < get_pcvar_num( max_ap ) ) 
				{
					//Get Money
					cs_set_user_money( id,price- get_pcvar_num( ap_price ) );

					//Give AP
					set_user_armor( id, get_user_armor( id ) + 50 );

					//Sound
					emit_sound( id, CHAN_ITEM, PICK_GUN, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
					
					//Verify
					if( get_user_armor( id ) > get_pcvar_num( max_ap ) )
						set_user_armor( id, get_pcvar_num( max_ap ) );
				}
				else 
					ColorChat( id, "^x04%s^x01 Ai atins limita de^x03 %d AP !", szPrefix, get_pcvar_num( max_ap ) );
			}
			else
				ColorChat( id, "^x04%s^x01 Nu ai destui^x03 bani!^x01 Ai nevoie de^x03 %d$ !", szPrefix, get_pcvar_num( ap_price ) );	
		}	
	}
	menu_destroy( menu_ct );
	
	return PLUGIN_HANDLED;
}

//Stock ColorChat
stock ColorChat( const id, const input[ ], any:... ) 
{
	new count = 1, players[ 32 ];
	static msg[ 191 ];
	vformat( msg, 190, input, 3 );
	
	replace_all( msg, 190, "!g", "^4" );
	replace_all( msg, 190, "!y", "^1" );
	replace_all( msg, 190, "!t", "^3" );
	
	if( id ) players[ 0 ] = id;
	else get_players( players, count, "ch" ); 
	for( new i = 0; i < count; i++ ) 
	{
			if( is_user_connected( players[ i ] ) ) 
			{
				message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "SayText" ), _, players[ i ] );
				write_byte( players[ i ] );
				write_string( msg );
				message_end( );
			}
	}
}
Faceți cerere bine detaliată aici și respectând modelul dacă vreți ajutor. Nu-mi mai dați add doar pentru a mă avea în lista de prieteni.
Aveți grijă la cei ce încearcă să mă copieze..Puteți lua legătura cu mine dacă aveți o problemă/nelămurire în acest caz! (am cont doar aici & pe csbd.com)
În cazul în care utilizați ceva din addonsurile postate de mine aici, e bine să fiți la curent cu modificările aduse unor plugine, aici, iar dacă sunt ceva probleme sau aveți dvs. probleme nu ezitați să luați legătura cu mine. Actualizarea unor coduri nu se va posta la actual, doar dacă se găsește ceva critic/urgent de remediat, fiind coduri vechi, iar unele refăcute recent.
* Cumpăr orice tip de cont steam cu level 333 sau 666(nu contează vac status, sau jocurile)
* my little store - anunturi/lev-shop-t370037.html
Post Reply

Return to “Modificari pluginuri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 8 guests