Modificare plugin

Modificari necesare ale pluginurilor

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
User avatar
Robertsasab
Membru, skill 0
Membru, skill 0
Posts: 32
Joined: 16 May 2022, 11:18
Detinator Steam: Da
CS Status: BlackGames.Ro
Detinator server CS: BBX.NEXTCS.RO
Fond eXtream: 0
Location: Romania
Discord: Robertsasa#3020
Has thanked: 1 time
Been thanked: 1 time
Contact:

27 Jul 2022, 18:27

Salut, vreau sa imi modificati si mie un plugin este bb_shop, as vrea doar sa se adauge niste arme in shop sa vi le las mai jos
CT:
AK47 Beast X2 DMG [10000 Euro]
M4A1 Super X2 DMG [10000 Euro]
Gravity [1500 Euro]
Invizibilitate 5 secunde [8000 Euro]

T:
Superknife x5 [13000 Euro]
Gravity [1500 Euro]
Invizibilitate 5 Secunde [8000 Euro]

Code: Select all

/* Plugin generated by AMXX-Studio */

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


#pragma tabsize 0

#define PLUGIN "Base Builder Shop"
#define VERSION "1.0"
#define AUTHOR "eVo"

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

#define LIMITA_HP 8000     // HP-ul maxim pe care il poti avea.

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

new Tag[] = "!g[BBx.NextCs.Ro] !team";

new Runda[33], RundaCT[33];
new bool:bSpeed[33], bool:bInvis[33];
new bool: Hp[33],bool: GodMode[33], bool:g_bKnife[33], q_bKnife[33];

new g_iMaxPlayers;


/* Super Knife */
new Knife [66]= "models/bb_eVo/v_knife_2k18.mdl"	

/* Knife */
new Knife_Model[66] = "models/bb_eVo/v_dual_axe_lcs.mdl"




public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)

	RegisterHam ( Ham_TakeDamage, "player", "Player_TakeDamage" );
	
	register_event("CurWeapon", "event_curweapon", "be", "1=1")
	register_event("HLTV", "event_new_round", "a", "1=0", "2=0")
	register_cvar("cvar_mcredite","1");
	register_cvar("cvar_hp","300");
	register_cvar( "cvar_runda", "2" )   	// Acces Shop Pe Runda
	register_cvar( "cvar_runda_ct", "2" )   	// Acces Shop CT Pe Runda
	register_clcmd ( "say /shop", "ShowShop" ); 
	g_iMaxPlayers = get_maxplayers ( )

}

public event_new_round(  )
{
	new iPlayers[32], iNum;
	get_players(iPlayers, iNum)
	for(new i = 0;i < iNum; i++)
	{
		GodMode[iPlayers[i]] = false;
		Hp[iPlayers[i]] = false;
		q_bKnife[iPlayers[i]] = false;
		bSpeed[iPlayers[i]] = false;
		set_user_maxspeed(iPlayers[i], 400.0)
		bInvis[iPlayers[i]] = false;
		set_user_rendering(iPlayers[i])
		Runda[iPlayers[i]]=0;
		RundaCT[iPlayers[i]]=0;
	}
}
public Player_TakeDamage ( iVictim, iInflictor, iAttacker, Float:fDamage )
{
		if ( iInflictor == iAttacker && IsPlayer ( iAttacker ) && get_user_weapon ( iAttacker ) == CSW_KNIFE && q_bKnife[ iAttacker ] ) 
			SetHamParamFloat ( 4, fDamage * 3.0 );
		if( iInflictor == iAttacker && IsPlayer ( iAttacker ) )
			SetHamParamFloat ( 4, fDamage * 1.1 );
		return HAM_IGNORED
}
public event_curweapon( id )
{
	if(get_user_weapon(id) == CSW_KNIFE && g_bKnife[id])
		set_pev(id, pev_viewmodel2, Knife_Model)
		
	if(bSpeed[id])
		set_user_maxspeed(id, 800.0)
	if(bInvis[id])
		set_user_rendering(id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 0);
}
public plugin_precache( ) 
{	
	precache_model (Knife)
	
	precache_model(Knife_Model)
}
public ShowShop( id )
{
	if(get_user_team(id) == 1 && Runda[id] < get_cvar_num( "cvar_runda" ) )
	{
	if ( get_user_team ( id ) == 1 ) ShowShopZM(id);
	Runda[id]=Runda[id]+1;
	}
	else if( get_user_team(id) == 1 && Runda[id] == get_cvar_num( "cvar_runda" )) 
	{
	ChatColor(id, "%s!teamAi acces la acest shop doar de !g%i ori!team pe runda!",Tag ,get_cvar_num( "cvar_runda" )); 
	}
	
	if(get_user_team(id) == 2 && RundaCT[id] < get_cvar_num( "cvar_runda_ct" ) )
	{
	if ( get_user_team ( id ) == 2 ) ShowShopCT(id);
	RundaCT[id]=RundaCT[id]+1;
	}
	else if( get_user_team(id) == 2 && RundaCT[id] == get_cvar_num( "cvar_runda_ct" ))
	{
	ChatColor(id, "%s!teamAi acces la acest shop doar de !g%i ori!team pe runda!",Tag ,get_cvar_num( "cvar_runda_ct" )); 
	}
}
public ShowShopZM ( id ) 
{
	if(get_user_team(id) == 1 && is_user_alive(id)) 
	{
	new menu = menu_create ( "\y[\rBBx.NextCs.Ro\y] \w- \rShop Menu", "Menu_Giver" ); // nume meniu si numele public-ului care va actiona ( handler-ul )
    menu_additem ( menu, "\wWar Hammer \rXmas \dx2 \yDamage \r[5000 Euro]", "0", 0 ); // slot 1
	menu_additem ( menu, "\wSpeed \r[500 Euro]", "1", 0 ); // slot 1
    menu_additem ( menu, "\wGravitatie Scazuta \r[2500 Euro]", "2", 0 ); // slot
	menu_additem ( menu, "\wGod Mode \d(\y5 Secunde\d) \r[3000 Euro]", "3", 0);
	menu_additem ( menu, "\w1000 HP \r[2500 Euro]", "4", 0);
	menu_additem ( menu, "\w2000 HP \r[3500 Euro]", "5", 0);
    
    menu_setprop ( menu, MPROP_EXIT, MEXIT_ALL ); // butonul exit
    menu_display ( id, menu, 0 ); // afiseaza meniul	
	}
    return PLUGIN_CONTINUE
}
public Menu_Giver ( id, menu, item, client ) 
{
    
		if(item == MENU_EXIT || !is_user_alive(id) || get_user_team(id) != 1) 
		{ 
		menu_destroy(menu) 
		return 1;
		} 
    
    new data [ 6 ], szName [ 64 ]; // variabile
    new access, callback; // variabile
    menu_item_getinfo ( menu, item, access, data,charsmax ( data ), szName,charsmax ( szName ), callback ); // cautam detalii despre meniu
    new key = str_to_num ( data ); // butonul pe care apasa
    if(get_user_team(id) == 1)
    switch ( key ) // aici va veni pe CAZURI, cazul 1, cazul 2 ( pe ce buton apasa )
    {
		case 0:
        {
			if(is_user_alive(id))
			{
            new iCredits = fcs_get_user_credits  ( id ) - 5000; // cauta creditele jucatorului si scade 2
            
            if ( iCredits < 0 ) 
			{ // daca nu are destule credite ( 2 ) atunci ii va aparea un mesaj
				new iCredits2 = 5000 - fcs_get_user_credits (id);
                ChatColor(id, "%s!teamNu ai suficienti Euro! Mai ai nevoie de !g%i!team Euro!",Tag,iCredits2 );
                return 1; // plugin-ul se opreste
                
            }
            
            else 
			{
                set_pev ( id, pev_viewmodel2, Knife );
	            ChatColor(id, "%s!teamAi cumparat !gWar Hammer Xmas!team.",Tag); 
                fcs_set_user_credits ( id, iCredits ); // ii setam noile credite ( -2 )
				q_bKnife[id] = true;
                return 1; // plugin-ul se opreste
            }
			}
			else 
			{ 
				ChatColor(id, "%s!teamNu poti accesa meniul cand esti !gmort!team!",Tag); 
			}
        }
		
        case 1:
        {
			if(is_user_alive(id))
			{
            new iCredits = fcs_get_user_credits  ( id ) - 500; // cauta creditele jucatorului si scade 2
            
            if ( iCredits < 0 ) 
			{ // daca nu are destule credite ( 2 ) atunci ii va aparea un mesaj
				new iCredits2 = 500 - fcs_get_user_credits (id);
                ChatColor(id, "%s!teamNu ai suficienti Euro! Mai ai nevoie de !g%i!team Euro!",Tag,iCredits2 );
                return 1; // plugin-ul se opreste
                
            }
            
            else 
			{
                set_user_maxspeed(id, get_user_maxspeed(id) + 500.0);
	            ChatColor(id, "%s!teamAi cumparat !gViteza!team.",Tag); 
                fcs_set_user_credits ( id, iCredits ); // ii setam noile credite ( -2 )
                return 1; // plugin-ul se opreste
            }
			}
			else 
			{ 
				ChatColor(id, "%s!teamNu poti accesa meniul cand esti !gmort!team!",Tag); 
			}
        }
        
        case 2:
        {
			if(is_user_alive(id))
			{
            new iCredits = fcs_get_user_credits ( id ) - 2500; // cauta creditele jucatorului si scade 3
            
            if ( iCredits < 0 ) 
			{ // daca nu are destule credite ( 3 ) atunci ii va aparea un mesaj
                new iCredits2 = 2500 - fcs_get_user_credits (id);
                ChatColor(id, "%s!teamNu ai suficienti Euro! Mai ai nevoie de !g%i!team Euro!",Tag,iCredits2 );
                return 1; // plugin-ul se opreste
                
            }
            
            else 
			{
                set_user_gravity(id, 0.5) 
				ChatColor(id, "%s!teamAi cumparat !gGravitatie!team.",Tag); 
                fcs_set_user_credits ( id, iCredits ); // ii setam noile credite ( -3 )
                return 1; // plugin-ul se opreste
            }
			}
			else
			{
				ChatColor(id, "%s!teamNu poti accesa meniul cand esti !gmort!team!",Tag); 
			}
        }
		case 3:
        {
			if(is_user_alive(id) && GodMode[id] == false)
			{
            new iCredits = fcs_get_user_credits ( id ) - 3000; // cauta creditele jucatorului si scade 3
            
            if ( iCredits < 0 ) 
			{                 // daca nu are destule credite ( 3 ) atunci ii va aparea un mesaj
                new iCredits2 = 3000 - fcs_get_user_credits (id);
                ChatColor(id, "%s!teamNu ai suficienti Euro! Mai ai nevoie de !g%i!team credite!",Tag,iCredits2 );
                return 1; // plugin-ul se opreste
                
            }
            
            else 
			{
                set_user_godmode(id, 1 ); 
				set_task(5.0, "scoategodmode", id);
				GodMode[id] = true;
				ChatColor(id, "%s!teamAi cumparat !gGod Mode!team pentru !g5!team Secunde.",Tag); 
                fcs_set_user_credits ( id, iCredits ); // ii setam noile credite ( -3 )
                return 1; // plugin-ul se opreste
            }
			}
			else if(GodMode[id] == true)
			{
				ChatColor(id, "%s!teamAi acces la acest item doar odata pe runda!",Tag); 
			}
			else 
			{
				ChatColor(id, "%s!teamNu poti accesa meniul cand esti !gmort!team!",Tag); 
			}
        }
		
		case 4:
        {	
			if(is_user_alive(id))
			{
            new iCredits = fcs_get_user_credits ( id ) - 2500; // cauta creditele jucatorului si scade 3
			new health = get_user_health(id);
            
            if ( iCredits < 0 ) 
			{                 // daca nu are destule credite ( 3 ) atunci ii va aparea un mesaj
                new iCredits2 = 2500 - fcs_get_user_credits (id);
                ChatColor(id, "%s!teamNu ai suficienti Euro! Mai ai nevoie de !g%i!team Euro!",Tag,iCredits2 );
                return 1; // plugin-ul se opreste
                
            }
            
            else 
			{
	

				health=health+1000;
				if( health<= LIMITA_HP )
				{
				set_user_health(id, health );
				ChatColor(id, "%s!teamAi cumparat !g+1000 HP!team.",Tag); 
                fcs_set_user_credits ( id, iCredits ); 
               	return 1; 
				}
				else
				{
				ChatColor(id, "%s!teamNu poti avea mai mult de !g8000 HP!team.",Tag); 
               	return 1; 
				}
            }
			}
			else
			{
				ChatColor(id, "%s!teamNu poti accesa meniul cand esti !gmort!team!",Tag); 
			}
			
        }
		
		case 5:
        {
			if(is_user_alive(id) && Hp[id] == false)
			{
            new iCredits = fcs_get_user_credits ( id ) - 3500; // cauta creditele jucatorului si scade 3
			new health = get_user_health(id);
            
            if ( iCredits < 0 ) 
			{                 // daca nu are destule credite ( 3 ) atunci ii va aparea un mesaj
                new iCredits2 = 3500 - fcs_get_user_credits (id);
                ChatColor(id, "%s!teamNu ai suficienti Euro! Mai ai nevoie de !g%i!team Euro!",Tag,iCredits2 ); 
                return 1; // plugin-ul se opreste
                
            }
            
            else 
			{ 
				health=health+2000;
				if( health<= LIMITA_HP )
				{
				set_user_health(id, health );
				ChatColor(id, "%s!teamAi cumparat !g+2000 HP!team.",Tag); 
                fcs_set_user_credits ( id, iCredits ); 
               	return 1; 
				}
				else
				{
				ChatColor(id, "%s!teamNu poti avea mai mult de !g8000 HP!team.",Tag); 
               	return 1; 
				}
            }
			}
			else if(Hp[id] == true)
			{
				ChatColor(id, "%s!teamAi acces la acest item doar odata pe runda!",Tag); 
			}
			else
			{
			ChatColor(id, "%s!yNu poti accesa meniul cand esti !gmort!y!",Tag); 
			}
        }
		
		
        
    }
    
    menu_destroy ( menu ); // distruge meniul
    return 1; // plugin-ul se opreste
    
} 
public ShowShopCT( id )
{
	if(get_user_team(id) == 2 && is_user_alive(id)) 
	{
	static menu;
	menu = menu_create ("\y[\rBBx.NextCs.Ro\y] \w- \rShop Menu","Menu_Echipamentid")
	if(get_cvar_num("cvar_mcredite") == 0)
	{
		menu_additem ( menu,"\w 100 HP \r[10000$]","1", 0 )
	}
	if(get_cvar_num("cvar_mcredite") == 1)
	{
		menu_additem ( menu,"\w 100 HP \r[1000 Euro]","1", 0 )
	}
	if(get_cvar_num("cvar_mcredite") == 0)
	{
		menu_additem ( menu,"\w Grenade Pack \r[5000$]","2", 0 )
	}
	if(get_cvar_num("cvar_mcredite") == 1)
	{
		menu_additem ( menu,"\w Grenade Pack \r[1250 Euro]","2", 0 )
	}
	if(get_cvar_num("cvar_mcredite") == 0)
	{
		menu_additem ( menu,"\w God Mode \d(\y5 Secunde\d) \r[14000$]","3", 0 )
	}
	if(get_cvar_num("cvar_mcredite") == 1)
	{
		menu_additem ( menu,"\w God Mode \d(\y5 Secunde\d) \r[3000 Euro]","3", 0 )
	}
	if(get_cvar_num("cvar_mcredite") == 0)
	{
		menu_additem ( menu,"\w Speed \r[8000$]","4", 0 )
	}
	if(get_cvar_num("cvar_mcredite") == 1)
	{
		menu_additem ( menu,"\w Speed \r[500 Euro]","4", 0 )
	}
	menu_setprop ( menu, MPROP_NUMBER_COLOR,"\y")
	menu_setprop ( menu, MPROP_EXIT, MEXIT_ALL )
	
	menu_display ( id, menu, 0 )
	return 0
	}
	return PLUGIN_CONTINUE
}
public Menu_Echipamentid(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 );
	new pcredite = fcs_get_user_credits(id)
	new cost = cs_get_user_money(id)
	if(get_user_team(id) == 2)
	switch ( key )
	{
		case 1:
		{
			if(get_cvar_num("cvar_mcredite") == 0)
			{
				if(cs_get_user_money(id) >= 10000)
				{
					set_user_health(id, get_user_health(id) + 100)
					set_user_armor(id, get_user_armor(id) + 0)
					cs_set_user_money(id, cs_get_user_money(id) - 10000)
				}
				else
				{
					new money = 10000 - cost
					ChatColor(id, "!gNu !yai suficienti !teambani !ypentru a cumpara acest item, iti mai trebuie !g%i$",money)
					return 1
				}
			}
			if(get_cvar_num("cvar_mcredite") == 1)
			{
				if(fcs_get_user_credits(id) >= 1000)
				{	
					if(get_user_health(id) < get_cvar_num("cvar_hp"))
					{
					fcs_set_user_credits(id, fcs_get_user_credits(id) - 1000)
					set_user_health(id, get_user_health(id) + 100)
					set_user_armor(id, get_user_armor(id) + 100)
					}
					else
					{
					ChatColor(id, "!gMaximul de HP este !team300!g HP.")
					return 1
					}
				}
				else
				{
					new credits = 1000 - pcredite
					ChatColor(id, "!gNu !yai suficienti !teamEuro !ypentru a cumpara acest item, iti mai trebuie !g%i Euro.",credits)
					return 1
				}
			}
		}
		case 2:
		{
			if(get_cvar_num("cvar_mcredite") == 0)
			{
				if(cs_get_user_money(id) >= 5000)
				{
					give_item ( id,"weapon_flashbang" )
					give_item ( id,"weapon_hegrenade" )
					give_item ( id,"weapon_smokegrenade" )
					cs_set_user_money(id, cs_get_user_money(id) - 5000)
				}
				else
				{
					new money = 5000 - cost
					ChatColor(id, "!gNu !yai suficienti !teambani !ypentru a cumpara acest item, mai ai nevoie de !g%i$",money)
					return 1
				}
			}
			if(get_cvar_num("cvar_mcredite") == 1)
			{
				if(fcs_get_user_credits(id) >= 1250)
				{
					fcs_set_user_credits(id, fcs_get_user_credits(id) - 1250)
					give_item ( id,"weapon_flashbang" )
					give_item ( id,"weapon_hegrenade" )
					give_item ( id,"weapon_smokegrenade" )
				}
				else
				{
					new credits = 1250 - pcredite
					ChatColor(id, "!gNu !yai suficienti !teamEuro !ypentru a cumpara acest item, mai ai nevoie de !g%i Euro.",credits)
					return 1
				}
			}
		}
		case 3:
		{
			if(get_cvar_num("cvar_mcredite") == 0)
			{
				if(cs_get_user_money(id) >= 14000)
				{
					set_user_godmode(id, 1)
					cs_set_user_money(id, cs_get_user_money(id) - 14000)
					set_task(10.0,"scoategodmode",id)
				}
				else
				{
					new money = 14000 - cost
					ChatColor(id, "!gNu !yai suficienti !teambani !ypentru a cumpara acest item,mai ai nevoie de !g%i$",money)
					return 1;
				}
			}
			if(get_cvar_num("cvar_mcredite") == 1)
			{
				if(fcs_get_user_credits(id) >= 300)
				{
					fcs_set_user_credits(id, fcs_get_user_credits(id) - 300)
					set_user_godmode(id, 1)
					set_task(10.0,"scoategodmode",id)
				}
				else
				{
					new credits = 3000 - pcredite
					ChatColor(id, "!gNu !yai suficienti !teamEuro !ypentru a cumpara acest item,mai ai nevoie de !g%i Euro.",credits)
					return 1
				}
			}
		}
		case 4:
		{
			if(get_cvar_num("cvar_mcredite") == 0)
			{
				if(cs_get_user_money(id) >= 8000)
				{
					cs_set_user_money(id, cs_get_user_money(id) - 8000)
					set_user_maxspeed(id, 800.0)
					bSpeed[id] = true;
				}
				else
				{
					new money = 8000 - cost
					ChatColor(id, "!gNu !yai suficienti !teambani !ypentru a cumpara acest item,mai ai nevoie de !g%i$",money)
					return 1;
				}
			}
			if(get_cvar_num("cvar_mcredite") == 1)
			{
				if(fcs_get_user_credits(id) >= 10)
				{
					fcs_set_user_credits(id, fcs_get_user_credits(id) - 500)
					set_user_maxspeed(id, 800.0)
					bSpeed[id] = true;
				}
				else
				{
					new credits = 500 - pcredite
					ChatColor(id, "!gNu !yai suficienti !teamEuro !ypentru a cumpara acest item,mai ai nevoie de !g%i Euro.",credits)
					return 1
				}
			}
		}
	}
	menu_destroy ( menu );
	return 1;
}

public scoategodmode(id) 
{ 
if( is_user_connected(id) )
{
set_user_godmode(id, 0 ); 
ChatColor(id, "%s!teamA expirat timpul pentru !gGodMode!y!",Tag ); 
}
}
public scoateinv(id)
{
if( is_user_connected(id) )
{
set_user_rendering ( id, kRenderFxNone, 0, 0, 0, kRenderTransTexture, 255 );
ChatColor(id, "%s!teamA expirat timpul pentru !gInvizibilitate!y!",Tag); 
}
}

 
//********************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[i])) 
{ 
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]); 
write_byte(players[i]); 
write_string(msg); 
message_end(); 
} 
} 
} 
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/
BlackGames.Ro
User avatar
CyBer[N]eTicK
Membru, skill +1
Membru, skill +1
Posts: 112
Joined: 29 May 2020, 05:35
Detinator Steam: Da
SteamID: CyBerNrcs
Fond eXtream: 0
Location: Iași
Discord: CyBer[N]eTicK#1206
Has thanked: 16 times
Been thanked: 10 times
Contact:

03 Aug 2022, 21:42

L-am ajutat eu privat.
«„ Atunci când se ridică sus oamenii de nimic, nelegiuiţii mişună pretutindeni. ”»
Post Reply

Return to “Modificari pluginuri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 12 guests