Modificare Plugin Shop

Modificari necesare ale pluginurilor

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
Ykaru
Membru, skill 0
Membru, skill 0
Posts: 73
Joined: 29 Jul 2019, 00:33
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Has thanked: 11 times

01 May 2021, 21:33

Salut, ar putea cineva sa adauge tracer cand tragi cu ak si m4a1 ?
Vreau ca tracerul la ak-ul din primul plugin sa fie adaugat la ak-ul si m4a1 din pluginul de shop+vip
Asta e pluginu cu ak care are deja tracer (liniil galbene cand tragi)
| Afiseaza codul
/* AMX Mod script
* 
* (c) 2009, AlejandroSk
* This file is provided as is (no warranties).
*
*/



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

#define AK_COST 650

#define is_valid_player(%1) (1 <= %1 <= 32)

native fcs_get_user_credits ( Index );
native fcs_set_user_credits ( Index, Amount );

const PRIMARY_WEAPONS_BIT_SUM = (1<<CSW_AK47)

new AK_V_MODEL[64] = "models/v_golden_ak47.mdl"

/* Pcvars */
new cvar_dmgmultiplier, cvar_goldbullets,  cvar_custommodel, cvar_uclip, cvar_cost

new bool:g_HasAk[33]

new g_hasZoom[ 33 ]
new bullets[ 33 ]

// Sprite
new m_spriteTexture

const Wep_ak47 = ((1<<CSW_AK47))

public plugin_init()
{
	
	/* CVARS */
	cvar_dmgmultiplier = register_cvar("goldenak_vip_dmg_multiplier", "5")
	cvar_custommodel = register_cvar("goldenak_vip_custom_model", "1")
	cvar_goldbullets = register_cvar("goldenak_vip_gold_bullets", "1")
	cvar_uclip = register_cvar("goldenak_vip_unlimited_clip", "0")
	cvar_cost = register_cvar("goldenak_vip_cost", "0")
	
	// Register The Buy Cmd
	register_clcmd("akgoldnak", "CmdBuyAk")
	register_concmd("amx_goldenakasasdad", "CmdGiveAk", ADMIN_RCON, "<name>")
	
	// Register The Plugin
	register_plugin("Golden Ak 47", "1.0", "AlejandroSk")
	// Death Msg
	register_event("DeathMsg", "Death", "a")
	// Weapon Pick Up
	register_event("WeapPickup","checkModel","b","1=19")
	// Current Weapon Event
	register_event("CurWeapon","checkWeapon","be","1=1")
	register_event("CurWeapon", "make_tracer", "be", "1=1", "3>0")
	// Ham TakeDamage
	RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")
	register_forward( FM_CmdStart, "fw_CmdStart" )
	RegisterHam(Ham_Spawn, "player", "fwHamPlayerSpawnPost", 1)
	
}

public client_connect(id)
{
	g_HasAk[id] = false
}

public client_disconnect(id)
{
	g_HasAk[id] = false
}

public Death()
{
	g_HasAk[read_data(2)] = false
}

public fwHamPlayerSpawnPost(id)
{
	g_HasAk[id] = false
}

public plugin_precache()
{
	precache_model(AK_V_MODEL)
	m_spriteTexture = precache_model("sprites/dot.spr")
	precache_sound("weapons/zoom.wav")
}

public checkModel(id)
{
	if ( !g_HasAk[id] )
		return PLUGIN_HANDLED
	
	new szWeapID = read_data(2)
	
	if ( szWeapID == CSW_AK47 && g_HasAk[id] == true && get_pcvar_num(cvar_custommodel) )
	{
		set_pev(id, pev_viewmodel2, AK_V_MODEL)
	}
	return PLUGIN_HANDLED
}

public checkWeapon(id)
{
	new plrClip, plrAmmo, plrWeap[32]
	new plrWeapId
	
	plrWeapId = get_user_weapon(id, plrClip , plrAmmo)
	
	if (plrWeapId == CSW_AK47 && g_HasAk[id])
	{
		checkModel(id)
	}
	else 
	{
		return PLUGIN_CONTINUE
	}
	
	if (plrClip == 0 && get_pcvar_num(cvar_uclip))
	{
		// If the user is out of ammo..
		get_weaponname(plrWeapId, plrWeap, 31)
		// Get the name of their weapon
		give_item(id, plrWeap)
		engclient_cmd(id, plrWeap) 
		engclient_cmd(id, plrWeap)
		engclient_cmd(id, plrWeap)
	}
	return PLUGIN_HANDLED
}



public fw_TakeDamage(victim, inflictor, attacker, Float:damage)
{
	if ( is_valid_player( attacker ) && get_user_weapon(attacker) == CSW_AK47 && g_HasAk[attacker] )
	{
		SetHamParamFloat(4, damage * get_pcvar_float( cvar_dmgmultiplier ) )
	}
}

public fw_CmdStart( id, uc_handle, seed )
{
	if( !is_user_alive( id ) ) 
		return PLUGIN_HANDLED
	
	if( ( get_uc( uc_handle, UC_Buttons ) & IN_ATTACK2 ) && !( pev( id, pev_oldbuttons ) & IN_ATTACK2 ) )
	{
		new szClip, szAmmo
		new szWeapID = get_user_weapon( id, szClip, szAmmo )
		
		if( szWeapID == CSW_AK47 && g_HasAk[id] == true && !g_hasZoom[id] == true)
		{
			g_hasZoom[id] = true
			cs_set_user_zoom( id, CS_SET_AUGSG552_ZOOM, 0 )
			emit_sound( id, CHAN_ITEM, "weapons/zoom.wav", 0.20, 2.40, 0, 100 )
		}
		
		else if ( szWeapID == CSW_AK47 && g_HasAk[id] == true && g_hasZoom[id])
		{
			g_hasZoom[ id ] = false
			cs_set_user_zoom( id, CS_RESET_ZOOM, 0 )
			
		}
		
	}
	return PLUGIN_HANDLED
}


public make_tracer(id)
{
	if (get_pcvar_num(cvar_goldbullets))
	{
		new clip,ammo
		new wpnid = get_user_weapon(id,clip,ammo)
		new pteam[16]
		
		get_user_team(id, pteam, 15)
		
		if ((bullets[id] > clip) && (wpnid == CSW_AK47) && g_HasAk[id]) 
		{
			new vec1[3], vec2[3]
			get_user_origin(id, vec1, 1) // origin; your camera point.
			get_user_origin(id, vec2, 4) // termina; where your bullet goes (4 is cs-only)
			
			
			//BEAMENTPOINTS
			message_begin( MSG_BROADCAST,SVC_TEMPENTITY)
			write_byte (0)     //TE_BEAMENTPOINTS 0
			write_coord(vec1[0])
			write_coord(vec1[1])
			write_coord(vec1[2])
			write_coord(vec2[0])
			write_coord(vec2[1])
			write_coord(vec2[2])
			write_short( m_spriteTexture )
			write_byte(1) // framestart
			write_byte(5) // framerate
			write_byte(2) // life
			write_byte(10) // width
			write_byte(0) // noise
			write_byte( 255 )     // r, g, b
			write_byte( 215 )       // r, g, b
			write_byte( 0 )       // r, g, b
			write_byte(200) // brightness
			write_byte(150) // speed
			message_end()
		}
		
		bullets[id] = clip
	}
	
}

public CmdBuyAk(id)
{
	if ( cs_get_user_team ( id ) != CS_TEAM_CT )
	{
		client_print ( id, print_chat, "Trebuie sa fii in echipa CT pentru a folosi asta" );

		return PLUGIN_HANDLED;
	}

	if ( fcs_get_user_credits ( id ) < AK_COST )
	{
		client_print ( id, print_chat, "Nu ai suficiente credite. Mai ai nevoie de %d credite", AK_COST - fcs_get_user_credits ( id ) );

		return PLUGIN_HANDLED;
	}

	if ( g_HasAk [id] )
	{
		client_print ( id, print_chat, "Ai luat deja arma runda aceasta!" );

		return PLUGIN_HANDLED;
	}

	DropSecondary ( id );

	fcs_set_user_credits ( id, fcs_get_user_credits ( id ) - AK_COST );

	give_item ( id, "weapon_ak47" );

	cs_set_user_bpammo ( id, CSW_AK47, 30 );

	g_HasAk [id] = true;
	
	return PLUGIN_HANDLED;
}

public CmdGiveAk(id,level,cid)
{
	if (!cmd_access(id,level,cid,2))
		return PLUGIN_HANDLED;
	new arg[32];
	read_argv(1,arg,31);
	
	new player = cmd_target(id,arg,7);
	if (!player) 
		return PLUGIN_HANDLED;
	
	new name[32];
	get_user_name(player,name,31);
	
	give_item(player, "weapon_ak47")
	g_HasAk[player] = true
	
	return PLUGIN_HANDLED
}

stock DropSecondary ( id )
{
	static Weapons [32], Num, i, WeaponID;

	Num = 0;

	get_user_weapons ( id, Weapons, Num );

	for ( i = 0; i < Num; i ++ )
	{
		WeaponID = Weapons [ i ] ;

		if ( 1 << WeaponID & PRIMARY_WEAPONS_BIT_SUM )
		{
			static WName [32];

			get_weaponname ( WeaponID, WName, charsmax ( WName ) );

			engclient_cmd ( id, "drop", WName );
		}
	}

	return 1;
}

stock drop_prim(id) 
{
	new weapons[32], num
	get_user_weapons(id, weapons, num)
	for (new i = 0; i < num; i++) {
		if (Wep_ak47 & (1<<weapons)) 
		{
			static wname[32]
			get_weaponname(weapons, wname, sizeof wname - 1)
			engclient_cmd(id, "drop", wname)
		}
	}
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1034\\ f0\\ fs16 \n\\ par }
*/

Asta e pluginu de shop + vip
| Afiseaza codul
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <engine>
#include <fun>
#include <hamsandwich>
#include <fakemeta>
#include <vault>

// Plugins

#define PLUGIN "BaseBuilder: Shop"
#define VERSION "1.2.20"
#define AUTHOR "MRS-Version"


// Ddefine-uri
#define IsPlayer(%0)    ( 1 <= %0 <= g_iMaxPlayers )
#define ADMIN_VIP	ADMIN_LEVEL_H // Acces vip flag T

#pragma semicolon 1
#pragma tabsize 0

// Native
native fcs_get_user_credits ( id );
native fcs_set_user_credits ( id, credits );


// Variabile 
new Tag[] = "!g[!teamBB.LeagueCS.Ro | Shop!g]"; // Aici poti pune tag-ul [BB.Nume.Ro] Ai cumparat
new Speed[33];
new g_iMaxPlayers;
new VipUsed[33];
new HasSpeed;

// Bool-uri
new bool:q_M4A1[33], bool:q_AK47[33], bool:q_Deagle[33], bool:q_Knife[33], Runda[33];
new bool: GodMode[33];
new bool:g_bHasKnifeB[33];
new bool:g_bHasKnifeW[33];
new bool:g_bHasAk47[33];
new bool:g_bHasDeagle[33];
new Float:normal_speed = 250.0;


// Modele
new M4A1Gold[66] = "models/Shop_Nak/v_m4a1nak2k21.mdl";
new AK47Gold[66] = "models/Shop_Nak/v_ak472k21.mdl";
new DeagleGold[66] = "models/Shop_Nak/v_deaglenak2k21.mdl";
new Knife[66] = "models/Shop_Nak/baros.mdl";
new const g_szKnifeBModel[] = "models/cutat.mdl";
new const g_szKnifeWModel[] = "models/bardita_nak2k21.mdl";
new const g_szAk47Model[] = "models/Shop_Nak/v_ak472k21.mdl";
new const g_szDeagleModel[] = "models/Shop_Nak/v_deaglenak2k21.mdl";


public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR);
	register_event("HLTV", "event_new_round", "a", "1=0", "2=0");
	register_event("CurWeapon", "event_curweapon", "be", "1=1");
	RegisterHam ( Ham_TakeDamage, "player", "Player_TakeDamage" );
	RegisterHam(Ham_Spawn, "player", "FwdHamSpawn_Post", 1);
	RegisterHam(Ham_Item_PreFrame, "player", "FwdPreFrame_Post", 1);
	register_forward ( FM_PlayerPreThink, "ForcePlayerSpeed" );

	// Comenzi
    register_clcmd("say /shop","Shop");
	register_clcmd("say_team /shop", "Shop");
	register_clcmd("say vmenu", "cmdVmenu");
	register_clcmd("say /vmenu", "cmdVmenu");
	register_clcmd("say_team vmenu", "cmdVmenu");
	register_clcmd("say_team /vmenuu", "cmdVmenu");
	register_clcmd("say vip", "cmdBuyvip");
	register_clcmd("say /vip", "cmdBuyvip");
	register_clcmd("say_team vip", "cmdBuyvip");
	register_clcmd("say_team /vip", "cmdBuyvip");

	g_iMaxPlayers = get_maxplayers();
}


public Player_TakeDamage ( iVictim, iInflictor, iAttacker, Float:fDamage )
{

	if(iInflictor == iAttacker 
	&& iAttacker != iVictim 
	&& g_bHasKnifeB[ iAttacker ] 
	&& is_user_alive(iAttacker) 
	&& get_user_weapon(iAttacker) == CSW_KNIFE )

{
	SetHamParamFloat(4, fDamage * 2.0);

}

	if(iInflictor == iAttacker 

&& iAttacker != iVictim 
&& g_bHasAk47[ iAttacker ]
&& is_user_alive(iAttacker) 
&& get_user_weapon(iAttacker) == CSW_AK47 )
{
SetHamParamFloat(4, fDamage * 2.0);
}
	if(iInflictor == iAttacker 

&& iAttacker != iVictim 
&& g_bHasDeagle[ iAttacker ]
&& is_user_alive(iAttacker) 
&& get_user_weapon(iAttacker) == CSW_DEAGLE )
{
SetHamParamFloat(4, fDamage * 2.0);
}

	if ( iInflictor == iAttacker && IsPlayer ( iAttacker ) && get_user_weapon ( iAttacker ) == CSW_KNIFE && q_Knife[ iAttacker ] ) 

		SetHamParamFloat ( 4, fDamage * 2 );

	if( iInflictor == iAttacker && IsPlayer ( iAttacker ) && get_user_weapon( iAttacker ) == CSW_AK47 && q_AK47[ iAttacker ])

		SetHamParamFloat ( 4, fDamage * 2 );

	if( iInflictor == iAttacker && IsPlayer ( iAttacker ) && get_user_weapon( iAttacker ) == CSW_M4A1 && q_M4A1[ iAttacker ])

		SetHamParamFloat ( 4, fDamage * 2 );

	if( iInflictor == iAttacker && IsPlayer ( iAttacker ) && get_user_weapon( iAttacker ) == CSW_DEAGLE && q_Deagle[ iAttacker ])

		SetHamParamFloat ( 4, fDamage * 2 );

	return HAM_IGNORED;

}

public FwdHamSpawn_Post(id)

{
	if (!is_user_alive(id))

	return PLUGIN_HANDLED;

HasSpeed = false;
VipUsed[id] = false;
g_bHasKnifeB[id] = false; 
g_bHasKnifeW[id] = false; 
g_bHasAk47[id] = false; 
g_bHasDeagle[id] = false; 
Runda[id] = 0;
GodMode[id] = false;
Speed[id] = false;
set_user_rendering( id, _, 0, 0, 0, _, 0 );
return PLUGIN_HANDLED;
}  

public event_new_round()
{
	new iPlayers[32], iNum;
	get_players(iPlayers, iNum);
	for(new i = 0;i < iNum; i++)
	{
	q_M4A1[iPlayers]=false;
	q_AK47[iPlayers]=false;
	q_Deagle[iPlayers]=false;
	q_Knife[iPlayers]=false;
	Runda[iPlayers]=0;
	GodMode[iPlayers] = false;
	}

}
// Precache line
public plugin_precache( ) 
{	
	precache_model(Knife);
	precache_model(M4A1Gold);
	precache_model(AK47Gold);
	precache_model(DeagleGold);
	precache_model(g_szKnifeBModel);
	precache_model(g_szAk47Model);
	precache_model(g_szKnifeWModel);
	precache_model(g_szDeagleModel);
}

public event_curweapon( id )
{

	if(get_user_weapon(id) == CSW_KNIFE && q_Knife[id])
	{
		set_pev(id, pev_viewmodel2, Knife);
	}
	else if(get_user_weapon(id) == CSW_M4A1 && q_M4A1[id])
	{

		set_pev(id, pev_viewmodel2, M4A1Gold);
	}
	else if(get_user_weapon(id) == CSW_AK47 && q_AK47[id])
	{

		set_pev(id, pev_viewmodel2, AK47Gold);
	}
	else if(get_user_weapon(id) == CSW_DEAGLE && q_Deagle[id])
	{

		set_pev(id, pev_viewmodel2, DeagleGold);
	}
	if(g_bHasKnifeB[id] && read_data(2) == CSW_KNIFE)

{
set_pev(id, pev_viewmodel2, g_szKnifeBModel);
set_user_gravity(id, 0.5);

}
	if(g_bHasAk47[id] && read_data(2) == CSW_AK47)

{
	set_pev(id, pev_viewmodel2, g_szAk47Model);
}
	if(g_bHasDeagle[id] && read_data(2) == CSW_DEAGLE)
{

	set_pev(id, pev_viewmodel2, g_szDeagleModel);
}
}

public FwdPreFrame_Post(id)

{
	if(!is_user_alive(id))
{
return PLUGIN_HANDLED;
}
if(!HasSpeed)
{
return PLUGIN_HANDLED;
}
else if(HasSpeed)
{
set_user_maxspeed(id, normal_speed);
}
return PLUGIN_HANDLED;
}

public ForcePlayerSpeed ( id ) 
{
	if ( Speed [ id ] )
	{
		set_pev ( id, pev_maxspeed, 320.0 );
	}
}

public Shop( id )
{
	if( Runda[id] < 2 )
	{
	if( get_user_team(id) == 1 )
	{
	ShowShopZM(id);
	}
	else if(get_user_team(id) == 2)
	{
	ShowShopCT(id);
	}
	}
	else
	{
	ChatColor(id, "%s!team Poti folosi !gShop-ul!team de !g2!team ori pe runda!",Tag); 
	return PLUGIN_HANDLED;
	}
	return PLUGIN_HANDLED;

}

public ShowShopZM ( id ) 
{

	if(!is_user_alive(id)) 

	{ 

	ChatColor(id, "%s!team Nu poti accesa meniul cand esti !gmort!team!",Tag); 

	return PLUGIN_HANDLED;

	} 

    

	new menu = menu_create ( "\r[BB.LeagueCs.Ro] \yShop ZM", "Menu_Giver_ZM" ); 

	menu_additem ( menu, "\rSuper Knife \yx2DMG \w[ \r200 Euro\w]", "0", 0 ); 
	menu_additem ( menu, "\yGravity \w[ \r150 Euro\w]", "1", 0 ); 
	menu_additem ( menu, "\yGodMode 5 secunde \w[ \r1000 Euro\w]", "2", 0);
	menu_additem ( menu, "\y1000 HP \w[ \r600 Euro\w]", "3", 0);
	menu_additem ( menu, "\y2000 HP \w[ \r1200 Euro\w]", "4", 0);

    

    	menu_setprop ( menu, MPROP_EXIT, MEXIT_ALL ); 

    	menu_display ( id, menu, 0 ); 

    	return PLUGIN_HANDLED;

}

public Menu_Giver_ZM ( id, menu, item, client ) 

{

    

		if(item == MENU_EXIT || !is_user_alive(id)) 

		{ 

		menu_destroy(menu);

		return PLUGIN_HANDLED;

		} 

    

    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 0:

        {

		if( is_user_alive(id) )

		{

	new iCredits = fcs_get_user_credits  ( id ) - 125; 

            	if ( iCredits < 0 ) 

	 	{ 

	new iCredits2 = 200 - fcs_get_user_credits (id);

		ChatColor(id, "%s!team Nu ai suficienti Euro! Mai ai nevoie de !g%i!team Euro!",Tag,iCredits2 );

                return PLUGIN_HANDLED; 

                

            }

            

            else 

			{

                set_pev ( id, pev_viewmodel2, Knife );

	            ChatColor(id, "%s!team Ai cumparat !gSuper Knife x2DMG!team.",Tag); 

                fcs_set_user_credits ( id, iCredits ); 

				q_Knife[id] = true;

				Runda[id]++;

                return PLUGIN_HANDLED; 

            }

			}

			else 

			{ 

				ChatColor(id, "%s!team Nu poti accesa meniul cand esti !gmort!team!",Tag); 

			}

		}

		case 1:

		{

			if( is_user_alive(id) )

			{

            new iCredits = fcs_get_user_credits  ( id ) - 150; 

            

            if ( iCredits < 0 ) 

			{ 

				new iCredits2 = 150 - fcs_get_user_credits (id);

                ChatColor(id, "%s!team Nu ai suficienti Euro! Mai ai nevoie de !g%i!team Euro!",Tag,iCredits2 );

                return PLUGIN_HANDLED; 

                

            }

            

            else 

			{

                set_user_gravity(id, 0.5); 

	            ChatColor(id, "%s!team Ai cumparat !gGravity!team.",Tag); 

                fcs_set_user_credits ( id, iCredits ); 

				Runda[id]++;

                return PLUGIN_HANDLED; 

				

            }

			}

			else 

			{ 

				ChatColor(id, "%s!team Nu poti accesa meniul cand esti !gmort!team!",Tag); 

			}

		}

		case 2:

		{

			if(is_user_alive(id) && GodMode[id] == false)

			{

            new iCredits = fcs_get_user_credits  ( id ) - 1000; 

            

            if ( iCredits < 0 ) 

			{ 

				new iCredits2 = 1000 - fcs_get_user_credits (id);

                ChatColor(id, "%s!team Nu ai suficienti Euro! Mai ai nevoie de !g%i!team Euro!",Tag,iCredits2 );

                return PLUGIN_HANDLED; 


            }

            

            else 

			{

                set_user_godmode(id, 1);

				set_task(5.0,"scoategodmode",id);

	            ChatColor(id, "%s!team Ai cumparat !gGodMode!team.",Tag); 

                fcs_set_user_credits ( id, iCredits ); 

				Runda[id]++;
				GodMode[id] = true;

                return PLUGIN_HANDLED; 

				

            }

			}

			else if(GodMode[id] == true)
			{
				ChatColor(id, "%s!team !gLa acest item este voie doar o data pe runda!",Tag); 
			}
			else 
			{
				ChatColor(id, "%s!teamNu se poate accesa meniul cand esti mort!",Tag);  
			}
        }
		case 3:

		{

			if( is_user_alive(id) )

			{

            new iCredits = fcs_get_user_credits  ( id ) - 600; 

            

            if ( iCredits < 0 ) 

			{ 

				new iCredits2 = 600 - fcs_get_user_credits (id);

                ChatColor(id, "%s!team Nu ai suficienti Euro! Mai ai nevoie de !g%i!team Euro!",Tag,iCredits2 );

                return PLUGIN_HANDLED; 

                

            }

            

            else 

			{

                set_user_health(id, get_user_health(id) + 1000);

	            ChatColor(id, "%s!team Ai cumparat !g1000 HP!team.",Tag); 

                fcs_set_user_credits ( id, iCredits ); 

				Runda[id]++;

                return PLUGIN_HANDLED; 

				

            }

			}

			else 

			{ 

				ChatColor(id, "%s!team Nu poti accesa meniul cand esti !gmort!team!",Tag); 

			}

		}

		case 4:

		{

			if( is_user_alive(id) )

			{

            new iCredits = fcs_get_user_credits  ( id ) - 1200; 

            

            if ( iCredits < 0 ) 

			{ 

				new iCredits2 = 1200 - fcs_get_user_credits (id);

                ChatColor(id, "%s!team Nu ai suficienti Euro! Mai ai nevoie de !g%i!team Euro!",Tag,iCredits2 );

                return PLUGIN_HANDLED; 

                

            }

            

            else 

			{

                set_user_health(id, get_user_health(id) + 2000);

	            ChatColor(id, "%s!team Ai cumparat !g2000 HP!team.",Tag); 

                fcs_set_user_credits ( id, iCredits ); 

				Runda[id]++;

                return PLUGIN_HANDLED; 

            }

			}

			else 

			{ 

				ChatColor(id, "%s!team Nu poti accesa meniul cand esti !gmort!team!",Tag); 

			}

		}

		

	}

	menu_destroy ( menu );

	return PLUGIN_HANDLED;

}

public ShowShopCT( id )

{

	static menu;

	menu = menu_create ("\r[BB.LeagueCs.Ro] \yShop CT","Menu_Giver_CT");

	menu_additem ( menu,"\y100 HP \w[ \r200 Euro\w]","0", 0 );
	menu_additem ( menu,"\yGrenade Pack \w[ \r100 Euro\w]","1", 0 );
	menu_additem ( menu,"\yGodMode 5 secunde \w[ \r1000 Euro\w]","2", 0 );
	menu_additem ( menu,"\ySpeed \w[ \r150 Euro\w]","3", 0 );
	menu_additem ( menu,"\yGravity \w[ \r150 Euro\w]","4", 0 );
	menu_additem ( menu,"\rAk47 \yX2DMG \w[ \r650 Euro\w]","5", 0 );
	menu_additem ( menu,"\rM4A1 \yX2DMG \w[ \r650 Euro\w]","6", 0 );
	menu_additem ( menu,"\rDeagle \yx2DMG \w[ \r500 Euro\w]","7", 0 );



	menu_setprop ( menu, MPROP_NUMBER_COLOR,"\y");

	menu_setprop ( menu, MPROP_EXIT, MEXIT_ALL );

	

	menu_display ( id, menu, 0 );

	return PLUGIN_HANDLED;

}

public Menu_Giver_CT ( id, menu, item, client ) 

{

    

		if(item == MENU_EXIT || !is_user_alive(id)) 

		{ 

		menu_destroy(menu); 

		return PLUGIN_HANDLED;

		} 

    

    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 0:

        {

			if( is_user_alive(id) )

			{

            new iCredits = fcs_get_user_credits  ( id ) - 200; 

            

            if ( iCredits < 0 ) 

			{ 

				new iCredits2 = 200 - fcs_get_user_credits (id);

                ChatColor(id, "%s!team Nu ai suficienti Euro! Mai ai nevoie de !g%i!team Euro!",Tag,iCredits2 );

                return PLUGIN_HANDLED; 

                

            }

            

            else 

			{

                set_user_health(id, get_user_health(id) + 100);

	            ChatColor(id, "%s!team Ai cumparat !g100 HP!team.",Tag); 

                fcs_set_user_credits ( id, iCredits ); 

				Runda[id]++;

                return PLUGIN_HANDLED; 

            }

			}

			else 

			{ 

				ChatColor(id, "%s!team Nu poti accesa meniul cand esti !gmort!team!",Tag); 

			}

		}

		case 1:

        {

			if( is_user_alive(id) )

			{

            new iCredits = fcs_get_user_credits  ( id ) - 50; 

            

            if ( iCredits < 0 ) 

			{ 

				new iCredits2 = 100 - fcs_get_user_credits (id);

                ChatColor(id, "%s!team Nu ai suficienti Euro! Mai ai nevoie de !g%i!team Euro!",Tag,iCredits2 );

                return PLUGIN_HANDLED; 

                

            }

            

            else 

			{

                give_item ( id,"weapon_flashbang" );

				give_item ( id,"weapon_hegrenade" );

				give_item ( id,"weapon_smokegrenade" );

	            ChatColor(id, "%s!team Ai cumparat !gGrenade Pack!team.",Tag); 

                fcs_set_user_credits ( id, iCredits ); 

				Runda[id]++;

                return PLUGIN_HANDLED; 

            }

			}

			else 

			{ 

				ChatColor(id, "%s!team Nu poti accesa meniul cand esti !gmort!team!",Tag); 

			}

		}

		case 2:

        {

			if(is_user_alive(id) && GodMode[id] == false)

			{

            new iCredits = fcs_get_user_credits  ( id ) - 1000; 

            

            if ( iCredits < 0 ) 

			{ 

				new iCredits2 = 1000 - fcs_get_user_credits (id);

                ChatColor(id, "%s!team Nu ai suficienti Euro! Mai ai nevoie de !g%i!team Euro!",Tag,iCredits2 );

                return PLUGIN_HANDLED; 

                

            }

            

            else 

			{

                set_user_godmode(id, 1);

				set_task(5.0,"scoategodmode",id);

	            ChatColor(id, "%s!team Ai cumparat !gGodMode!team.",Tag); 

                fcs_set_user_credits ( id, iCredits ); 

				Runda[id]++;
				GodMode[id] = true;

                return PLUGIN_HANDLED; 

            }

			}

			else if(GodMode[id] == true)
			{
				ChatColor(id, "%s!team !gLa acest item este voie doar o data pe runda!",Tag); 
			}
			else 
			{
				ChatColor(id, "%s!teamNu se poate accesa meniul cand esti mort!",Tag);  
			}
        }

		case 3:

		{

			if( is_user_alive(id) )

			{

            new iCredits = fcs_get_user_credits  ( id ) - 150; 

            

            if ( iCredits < 0 ) 

			{ 

				new iCredits2 = 150 - fcs_get_user_credits (id);

                ChatColor(id, "%s!team Nu ai suficienti Euro! Mai ai nevoie de !g%i!team Euro!",Tag,iCredits2 );

                return PLUGIN_HANDLED; 

                

            }

            

            else 

			{

                Speed[id] = true;

                ForcePlayerSpeed(id);

	            ChatColor(id, "%s!team Ai cumparat !gSpeed!team.",Tag); 

                fcs_set_user_credits ( id, iCredits ); 

				Runda[id]++;

                return PLUGIN_HANDLED; 

            }

			}

			else 

			{ 

				ChatColor(id, "%s!team Nu poti accesa meniul cand esti !gmort!team!",Tag); 

			}

		}

		case 4:

		{

			if( is_user_alive(id) )

			{

            new iCredits = fcs_get_user_credits  ( id ) - 150; 

            

            if ( iCredits < 0 ) 

			{ 

				new iCredits2 = 150 - fcs_get_user_credits (id);

                ChatColor(id, "%s!team Nu ai suficienti Euro! Mai ai nevoie de !g%i!team Euro!",Tag,iCredits2 );

                return PLUGIN_HANDLED; 

                

            }

            

            else 

			{

                set_user_gravity(id, 0.5);

	            ChatColor(id, "%s!team Ai cumparat !gGravity!team.",Tag); 

                fcs_set_user_credits ( id, iCredits ); 

				Runda[id]++;

                return PLUGIN_HANDLED; 

            }

			}

			else 

			{ 

				ChatColor(id, "%s!team Nu poti accesa meniul cand esti !gmort!team!",Tag); 

			}

		}

		case 5:

        {

			if( is_user_alive(id) )

			{

            new iCredits = fcs_get_user_credits  ( id ) - 650; 

            

            if ( iCredits < 0 ) 

			{ 

				new iCredits2 = 650 - fcs_get_user_credits (id);

                ChatColor(id, "%s!team Nu ai suficienti Euro! Mai ai nevoie de !g%i!team Euro!",Tag,iCredits2 );

                return PLUGIN_HANDLED; 

                

            }

            

            else 

			{

                give_item(id, "weapon_ak47");

				give_item(id,"ammo_762nato");

				give_item(id,"ammo_762nato");

				give_item(id,"ammo_762nato");

				q_AK47[id] = true;

	            ChatColor(id, "%s!team Ai cumparat !gAK47 Gold!team.",Tag); 

                fcs_set_user_credits ( id, iCredits ); 

				Runda[id]++;

                return PLUGIN_HANDLED; 

            }

			}

			else 

			{ 

				ChatColor(id, "%s!team Nu poti accesa meniul cand esti !gmort!team!",Tag); 

			}

		}

		case 6:

        {

			if( is_user_alive(id) )

			{

            new iCredits = fcs_get_user_credits  ( id ) - 650; 

            

            if ( iCredits < 0 ) 

			{ 

				new iCredits2 = 650 - fcs_get_user_credits (id);

                ChatColor(id, "%s!team Nu ai suficienti Euro! Mai ai nevoie de !g%i!team Euro!",Tag,iCredits2 );

                return PLUGIN_HANDLED; 

                

            }

            

            else 

			{

				give_item(id, "weapon_m4a1");

				give_item(id,"ammo_556nato");

				give_item(id,"ammo_556nato");

				give_item(id,"ammo_556nato");

				q_M4A1[id] = true;

	            ChatColor(id, "%s!team Ai cumparat !gM4A1 Gold!team.",Tag); 

                fcs_set_user_credits ( id, iCredits ); 

				Runda[id]++;

                return PLUGIN_HANDLED; 

            }

			}

			else 

			{ 

				ChatColor(id, "%s!team Nu poti accesa meniul cand esti !gmort!team!",Tag); 

			}

		}

		case 7:

        {

			if( is_user_alive(id) )

			{

            new iCredits = fcs_get_user_credits  ( id ) - 500; 

            

            if ( iCredits < 0 ) 

			{ 

				new iCredits2 = 500 - fcs_get_user_credits (id);

                ChatColor(id, "%s!team Nu ai suficienti Euro! Mai ai nevoie de !g%i!team Euro!",Tag,iCredits2 );

                return PLUGIN_HANDLED; 

                

            }

            

            else 

			{

				give_item(id, "weapon_deagle");

				give_item(id,"ammo_50ae");

				give_item(id,"ammo_50ae");

				give_item(id,"ammo_50ae");

				q_Deagle[id] = true;

	            ChatColor(id, "%s!team Ai cumparat !gDeagle Gold!team.",Tag); 

                fcs_set_user_credits ( id, iCredits ); 

				Runda[id]++;

                return PLUGIN_HANDLED; 

            }

			}

			else 

			{ 

				ChatColor(id, "%s!team Nu poti accesa meniul cand esti !gmort!team!",Tag); 

			}

		}

	}

	menu_destroy ( menu );

	return PLUGIN_HANDLED;

}

public scoategodmode(id) 
{ 
if( is_user_connected(id) )
{
set_user_godmode(id, 0 ); 
ChatColor(id, "%s!team A expirat timpul pentru !gGodMode!y!",Tag ); 
}
}
public cmdVmenu(id)
{
if(!(get_user_flags(id) & ADMIN_VIP))
{
ChatColor(id, "%s !gNumai membrii !tVIP pot folosi aceasta comanda!",Tag);
return PLUGIN_HANDLED;
}
if(VipUsed[id])
{
ChatColor(id, "%s Ai folosit deja in aceasta runda meniul !gVIP",Tag);
return PLUGIN_HANDLED;
}
switch(cs_get_user_team(id))
{
case CS_TEAM_T:
	VipTMenu(id);
case CS_TEAM_CT:
	VipCTMenu(id);
	}
return PLUGIN_HANDLED;
}



public VipCTMenu(id)

{

	new menu = menu_create("\r[BB.LeagueCs.Ro] \yVIP Meniu \rCT", "VipCTMenu_handler");

	

	menu_additem(menu, "\w+\y250\r[\yHP\r]", "1", 0);
	menu_additem(menu, "\yViteza", "2", 0);
	menu_additem(menu, "\yM249 \wsi \yDeagle", "3", 0);
	menu_additem(menu, "\yAK47 \wx2 \yDMG", "4", 0);
	menu_additem(menu, "\yDeagle \wx2 \yDMG", "5", 0);

	menu_display(id, menu);

}



public VipCTMenu_handler(id, menu, item)

{

	if( item == MENU_EXIT )

	{

		menu_destroy(menu);

		return PLUGIN_HANDLED;

	}

	

	new data[6], iName[64];

	new access, callback;

	menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);

	

	new key = str_to_num(data);

	

	switch(key)

	{

		case 1:

		{

			set_user_health(id, get_user_health(id) + 250);

			VipUsed[id] = true;

			

			ChatColor(id, "%s Ai primit !g250HP!",Tag);

		}

		case 2:

		{

			VipUsed[id] = true;

			Speed[id] = true;

			ForcePlayerSpeed(id);
			

			ChatColor(id, "%s Ai primit !gViteza",Tag);

		}

		

		case 3:

		{

			give_item(id, "weapon_m249");

			give_item(id, "weapon_deagle");

			cs_set_user_bpammo(id, CSW_M249, 200);

			cs_set_user_bpammo(id, CSW_DEAGLE, 100);

			

			VipUsed[id] = true;

			

			

			ChatColor(id, "%s Ai primit un !gM249 !ysi un !gDeagle",Tag);

		}

		case 4:

		{

			

			give_item(id, "weapon_ak47");

			cs_set_user_bpammo(id, CSW_AK47, 200);

			set_pev(id, pev_viewmodel2, "models/Shop_Nak/v_ak472k21.mdl");

			q_AK47[id] = true;

			VipUsed[id] = true;

			

			ChatColor(id, "%s Ai primit un !gAK47 X2 DMG",Tag);

		}

		case 5:

		{

			

			give_item(id, "weapon_deagle");

			cs_set_user_bpammo(id, CSW_DEAGLE, 200);

			set_pev(id, pev_viewmodel2, "models/Shop_Nak/v_deaglenak2k21.mdl");

			q_Deagle[id] = true;

			VipUsed[id] = true;

			

			ChatColor(id, "%s Ai primit !gDeagle X2 DMG",Tag);
        }

		

		

	}

	

	menu_destroy(menu);

	return PLUGIN_HANDLED;

}



public VipTMenu(id)

{

	new menu = menu_create("\r[BB.LeagueCs.Ro] \yVIP Meniu \rZM", "VipTMenu_handler");

	

	menu_additem(menu, "\w+\y1500 \r[\yHP\r]", "1", 0);
	menu_additem(menu, "\yCutit \wX2 \yDMG + \y1000 \r[\yHP\r]", "2", 0);
	menu_additem(menu, "\yCutit \w80%Clip + \y1000 \r[\yHP\r]", "3", 0);

	menu_display(id, menu);

}



public VipTMenu_handler(id, menu, item)

{

	if( item == MENU_EXIT )

	{

		menu_destroy(menu);

		return PLUGIN_HANDLED;

	}

	

	new data[6], iName[64];

	new access, callback;

	menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);

	

	new key = str_to_num(data);

	

	switch(key)

	{

		

		case 1:

		{

			set_user_health(id, get_user_health(id) + 1500);

			VipUsed[id] = true;

			

			ChatColor(id, "%s Ai primit !g1500 !teamHP",Tag);

		}

		

		case 2:

		{

			set_user_health(id, get_user_health(id) + 1000);

			Speed[id] = true;

			ForcePlayerSpeed(id);

			set_pev(id, pev_viewmodel2, "models/cutat.mdl");

			g_bHasKnifeB[id] = true;

			

			VipUsed[id] = true;

			

			ChatColor(id, "%s Ai primit !gCutit X2 DMG !y+ !g1000HP",Tag);

		}

		case 3:

		{

			set_user_health(id, get_user_health(id) + 1000);

			Speed[id] = true;

			ForcePlayerSpeed(id);

			set_pev(id, pev_viewmodel2, "models/bardita_nak2k21.mdl");

			g_bHasKnifeW[id] = true;

			set_user_rendering(id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 125); 

			

			VipUsed[id] = true;

			

			ChatColor(id, "%s Ai primit !gCutit 80% Invizibilitate !y+ 1000HP",Tag);

		}

		

		

	}

	

	menu_destroy(menu);

	return PLUGIN_HANDLED;

}

public cmdBuyvip(id)

{

	show_motd(id, "vip.txt", "VIP");

}  

public cmdPreturi(id)

{

	show_motd(id, "preturi_rang_motd.html", "PRETURI");

	

}
public client_putinserver(id)
{
GodMode[id] = false;
}



//********************STOCK-URI******************** 

stock ChatColor(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, "!team", "^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[i]); 

write_string(msg); 

message_end(); 

} 

} 

} 

}
User avatar
CyBer[N]eTicK
Membru, skill 0
Membru, skill 0
Posts: 36
Joined: 29 May 2020, 04:35
Detinator Steam: Da
CS Status: Citesc & Ajut | BB Force
Detinator server CS: BB.BlackGames.Ro
SteamID: STEAM_0:1:215915520
Fond eXtream: 0
Location: LocalHost
Has thanked: 4 times
Been thanked: 2 times

02 May 2021, 00:12

L-am rezolvat eu.
Post Reply

Return to “Modificari pluginuri”

  • Information
  • Who is online

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