Raised This Month: $51 Target: $400
 12% 

Some helps at this script


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Brentio
New Member
Join Date: Sep 2020
Old 09-22-2020 , 15:53   Some helps at this script
Reply With Quote #1

Hello im new to forum and need some helps at this scripts

i wanted to add goldenak at this gold system and make just vips acces this gold system

i tried to add goldenak but i failed

heres goldenak script

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


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

new AK_V_MODEL[64] = "models/AVI/v_tron_ak47.mdl"
new AK_P_MODEL[64] = "models/AVI/p_tron_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_dmg_multiplier", "2")
	cvar_custommodel = register_cvar("goldenak_custom_model", "1")
	cvar_goldbullets = register_cvar("goldenak_gold_bullets", "1")
	cvar_uclip = register_cvar("goldenak_unlimited_clip", "1")
	cvar_cost = register_cvar("goldenak_cost", "10000")
	
	// Register The Buy Cmd
	register_clcmd("goldenshop_goldenak", "CmdBuyAk")
	register_clcmd("goldenshop_goldenak", "CmdBuyAk")
	register_concmd("amx_goldenak", "CmdGiveAk", ADMIN_LEVEL_A, "<name>")
	
	// Register The Plugin
	register_plugin("Golden Ak 47", "1.0", "cSPlugins")
	// 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)
	precache_model(AK_P_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)
		set_pev(id, pev_weaponmodel2, AK_P_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( 133 )     // r, g, b
			write_byte( 211 )       // r, g, b
			write_byte( 210 )       // r, g, b
			write_byte(200) // brightness
			write_byte(150) // speed
			message_end()
		}
		
		bullets[id] = clip
	}
	
}

public CmdBuyAk(id)
{
	if ( !is_user_alive(id) )
	{
		client_print(id,print_chat, "^4[BB 6.8] To buy golden Ak 47 You need to be alive!")
		return PLUGIN_HANDLED
	}
	
	new money = cs_get_user_money(id)
	
	if (money >= get_pcvar_num(cvar_cost))
	{
		cs_set_user_money(id, money - get_pcvar_num(cvar_cost))
		give_item(id, "weapon_ak47")
		g_HasAk[id] = true
	}
	
	else
	{
		client_print(id, print_chat, "^4[BB 6.8] You dont hav enough money to buy Golden Ak 47. Cost $%d ", get_pcvar_num(cvar_cost))
	}
	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 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[i])) 
		{
			static wname[32]
			get_weaponname(weapons[i], 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\\ lang1033\\ f0\\ fs16 \n\\ par }
*/
i wanted to put it at this script
Code:
#include <amxmodx>
#include <amxmisc>
#include <nvault>
#include <hamsandwich>
#include <fakemeta_util>
#include <engine>
#include <cstrike>
#include <fun>
#include <ColorChat>


#define ADMIN_ACCESS	ADMIN_LEVEL_H 

#define PREFIX		"AVI"
#define FLAG ADMIN_H

/*-------------- Plugin Information --------------*/

#define PLUGIN "Gold System"
#define VERSION "1.0"
#define AUTHOR "EaGle07 & Freezo"

/*-------------- Stock Cvars --------------*/

new gVault, gSteamID[ 32 ],vKey[ 64 ],vData[ 64 ]; 
new gGoldSystem;
new gGolds [ 33 ];
new g_iTarget [33];
new gShop
new gGrenades
new gSilentcost
new gHealthcost
new pHealth
new gArmorcost
new pArmor
new gGravitycost
new gSpeedcost
new gInvisiblecost
new gBhopcost
new gGoldenakcost
new pSpeed
new gGravity
new gGoldsbonus
new syncObj

new hasGrenades [ 33 ];
new hasSilent [ 33 ];
new hasHealth [ 33 ];
new hasArmor [ 33 ];
new hasGravity [ 33 ];
new hasSpeed [ 33 ];
new hasInvisible [ 33 ];
new hasBhop [ 33 ];
new hasGlow [ 33 ];
new bhopOn [ 33 ];


public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	//-------------- Register Clcmd --------------//
	
	register_clcmd( "say /golds", "gold_Menu" );
	register_clcmd( "say /showgolds", "cmd_showgolds" );
	register_clcmd( "donate", "CmdDonate" );
	
	//-------------- Register Event --------------//
	
	register_logevent( "logevent_round_start", 2, "1=Round_Start" );
	register_event( "DeathMsg", "Hook_Deathmessage", "a" );
	
	//--------- Cmd for Set / reset Golds --------//
	
	register_concmd( "set_golds", "cmd_set", ADMIN_ACCESS, "<name> <golds> - set golds to a player" );
	register_concmd( "reset_golds", "cmd_reset", ADMIN_ACCESS, "<name> <golds> - reset player golds" );
	
	set_task(1.0,"JailbreakVIPPacks", .flags  = "b")
	syncObj = CreateHudSyncObj()
	
	//-------------- Register Cvars --------------//
	
	gGoldSystem  = register_cvar( "gold_system", "1" );	/* 0 : Plugin disabled // 1 : plugin enabled */
	gShop  = register_cvar( "gold_shop" , "1");		/* 0 : Shop disabled  // 1 : Shop Enabled */
	gGoldsbonus = register_cvar( "gold_bonus", "1")		/* Bonus Golds when you kill an enemy */
	gGrenades = register_cvar( "grenades_cost" , "9" );	/* Grenades Pack Cost */
	pHealth	= register_cvar( "health_point", "100" );	/* Health Point Cvar */
	pArmor = register_cvar( "armor_point", "100" );		/* Armor Point Cvar */
	gGravity = register_cvar( "gravity_power", "0.3" );	/* Gravity Power Cvar */
	pSpeed = register_cvar( "speed_power", "800.0");		/* Speed Power Cvar */
	
	
	// ----------------- Cvar With cost ------------//
	
	gSilentcost = register_cvar( "silent_cost", "12" );	/* Silent Walk Cost */
	gHealthcost = register_cvar( "health_cost", "2" );	/* Health Cost	*/
	gArmorcost = register_cvar( "armor_cost", "1" );		/* Armor Cost 	*/
	gGravitycost = register_cvar( "gravity_cost", "25" );	/* Gravity Cost */
	gSpeedcost = register_cvar( "speed_cost", "25" );	/* Speed Cost */
	gInvisiblecost = register_cvar( "invisible_cost","300" );	/* Invisible Cost */
	gBhopcost = register_cvar( "bhop_cost", "39");		/* Faster Bunny Hop Cost */
	gGoldenakcost = register_cvar( "goldenak_cost", "55");		/* Goldenak Cost */
	
}

/* ---| When client is connecting |--- */
	
	


public client_connect( id )
{
	load_golds( id );
	bhopOn[id] = false
}

/* ---| When client has disconnected |--- */

public client_disconnect( id )
{
	save_golds( id );
	bhopOn[id] = false
}

/* ---| Gold Menu |--- */

public gold_Menu(id)
{
	if( get_pcvar_num( gGoldSystem ) != 1 )
	{
		client_print( id, print_chat, "[%s] Gold System is Disable!", PREFIX );
		return PLUGIN_HANDLED;
	}

	new InfoStatus[198];
	formatex( InfoStatus, charsmax( InfoStatus ), "Gold System Menu");
	new menu = menu_create( InfoStatus, "gold_handler" );
	
	formatex(InfoStatus, charsmax(InfoStatus),  "Shop Menu \y[\rYou Have %d golds\y]", gGolds[id] );
	menu_additem( menu, InfoStatus, "1", 0 );
	
	formatex(InfoStatus, charsmax(InfoStatus),  "Show Players Golds");
	menu_additem( menu, InfoStatus, "2", 0 );
	
	formatex(InfoStatus, charsmax(InfoStatus),  "Donate Golds");
	menu_additem( menu, InfoStatus, "3", 0 );
	
	
	menu_setprop( menu, MPROP_EXIT, MEXIT_ALL );
	
	menu_display( id, menu, 0 );
	
	return PLUGIN_CONTINUE;
	
}

/* ---| Gold Menu Handler |--- */

public gold_handler( id, menu, item )
{
	if( item == MENU_EXIT )
	{
		menu_destroy( menu );
		return PLUGIN_HANDLED;
	}
	new szData[6];
	new iAccess, hCallback;        

	menu_item_getinfo( menu, item, iAccess, szData, 5, _, _, hCallback );	
	
	new name[32]
	get_user_name(id,name,32)
    
	switch( str_to_num( szData ) )
	{
	case 1: gold_shop(id)
	case 2: ShowPoints(id)
	case 3: Donate_Menu(id)
	
	}
	
	return PLUGIN_HANDLED;
}

/* ---| Gold Shop with items |--- */

public gold_shop(id)
{
	/* ---| if shop disabled player can't open the shop|--- */
	if( get_pcvar_num( gShop ) != 1 )
	{
		client_print( id, print_chat, "[%s] Gold Shop is Disable!", PREFIX );
		return PLUGIN_HANDLED;
	}

	new InfoStatus[198];
	formatex( InfoStatus, charsmax( InfoStatus ), "Gold Shop ^n You Have %d Golds", gGolds[id] );
	
	new menu = menu_create( InfoStatus, "shop_handler" );
	

	formatex(InfoStatus, charsmax(InfoStatus),  "Grenades Pack \r[ %d golds ]", get_pcvar_num( gGrenades ) );
	menu_additem( menu, InfoStatus, "1", 0 );
	
	formatex(InfoStatus, charsmax(InfoStatus),  "Silent Walk \r[ %d golds ]",get_pcvar_num( gSilentcost ));
	menu_additem( menu, InfoStatus, "2", 0 );
	
	formatex(InfoStatus, charsmax(InfoStatus),  "%d Health \r[ %d golds ]",get_pcvar_num( pHealth ) ,get_pcvar_num( gHealthcost ) );
	menu_additem( menu, InfoStatus, "3", 0 );
	
	formatex(InfoStatus, charsmax(InfoStatus),  "%d Armor \r[ %d golds ]",get_pcvar_num( pArmor ) ,get_pcvar_num( gArmorcost ) );
	menu_additem( menu, InfoStatus, "4", 0 );
	
	formatex(InfoStatus, charsmax(InfoStatus),  "Gravity \r[ %d golds ]",get_pcvar_num( gGravitycost ) );
	menu_additem( menu, InfoStatus, "5", 0 );
	
	formatex(InfoStatus, charsmax(InfoStatus),  "Faster Speed \r[ %d golds ]",get_pcvar_num( gSpeedcost ) );
	menu_additem( menu, InfoStatus, "6", 0 );
	
	formatex(InfoStatus, charsmax(InfoStatus),  "Invisibility \r[ %d golds ]",get_pcvar_num( gInvisiblecost ) );
	menu_additem( menu, InfoStatus, "7", 0 );
	
	formatex(InfoStatus, charsmax(InfoStatus),  "Faster Bhop \r[ %d golds ]",get_pcvar_num( gBhopcost ) );
	menu_additem( menu, InfoStatus, "8", 0 );
	
	formatex(InfoStatus, charsmax(InfoStatus),  "goldenak \r[ %d golds ]",get_pcvar_num( gGoldenakcost ) );
	menu_additem( menu, InfoStatus, "9", 0 );
	
	menu_setprop( menu, MPROP_EXIT, MEXIT_ALL );
	
	menu_display( id, menu, 0 );
	
	return PLUGIN_CONTINUE;
	
}

/* ---| Gold Shop Handler |--- */

public shop_handler(id, menu, item)
{
	if( item == MENU_EXIT )
	{
		menu_destroy( menu );
		return PLUGIN_HANDLED;
	}
	
	new data[ 6 ], iName[ 64 ], access, callback;
	menu_item_getinfo( menu, item, access, data, charsmax( data ), iName, charsmax( iName ), callback );

	new key = str_to_num( data );
	
	new golds = gGolds[ id ];
	
	switch( key )
	{

		case 1:
		{
			if( hasGrenades[id])
			{
				ColorChat(id,GREEN, "^1[^4%s^1]^1 You already have ^4Pack Grenades ", PREFIX);
				return PLUGIN_HANDLED;
			}
			
			if( golds < get_pcvar_num( gGrenades ))
			{
				ColorChat(id,GREEN, "^1[^4%s^1]^1 You don't have enough ^4Gold ^1to buy this item! ", PREFIX);
				return PLUGIN_HANDLED;
			}
			else
			{
				ColorChat(id,GREEN, "^1[^4%s^1]^1 You Have Buy ^4Pack Grenades", PREFIX)
				give_item( id, "weapon_hegrenade" )
				give_item( id, "weapon_flashbang" )
				give_item( id, "weapon_smokegrenade" )
				
				gGolds[id] -= get_pcvar_num( gGrenades )
				hasGrenades [id] = true;
			}
		}

		case 2:
		{
			if (hasSilent[id])
			{
				ColorChat(id,GREEN, "^1[^4%s^1]^1 You already have ^4Silent Walk ", PREFIX);
				return PLUGIN_HANDLED;
			}
			
			if( golds < get_pcvar_num( gSilentcost ))
			{
				ColorChat(id,GREEN, "^1[^4%s^1]^1 You don't have enough ^4Gold ^1to buy this item! ", PREFIX);
				return PLUGIN_HANDLED;
			}
			else
			{
				ColorChat(id,GREEN, "^1[^4%s^1]^1 You Have Buy ^4Silent Walk", PREFIX)
				set_user_footsteps( id, 1 );
				
				gGolds[id] -= get_pcvar_num( gSilentcost )
				hasSilent [id] = true;
			}
		}

		case 3:
		{
			if (hasHealth[id])
			{
				ColorChat(id,GREEN, "^1[^4%s^1]^1 You already have ^4Health ", PREFIX);
				return PLUGIN_HANDLED;
			}
			
			if( golds < get_pcvar_num( gHealthcost ))
			{
				ColorChat(id,GREEN, "^1[^4%s^1]^1 You don't have enough ^4Gold ^1to buy this item! ", PREFIX);
				return PLUGIN_HANDLED;
			}
			else
			{
				ColorChat(id,GREEN, "^1[^4%s^1]^1 You Have Buy ^4%d Health", PREFIX, get_pcvar_num( pHealth ))
				set_user_health( id, get_user_health( id ) + get_pcvar_num( pHealth ));
				
				gGolds[id] -= get_pcvar_num( gHealthcost )
				hasHealth [id] = true;
			}
		}

		case 4:
		{
			if (hasArmor[id])
			{
				ColorChat(id,GREEN, "^1[^4%s^1]^1 You already have ^4Armor ", PREFIX);
				return PLUGIN_HANDLED;
			}
			
			if( golds < get_pcvar_num( gArmorcost ))
			{
				ColorChat(id,GREEN, "^1[^4%s^1]^1 You don't have enough ^4Gold ^1to buy this item! ", PREFIX);
				return PLUGIN_HANDLED;
			}
			else
			{
				ColorChat(id,GREEN, "^1[^4%s^1]^1 You Have Buy ^4%d Armor", PREFIX, get_pcvar_num( pArmor ))
				set_user_armor( id, get_user_armor( id ) + get_pcvar_num( pArmor ) );
				
				gGolds[id] -= get_pcvar_num( gArmorcost )
				hasArmor [id] = true;
			}
		}

		case 5:
		{
			if (hasGravity[id])
			{
				ColorChat(id,GREEN, "^1[^4%s^1]^1 You already have ^4Gravity ", PREFIX);
				return PLUGIN_HANDLED;
			}
			
			if( golds < get_pcvar_num( gGravitycost ))
			{
				ColorChat(id,GREEN, "^1[^4%s^1]^1 You don't have enough ^4Gold ^1to buy this item! ", PREFIX);
				return PLUGIN_HANDLED;
			}
			else
			{
				ColorChat(id,GREEN, "^1[^4%s^1]^1 You Have Buy ^4Gravity", PREFIX)
				set_user_gravity( id, get_pcvar_float( gGravity ) );
				
				gGolds[id] -= get_pcvar_num( gGravitycost )
				hasGravity [id] = true;
			}
		}

		case 6:
		{
			if (hasSpeed[id])
			{
				ColorChat(id,GREEN, "^1[^4%s^1]^1 You already have ^4Faster Speed ", PREFIX);
				return PLUGIN_HANDLED;
			}
			
			if( golds < get_pcvar_num( gSpeedcost ))
			{
				ColorChat(id,GREEN, "^1[^4%s^1]^1 You don't have enough ^4Gold ^1to buy this item! ", PREFIX);
				return PLUGIN_HANDLED;
			}
			else
			{
				ColorChat(id,GREEN, "^1[^4%s^1]^1 You Have Buy ^4Faster Speed", PREFIX)
				set_user_maxspeed( id, get_pcvar_float( pSpeed ) );
				
				gGolds[id] -= get_pcvar_num( gSpeedcost )
				hasSpeed [id] = true;
			}
		}

		case 7:
		{
			if (hasInvisible[id])
			{
				ColorChat(id,GREEN, "^1[^4%s^1]^1 You already have ^4Invisible ", PREFIX);
				return PLUGIN_HANDLED;
			}
			
			if( golds < get_pcvar_num( gInvisiblecost ))
			{
				ColorChat(id,GREEN, "^1[^4%s^1]^1 You don't have enough ^4Gold ^1to buy this item! ", PREFIX);
				return PLUGIN_HANDLED;
			}
			else
			{
				ColorChat(id,GREEN, "^1[^4%s^1]^1 You Have Buy ^4Invisibility", PREFIX)
				set_user_rendering( id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 0 );
				
				gGolds[id] -= get_pcvar_num( gInvisiblecost )
				hasInvisible [id] = true;
			}
		}

		case 8:
		{
			if (bhopOn[id])
			{
				ColorChat(id,GREEN, "^1[^4%s^1]^1 You already have ^4Faster Bhop ", PREFIX);
				return PLUGIN_HANDLED;
			}
			
			if( golds < get_pcvar_num( gBhopcost ))
			{
				ColorChat(id,GREEN, "^1[^4%s^1]^1 You don't have enough ^4Gold ^1to buy this item! ", PREFIX);
				return PLUGIN_HANDLED;
			}
			else
			{
				ColorChat(id,GREEN, "^1[^4%s^1]^1 You Have Buy ^4Faster Bhop", PREFIX)
				
				gGolds[id] -= get_pcvar_num( gBhopcost )
				bhopOn[id] = true;
			}
		}

		case 9:
		{
			if (hasGlow[id])
			{
				ColorChat(id,GREEN, "^1[^4%s^1]^1 You already have ^4Goldenak ", PREFIX);
				return PLUGIN_HANDLED;
			}
			
			if( golds < get_pcvar_num( gGoldenakcost ))
			{
				ColorChat(id,GREEN, "^1[^4%s^1]^1 You don't have enough ^4Gold ^1to buy this item! ", PREFIX);
				return PLUGIN_HANDLED;
			}
			else
			{
				ColorChat(id,GREEN, "^1[^4%s^1]^1 You Have Buy ^4goldenak", PREFIX)
				client_cmd(id, "goldenshop_goldenak");
				
				gGolds[id] -= get_pcvar_num( gGoldenakcost )
				hasGlow [id] = true;
			}
		}

	}
	return PLUGIN_HANDLED;
}

/* ---| Show Players Golds Menu |--- */

public ShowPoints(id){
	static opcion[64]
   
	formatex(opcion, charsmax(opcion),"Show Players Golds :")
	new iMenu = menu_create(opcion, "Handlegolds")
   
	new players[32], pnum, tempid
	new szName[32], szTempid[10]
   
	get_players(players, pnum, "ch")
   
	for( new i; i<pnum; i++ )
	{

	tempid = players[i]
      
	get_user_name(tempid, szName, 31)
	num_to_str(tempid, szTempid, 9)
      
	formatex(opcion,127,"%s - \y[\r%i Golds\y]",szName, gGolds[tempid]);
	menu_additem(iMenu, opcion, szTempid, 0)
	}
   
	menu_display(id, iMenu)
	return PLUGIN_HANDLED
}

/* ---| Show Players Golds Handler |--- */

public Handlegolds(id, menu, item)
{
	if(item == MENU_EXIT)
	{
		return PLUGIN_HANDLED
	}
	
	new data[6], name[64]
	new access, callback
	
	menu_item_getinfo (menu, item, access, data, 5, name, 63, callback)
	new tempid = str_to_num (data)
	
	new szName[33], szPlayerName[33]
	
	get_user_name(id, szName, 32)
	get_user_name(tempid, szPlayerName, 32)
	
	ColorChat(id, RED, "^1[^4%s^1] User ^4%s ^1Have ^4%i ^1Golds!",PREFIX ,szPlayerName, gGolds[tempid])
	
	ShowPoints(id);
	
	return PLUGIN_CONTINUE
}

/* ---| Donate Golds Menu |--- */
	
public Donate_Menu(id)
{
	new iMenu = menu_create("Donate Players Menu", "handleDonate");
	
	new iPlayers[32], szName[32], szKey[3], iNum, iPlayer;
	get_players(iPlayers, iNum,"ch");
	
	for( new i; i < iNum; i++ )
	{
		iPlayer = iPlayers[i];
		
		num_to_str(iPlayer, szKey, charsmax(szKey));
		get_user_name(iPlayer, szName, charsmax(szName));
		
		menu_additem(iMenu, szName, szKey);
	}
	
	menu_setprop(iMenu, MPROP_EXITNAME, "Back");
	menu_display(id, iMenu, 0);
	return 0;
}

/* ---| Donate Golds Handler |--- */

public handleDonate(id, menu, item)
{
	if( item == MENU_EXIT )
	{
		menu_destroy(menu);
		return PLUGIN_HANDLED;
	}
	
	new szData[6], iAccess, iCallback;
	menu_item_getinfo(menu, item, iAccess, szData, charsmax(szData), _, _, iCallback);
	
	g_iTarget[id] = str_to_num(szData);
	new szName[32];
	get_user_name(g_iTarget[id], szName, charsmax(szName));
	
	client_cmd(id, "messagemode donate");
	return PLUGIN_HANDLED;
}

/* ---| Cmd Donate Golds |--- */

public CmdDonate(id)
{
	new szArg[5];
	read_argv(1, szArg, charsmax(szArg));
	
	
	new iValue = str_to_num(szArg);
	
	if( iValue > gGolds[id] )
	{
		ColorChat(id,GREEN, "^1[^4%s^1] You only have ^4%i ^1Golds", PREFIX , gGolds[id]);
		return PLUGIN_HANDLED;
	}
	
	new iTarget = g_iTarget[id];
	
	if( !iTarget )
	{
		return PLUGIN_HANDLED;
	}
	
	if( iTarget == id )
	{
		return PLUGIN_HANDLED;
	}
	
	gGolds[id] -= iValue;
	
	gGolds[iTarget] += iValue;
	
	new szName[2][32];
	get_user_name(iTarget, szName[0], charsmax(szName[]));
	get_user_name(id, szName[1], charsmax(szName[]));

	ColorChat(id,GREEN, "^1[^4%s^1] You donated ^4%i^1 Golds To ^4%s !", PREFIX , iValue, szName[0]);
	ColorChat(iTarget,GREEN, "^1[^4%s^1] ---^4%s^1--- Gives You ^4%i Golds", PREFIX, szName[1], iValue);
	
	
	return PLUGIN_HANDLED;
}

/* ---| When Round Start |--- */

public logevent_round_start()
{
	if( get_pcvar_num( gGoldSystem ) == 1 )
	{
		new iPlayers[ 32 ], iNum, i, id;
		get_players( iPlayers, iNum, "c" );
		
		for( i = 0; i < iNum; i++ )
		{
			id = iPlayers[ i ];
			
			bhopOn[ id ] = false;
			hasGrenades [ id ] = false;
			hasSilent [ id ] = false;
			hasHealth [ id ] = false;
			hasArmor [ id ] = false;
			hasGravity [ id ] = false;
			hasSpeed [ id ] = false;
			hasInvisible [ id ] = false;
			hasBhop [ id ] = false;
			hasGlow [ id ] = false;
		
			set_user_gravity( id, 1.0 );	
			set_user_maxspeed( id, 0.0 );
			set_user_rendering( id );
			set_user_footsteps( id, 0 );
		}
	}
}

/* ---| When Player Died |--- */

public Hook_Deathmessage()
{
	if( get_pcvar_num( gGoldSystem ) == 1 )
	{
		new killer = read_data( 1 );
		new victim = read_data( 2 );

		if( killer == victim )
		{
			return PLUGIN_HANDLED;
		}

		gGolds[ killer ] += get_pcvar_num( gGoldsbonus );

		bhopOn[ victim ] = false;
		hasGrenades [ victim ] = false;
		hasSilent [ victim ] = false;
		hasHealth [ victim ] = false;
		hasArmor [ victim ] = false;
		hasGravity [ victim ] = false;
		hasSpeed [ victim ] = false;
		hasInvisible [ victim ] = false;
		hasBhop [ victim ] = false;
		hasGlow [ victim ] = false;
	
		set_user_gravity( victim, 1.0 );	
		set_user_maxspeed( victim, 0.0 );
		set_user_rendering( victim );
		set_user_footsteps( victim, 0 );
		
	}
	
	return PLUGIN_CONTINUE;
}

/* ---| Cmd For Show Your Golds |--- */

public cmd_showgolds(id)
{	
	set_hudmessage(0, 255, 255, 0.0, 0.87, 0, 6.0, 12.0)
	show_hudmessage(id, "You Have %d Golds", gGolds [id] )
	
	client_print( id, print_chat, "You Have %d Golds", gGolds[ id ] );	
}

/* ---| Cmd For Set Golds |--- */

public cmd_set(id,level,cid)
{
	if(!cmd_access(id,level,cid,3))
	return PLUGIN_HANDLED
	    
	else
	{
		new target[32], pid
		read_argv(1,target,31)
		pid = cmd_target(id,target,2)
        
		new amountstr[10], amount
		read_argv(2,amountstr,9)
		amount = str_to_num(amountstr)
        
		new name[32], tname[32]
		get_user_name(id,name,31)
		get_user_name(pid,tname,31)
        
		gGolds[pid] += amount
		client_print(id, print_chat, "[%s] You Give %d Golds To %s", PREFIX, amount, tname)
		client_print(pid, print_chat, "[%s] Admin %s Give %d Gold To You . Now You Have %d Golds", PREFIX, name, amount)
	}	
	return PLUGIN_HANDLED
}

/* ---| Cmd For Reset Golds |--- */

public cmd_reset(id,level,cid)
{
	if(!cmd_access(id,level,cid,3))
		return PLUGIN_HANDLED
	
	else
	{
		new target[32], pid
		read_argv(1,target,31)
		pid = cmd_target(id,target,2)
		
		new amountstr[10], amount
		read_argv(2,amountstr,9)
		amount = str_to_num(amountstr)
		
		new name[32], tname[32]
		get_user_name(id,name,31)
		get_user_name(pid,tname,31)
		
		if((gGolds[pid] -= amount) < 0)
		
		amount = gGolds[pid]
			
		gGolds[pid] -= amount
		client_print(id, print_chat, "[%s] You Removed %d Points From %s", PREFIX, amount, tname)
		client_print(pid, print_chat, "[%s] %s Removed From You %d Points. Now You Have %d Points", PREFIX, name, amount)
	}
	return PLUGIN_HANDLED
}
/* ---| Client Prethink |--- */
public client_PreThink(id)  
{ 
	
	if( !bhopOn[id] ) 
		return PLUGIN_HANDLED; 
	
	entity_set_float(id, EV_FL_fuser2, 0.0) 
	
	if (entity_get_int(id, EV_INT_button) & 2)  
	{ 
		new flags = entity_get_int(id, EV_INT_flags) 
		
		if (flags & FL_WATERJUMP) 
			return PLUGIN_CONTINUE 
		if ( entity_get_int(id, EV_INT_waterlevel) >= 2 ) 
			return PLUGIN_CONTINUE 
		if ( !(flags & FL_ONGROUND) ) 
			return PLUGIN_CONTINUE 
		
		new Float:velocity[3] 
		entity_get_vector(id, EV_VEC_velocity, velocity) 
		velocity[0] *= 1.10
		velocity[1] *= 1.10
		velocity[2] += 250.0 
		entity_set_vector(id, EV_VEC_velocity, velocity) 
		
		entity_set_int(id, EV_INT_gaitsequence, 9) 
	} 
	return PLUGIN_CONTINUE 
}

/* ---| Save Players Golds |--- */

stock save_golds( index )
{
	gVault = nvault_open( "GOLDS_SAVE" );
	
	get_user_authid( index, gSteamID, charsmax( gSteamID ) );
	
	formatex( vKey, charsmax( vKey ), "%sGOLDS", gSteamID );
	formatex( vData, charsmax( vData ), "%d", gGolds[ index ] );
	nvault_set( gVault, vKey, vData );
	nvault_close( gVault );
}

/* ---| load Players Golds |--- */

stock load_golds( index )
{
	gVault = nvault_open( "GOLDS_SAVE" );
	
	get_user_authid( index, gSteamID, charsmax( gSteamID ) );

	formatex( vKey, charsmax( vKey ), "%sGOLDS", gSteamID );
	gGolds[ index ] = nvault_get( gVault, vKey );
	nvault_close( gVault );
}

/* The MSG VIP JBPacks this showing jbpacks*/
public JailbreakVIPPacks(id)
{
	new players[32],num, i,id

	get_players(players,num,"a")
	
	for(i=0;i<num;i++)
	{
	id = players[i]
	if(get_user_flags(id) & ADMIN_LEVEL_H) 
	{
		set_hudmessage(142, 239, 39, 0.85, 0.73, 0, 6.0, 12.0)
		ShowSyncHudMsg(id, syncObj,"VIP Golds: %i", gGolds[id])
	}
	}
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1036\\ f0\\ fs16 \n\\ par }
*/

Last edited by Brentio; 09-22-2020 at 15:56.
Brentio is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 09-22-2020 , 17:30   Re: Some helps at this script
Reply With Quote #2

You want to add this items to gold system shop ??
But why you want to add them together!!
Just edit those codes

from:
PHP Code:
public CmdBuyAk(id)
{
    if ( !
is_user_alive(id) )
    {
        
client_print(id,print_chat"^4[BB 6.8] To buy golden Ak 47 You need to be alive!")
        return 
PLUGIN_HANDLED
    
}
    
    new 
money cs_get_user_money(id)
    
    if (
money >= get_pcvar_num(cvar_cost))
    {
        
cs_set_user_money(idmoney get_pcvar_num(cvar_cost))
        
give_item(id"weapon_ak47")
        
g_HasAk[id] = true
    
}
    
    else
    {
        
client_print(idprint_chat"^4[BB 6.8] You dont hav enough money to buy Golden Ak 47. Cost $%d "get_pcvar_num(cvar_cost))
    }
    return 
PLUGIN_HANDLED

to:
Code:
public CmdBuyAk(id) {     give_item(id, "weapon_ak47")     g_HasAk[id] = true     return PLUGIN_CONTINUE }

And you can add code for check if user alive or haven't golds from gold system plugin
__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.
Supremache is offline
Brentio
New Member
Join Date: Sep 2020
Old 09-23-2020 , 14:06   Re: Some helps at this script
Reply With Quote #3

thanks. but can u fix this script ? sorry
Code:
#include <amxmodx>
#include <cstrike>
#include <fun>
#include <hamsandwich>
#include <fakemeta>
#include <engine>

#define NORMAL DontChange
#define GREEN DontChange
#define TEAM_COLOR DontChange
#define RED Red
#define BLUE Blue
#define GREY Grey
#define ColorChat client_print_color

#define VERSION "1.0"

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

#define Ham_Player_ResetMaxSpeed Ham_Item_PreFrame

#pragma semicolon 1

enum _:Colors {
	DontChange,
	Red,
	Blue,
	Grey
};

new const g_prefix[] = "[Base Builder Shop]";

new bool:g_bHasSuperM249[33],
	bool:g_bHasG3[33],
	bool:g_bHasAk47[33],
	bool:g_bHasM4a1[33],
	bool:g_bHasGAK[33];
	

new g_iMaxPlayers;

new g_pCvarCostAk47,
	g_pCvarCostM4a1,
	g_pCvarCostSuperM249,
	g_pCvarCostGAK,
	g_pCvarCostG3,
	g_pCvarQuantityHealthT1,
	g_pCvarCostHealthT1,
	g_pCvarQuantityHealthT2,
	g_pCvarCostHealthT2,

public plugin_init()
{
	register_plugin("Base Builder Shop", VERSION, "Kid");

	register_clcmd("say /shop", "ShowShop");
	register_clcmd("say_team /shop", "ShowShop");
	register_clcmd("say shop", "ShowShop");
	register_clcmd("say_team shop", "ShowShop");

	// Cvars CT
	g_pCvarCostM4 = register_cvar("shopbb_m4", "4000");
	g_pCvarCostAK = register_cvar("shopbb_ak", "4000");
	g_pCvarCostSuperM249 = register_cvar("shopbb_super_m249", "12000");
	g_pCvarCostG3 = register_cvar("shopbb_g3", "13000");
	g_pCvarCostGAK = register_cvar("shopbb_goldenak", "16000");
	
	// Cvars T
	g_pCvarQuantityHealthT1 = register_cvar("shopbb_health_t1", "15000");
	g_pCvarCostHealthT1 = register_cvar("shopbb_prix_health_t1", "15000");
	g_pCvarQuantityHealthT2 = register_cvar("shopbb_health_t2", "15000");
	g_pCvarCostHealthT2 = register_cvar("shopbb_prix_health_t2", "15000");

	RegisterHam(Ham_Spawn, "player", "Player_Spawn_Post", 1);
	RegisterHam(Ham_TakeDamage, "player", "ham_TakeDamage_Pre");
	RegisterHam(Ham_Player_ResetMaxSpeed, "player", "Player_ResetMaxSpeed",  1);
	
	g_iMaxPlayers = get_maxplayers();
}
 
public client_putinserver( id )
{ 
	g_bHasSuperM249[id] = false;
	g_bHasAk47[id] = false;
	g_bHasM4a1[id] = false;
	g_bHasG3[id] = false;
	g_bHasGAK[id] = false;
}
 
public ShowShop(id)
{
	if ( is_user_alive(id) )
	{
		new Text[64];
		
		if(cs_get_user_team(id) == CS_TEAM_T)
		{
			new menu1 = menu_create("\y[\rZombie Shop\y]", "ZombieShop");
			formatex(Text, charsmax(Text), "\w+%d HP \y[\r%d $\y]", get_pcvar_num(g_pCvarQuantityHealthT1), get_pcvar_num(g_pCvarCostHealthT1));
			menu_additem(menu1, Text, "0");
			formatex(Text, charsmax(Text), "\w+%d HP \y[\r%d $\y]", get_pcvar_num(g_pCvarQuantityHealthT2), get_pcvar_num(g_pCvarCostHealthT2));
			menu_additem(menu1, Text, "1");

			menu_setprop(menu1, MPROP_EXITNAME, "Exit");

			menu_display(id, menu1);
		}

		else if(cs_get_user_team(id) == CS_TEAM_CT)
		{
			new menu2 = menu_create ("\y[\rBase Builder Shop\y]", "BaseBuilderShop");	
			formatex(Text, charsmax(Text), "\wAK47 \y[\r%d $\y]", get_pcvar_num(g_pCvarCostAK));
			menu_additem(menu2, Text, "0");
			formatex(Text, charsmax(Text), "\wM4A1 \y[\r%d $\y]", get_pcvar_num(g_pCvarCostM4));
			menu_additem(menu2, Text, "1");
			formatex(Text, charsmax(Text), "\wM249 \y[\r%d $\y]", get_pcvar_num(g_pCvarCostSuperM249));
			menu_additem(menu2, Text, "2");
			formatex(Text, charsmax(Text), "\wG3SG1 \y[\r%d $\y]", get_pcvar_num(g_pCvarCostG3));
			menu_additem(menu2, Text, "3");
			formatex(Text, charsmax(Text), "\wAVI BB Ak47 \y[\r%d $\y]", get_pcvar_num(g_pCvarCostGAK));
			menu_additem(menu2, Text, "4");

			menu_display(id, menu2);
		}
	}
}

public ZombieShop(id, menu1, item)
{
	if (item == MENU_EXIT || !is_user_alive(id) || cs_get_user_team(id) != CS_TEAM_T) 
	{
		menu_destroy(menu1);
		return PLUGIN_HANDLED;
	}
	
	new iMoney = cs_get_user_money(id);

	switch(item)
	{
		case 0:
		{
			if ( iMoney >= get_pcvar_num(g_pCvarCostHealthT1))
			{			 
				cs_set_user_money(id, iMoney - get_pcvar_num(g_pCvarCostHealthT1));
				set_user_health(id, get_user_health(id) + get_pcvar_num(g_pCvarQuantityHealthT1));
				client_print_color(id, DontChange, "^4%s ^1You Bought ^3%d HP^1!", g_prefix, get_pcvar_num(g_pCvarQuantityHealthT1));
			}

			else
			{
				client_print_color(id, DontChange, "^4%s ^1You Don't Have Enough ^3Money^1!", g_prefix);
			}
		}
	   
		case 1:
		{
			if ( iMoney >= get_pcvar_num(g_pCvarCostHealthT2))
			{
				cs_set_user_money(id, iMoney - get_pcvar_num(g_pCvarCostHealthT2));
				set_user_health(id, get_user_health(id) + get_pcvar_num(g_pCvarQuantityHealthT2));
				client_print_color(id, DontChange, "^4%s ^1You Bought ^3%d HP^1!", g_prefix, get_pcvar_num(g_pCvarQuantityHealthT2));
			}

			else
			{
				client_print_color(id, DontChange, "^4%s ^1You Don't Have Enough ^3Money^1!", g_prefix);
			}
		}
	}
	menu_destroy(menu1);
	return PLUGIN_HANDLED;
}

public BaseBuilderShop(id, menu2, item)
{
	if (item == MENU_EXIT || !is_user_alive(id) || cs_get_user_team(id) != CS_TEAM_CT) 
	{
		menu_destroy(menu2);
		return PLUGIN_HANDLED;
	}
	
	new iMoney = cs_get_user_money(id);

	switch(item)
	{
		case 0:
		{
			if ( iMoney >= get_pcvar_num(g_pCvarCostAK))
			{
				cs_set_user_money(id, iMoney - get_pcvar_num(g_pCvarCostAK));
				give_item(id, "weapon_ak47");
				cs_set_user_bpammo(id, CSW_AK47, 200);
				g_bHasAk47[id] = true;
				client_print_color(id, DontChange, "^4%s ^1You Bought ^3AK47^1!", g_prefix);
			}
					
			else
			{
				client_print_color(id, DontChange, "^4%s ^1You Don't Have Enough ^3Money^1!", g_prefix);
			}
		}

		case 1:
		{
			if ( iMoney >= get_pcvar_num(g_pCvarCostM4))
			{
				cs_set_user_money(id, iMoney - get_pcvar_num(g_pCvarCostM4));
				give_item(id, "weapon_m4a1");
				cs_set_user_bpammo(id, CSW_M4A1, 200);
	            g_bHasM4a1[id] = true;
				client_print_color(id, DontChange, "^4%s ^1You Bought ^3M4A1^1!", g_prefix);
			}
				
			else
			{
				client_print_color(id, DontChange, "^4%s ^1You Don't Have Enough ^3Money^1!", g_prefix);
			}
		}

		case 2:
		{
			if ( iMoney >= get_pcvar_num(g_pCvarCostSuperM249))
			{
				cs_set_user_money(id, iMoney - get_pcvar_num(g_pCvarCostSuperM249));
				give_item(id, "weapon_m249");
				cs_set_user_bpammo(id, CSW_M249, 200);
				g_bHasSuperM249[id] = true;
				client_print_color(id, DontChange, "^4%s ^1You Bought ^3M249^1!", g_prefix);
			}
				
			else
			{
				client_print_color(id, DontChange, "^4%s ^1You Don't Have Enough ^3Money^1!", g_prefix);
			}
		}

		case 3:
		{
			if ( iMoney >= get_pcvar_num(g_pCvarCostG3))
			{
				cs_set_user_money(id, iMoney - get_pcvar_num(g_pCvarCostG3));
				give_item(id, "weapon_g3sg1");
				cs_set_user_bpammo(id, CSW_G3SG1, 200);
				g_bHasG3[id] = true;
				client_print_color(id, DontChange, "^4%s ^1You Bought ^3G3SG1^1!", g_prefix);
			}
			
			else
			{
				client_print_color(id, DontChange, "^4%s ^1You Don't Have Enough ^3Money^1!", g_prefix);
			}
		}	

		case 4:
		{
			if ( iMoney >= get_pcvar_num(g_pCvarCostGAK))
			{
				cs_set_user_money(id, iMoney - get_pcvar_num(g_pCvarCostGAK));
				client_cmd(id, "goldenshop_goldenak");
				g_bHasGAK[id] = true;
				client_print_color(id, DontChange, "^4%s ^1You Bought ^3AVI BB AK47^1!", g_prefix);
			}
			
			else
			{
				client_print_color(id, DontChange, "^4%s ^1You Don't Have Enough ^3Money^1!", g_prefix);
			}
		}		
	}
	menu_destroy(menu2);
	return PLUGIN_HANDLED;
}
 
public Player_Spawn_Post( id )
{
	if(is_user_alive(id))
	{
		client_print(id, print_chat, "Type /Shop to buy cool items!");
		g_bHasSuperM249[id] = false;
		g_bHasG3[id] = false;
		g_bHasAk47[id] = false;
		g_bHasM4a1[id] = false;
		g_bHasGAK[id] = false;
	}
}
 
public client_disconnect(id)
{
	g_bHasSuperM249[id] = false;
	g_bHasG3[id] = false;
	g_bHasM4a1[id] = false;
	g_bHasAk47[id] = false;
	g_bHasGAK[id] = false;
}
 
public ham_TakeDamage_Pre(victim, inflictor, attacker, Float:damage, damage_bits)
{
	if( !IsPlayer( attacker ) || !is_user_alive( attacker ) || inflictor != attacker )
	{
		return;
	}

	if ( g_bHasSuperM249[attacker] && get_user_weapon(attacker) == CSW_M249 )
	{
		SetHamParamFloat( 4, damage * 2 );
	}
	
	if ( g_bHasM4a1[attacker] && get_user_weapon(attacker) == CSW_M4A1 )
	{
		SetHamParamFloat( 4, damage * 2 );
	}
	
	if ( g_bHasAk47[attacker] && get_user_weapon(attacker) == CSW_AK47 )
	{
		SetHamParamFloat( 4, damage * 2 );
	}
	
	if ( g_bHasG3[attacker] && get_user_weapon(attacker) == CSW_G3SG1 )
	{
		SetHamParamFloat( 4, damage * 4 );
	}
	
}
stock const g_szTeamName[Colors][] = 
{
	"UNASSIGNED",
	"TERRORIST",
	"CT",
	"SPECTATOR"
};

stock client_print_color(id, iColor=DontChange, const szMsg[], any:...)
{
	if( id && !is_user_connected(id) )
	{
		return 0;
	}

	if( iColor > Grey )
	{
		iColor = DontChange;
	}

	new szMessage[192];
	if( iColor == DontChange )
	{
		szMessage[0] = 0x04;
	}
	else
	{
		szMessage[0] = 0x03;
	}

	new iParams = numargs();

	if(id)
	{
		if( iParams == 3 )
		{
			copy(szMessage[1], charsmax(szMessage)-1, szMsg);
		}
		else
		{
			vformat(szMessage[1], charsmax(szMessage)-1, szMsg, 4);
		}

		if( iColor )
		{
			new szTeam[11];
			get_user_team(id, szTeam, charsmax(szTeam));

			Send_TeamInfo(id, id, g_szTeamName[iColor]);
			Send_SayText(id, id, szMessage);
			Send_TeamInfo(id, id, szTeam);
		}
		else
		{
			Send_SayText(id, id, szMessage);
		}
	} 
	return 1;
}

stock Send_TeamInfo(iReceiver, iPlayerId, szTeam[])
{
	static iTeamInfo = 0;
	if( !iTeamInfo )
	{
		iTeamInfo = get_user_msgid("TeamInfo");
	}
	message_begin(iReceiver ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, iTeamInfo, .player=iReceiver);
	write_byte(iPlayerId);
	write_string(szTeam);
	message_end();
}

stock Send_SayText(iReceiver, iPlayerId, szMessage[])
{
	static iSayText = 0;
	if( !iSayText )
	{
		iSayText = get_user_msgid("SayText");
	}
	message_begin(iReceiver ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, iSayText, .player=iReceiver);
	write_byte(iPlayerId);
	write_string(szMessage);
	message_end();
}
i get this errors
Code:
//AMXXPC compile.exe
// by the AMX Mod X Dev Team


//// avi_shop.sma
// C:\Users\Mohamed\Desktop\s\avi_shop.sma(52) : error 020: invalid symbol name
""
// C:\Users\Mohamed\Desktop\s\avi_shop.sma(112) : error 017: undefined symbol "g
_pCvarCostAK"
// C:\Users\Mohamed\Desktop\s\avi_shop.sma(114) : error 017: undefined symbol "g
_pCvarCostM4"
// C:\Users\Mohamed\Desktop\s\avi_shop.sma(188) : error 017: undefined symbol "g
_pCvarCostAK"
// C:\Users\Mohamed\Desktop\s\avi_shop.sma(190) : error 017: undefined symbol "g
_pCvarCostAK"
// C:\Users\Mohamed\Desktop\s\avi_shop.sma(205) : error 017: undefined symbol "g
_pCvarCostM4"
// C:\Users\Mohamed\Desktop\s\avi_shop.sma(207) : error 017: undefined symbol "g
_pCvarCostM4"
// C:\Users\Mohamed\Desktop\s\avi_shop.sma(210) : warning 217: loose indentation

// C:\Users\Mohamed\Desktop\s\avi_shop.sma(211) : warning 217: loose indentation

// C:\Users\Mohamed\Desktop\s\avi_shop.sma(408) : warning 203: symbol is never u
sed: ""
// C:\Users\Mohamed\Desktop\s\avi_shop.sma(408) : warning 203: symbol is never u
sed: "g_pCvarCostAk47"
// C:\Users\Mohamed\Desktop\s\avi_shop.sma(408) : warning 203: symbol is never u
sed: "g_pCvarCostM4a1"
// C:\Users\Mohamed\Desktop\s\avi_shop.sma(408) : warning 203: symbol is never u
sed: "plugin_init"
//
// 7 Errors.
// Could not locate output file C:\Users\Mohamed\Desktop\s\compiled\avi_shop.amx
 (compile failed).
//
// Compilation Time: 1.06 sec
// ----------------------------------------

Last edited by Brentio; 09-23-2020 at 16:54.
Brentio is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 09-23-2020 , 21:19   Re: Some helps at this script
Reply With Quote #4

Fixed
Check this link : Base Builder Shop
P.s: You can enable/disable items from this shop
Code:
#include <amxmodx> #include <cstrike> #include <fun> #include <hamsandwich> #include <fakemeta> #include <engine> #define NORMAL DontChange #define GREEN DontChange #define TEAM_COLOR DontChange #define RED Red #define BLUE Blue #define GREY Grey #define ColorChat client_print_color #define VERSION "1.0" #define IsPlayer(%1) ( 1 <= %1 <= g_iMaxPlayers ) #define Ham_Player_ResetMaxSpeed Ham_Item_PreFrame enum _:Colors {     DontChange,     Red,     Blue,     Grey }; new const g_prefix[] = "[Base Builder Shop]"; new bool:g_bHasSuperM249[33]; new bool:g_bHasG3[33]; new bool:g_bHasAk47[33]; new bool:g_bHasM4a1[33]; new bool:g_bHasGAK[33];     new g_iMaxPlayers new g_pCvarCostAK, g_pCvarCostM4, g_pCvarCostSuperM249, g_pCvarCostGAK, g_pCvarCostG3, g_pCvarQuantityHealthT1, g_pCvarCostHealthT1, g_pCvarQuantityHealthT2, g_pCvarCostHealthT2 public plugin_init() {     register_plugin("Base Builder Shop", VERSION, "Kid");     register_clcmd("say /shop", "ShowShop");     register_clcmd("say_team /shop", "ShowShop");     register_clcmd("say shop", "ShowShop");     register_clcmd("say_team shop", "ShowShop");     // Cvars CT     g_pCvarCostM4 = register_cvar("shopbb_m4", "4000");     g_pCvarCostAK = register_cvar("shopbb_ak", "4000");     g_pCvarCostSuperM249 = register_cvar("shopbb_super_m249", "12000");     g_pCvarCostG3 = register_cvar("shopbb_g3", "13000");     g_pCvarCostGAK = register_cvar("shopbb_goldenak", "16000");         // Cvars T     g_pCvarQuantityHealthT1 = register_cvar("shopbb_health_t1", "15000");     g_pCvarCostHealthT1 = register_cvar("shopbb_prix_health_t1", "15000");     g_pCvarQuantityHealthT2 = register_cvar("shopbb_health_t2", "15000");     g_pCvarCostHealthT2 = register_cvar("shopbb_prix_health_t2", "15000");     RegisterHam(Ham_Spawn, "player", "Player_Spawn_Post", 1);     RegisterHam(Ham_TakeDamage, "player", "ham_TakeDamage_Pre");     RegisterHam(Ham_Player_ResetMaxSpeed, "player", "Player_ResetMaxSpeed"1);         g_iMaxPlayers = get_maxplayers(); }   public client_putinserver( id ) {     g_bHasSuperM249[id] = false;     g_bHasAk47[id] = false;     g_bHasM4a1[id] = false;     g_bHasG3[id] = false;     g_bHasGAK[id] = false; }   public ShowShop(id) {     if ( is_user_alive(id) )     {         new Text[64];                 if(cs_get_user_team(id) == CS_TEAM_T)         {             new menu1 = menu_create("\y[\rZombie Shop\y]", "ZombieShop");             formatex(Text, charsmax(Text), "\w+%d HP \y[\r%d $\y]", get_pcvar_num(g_pCvarQuantityHealthT1), get_pcvar_num(g_pCvarCostHealthT1));             menu_additem(menu1, Text, "0");             formatex(Text, charsmax(Text), "\w+%d HP \y[\r%d $\y]", get_pcvar_num(g_pCvarQuantityHealthT2), get_pcvar_num(g_pCvarCostHealthT2));             menu_additem(menu1, Text, "1");             menu_setprop(menu1, MPROP_EXITNAME, "Exit");             menu_display(id, menu1);         }         else if(cs_get_user_team(id) == CS_TEAM_CT)         {             new menu2 = menu_create ("\y[\rBase Builder Shop\y]", "BaseBuilderShop");                formatex(Text, charsmax(Text), "\wAK47 \y[\r%d $\y]", get_pcvar_num(g_pCvarCostAK));             menu_additem(menu2, Text, "0");             formatex(Text, charsmax(Text), "\wM4A1 \y[\r%d $\y]", get_pcvar_num(g_pCvarCostM4));             menu_additem(menu2, Text, "1");             formatex(Text, charsmax(Text), "\wM249 \y[\r%d $\y]", get_pcvar_num(g_pCvarCostSuperM249));             menu_additem(menu2, Text, "2");             formatex(Text, charsmax(Text), "\wG3SG1 \y[\r%d $\y]", get_pcvar_num(g_pCvarCostG3));             menu_additem(menu2, Text, "3");             formatex(Text, charsmax(Text), "\wAVI BB Ak47 \y[\r%d $\y]", get_pcvar_num(g_pCvarCostGAK));             menu_additem(menu2, Text, "4");             menu_display(id, menu2);         }     } } public ZombieShop(id, menu1, item) {     if (item == MENU_EXIT || !is_user_alive(id) || cs_get_user_team(id) != CS_TEAM_T)     {         menu_destroy(menu1);         return PLUGIN_HANDLED;     }         new iMoney = cs_get_user_money(id);     switch(item)     {         case 0:         {             if ( iMoney >= get_pcvar_num(g_pCvarCostHealthT1))             {                          cs_set_user_money(id, iMoney - get_pcvar_num(g_pCvarCostHealthT1));                 set_user_health(id, get_user_health(id) + get_pcvar_num(g_pCvarQuantityHealthT1));                 client_print_color(id, DontChange, "^4%s ^1You Bought ^3%d HP^1!", g_prefix, get_pcvar_num(g_pCvarQuantityHealthT1));             }             else             {                 client_print_color(id, DontChange, "^4%s ^1You Don't Have Enough ^3Money^1!", g_prefix);             }         }                case 1:         {             if ( iMoney >= get_pcvar_num(g_pCvarCostHealthT2))             {                 cs_set_user_money(id, iMoney - get_pcvar_num(g_pCvarCostHealthT2));                 set_user_health(id, get_user_health(id) + get_pcvar_num(g_pCvarQuantityHealthT2));                 client_print_color(id, DontChange, "^4%s ^1You Bought ^3%d HP^1!", g_prefix, get_pcvar_num(g_pCvarQuantityHealthT2));             }             else             {                 client_print_color(id, DontChange, "^4%s ^1You Don't Have Enough ^3Money^1!", g_prefix);             }         }     }     menu_destroy(menu1);     return PLUGIN_HANDLED; } public BaseBuilderShop(id, menu2, item) {     if (item == MENU_EXIT || !is_user_alive(id) || cs_get_user_team(id) != CS_TEAM_CT)     {         menu_destroy(menu2);         return PLUGIN_HANDLED;     }         new iMoney = cs_get_user_money(id);     switch(item)     {         case 0:         {             if ( iMoney >= get_pcvar_num(g_pCvarCostAK))             {                 cs_set_user_money(id, iMoney - get_pcvar_num(g_pCvarCostAK));                 give_item(id, "weapon_ak47");                 cs_set_user_bpammo(id, CSW_AK47, 200);                 g_bHasAk47[id] = true;                 client_print_color(id, DontChange, "^4%s ^1You Bought ^3AK47^1!", g_prefix);             }                                 else             {                 client_print_color(id, DontChange, "^4%s ^1You Don't Have Enough ^3Money^1!", g_prefix);             }         }         case 1:         {             if ( iMoney >= get_pcvar_num(g_pCvarCostM4))             {                 cs_set_user_money(id, iMoney - get_pcvar_num(g_pCvarCostM4));                 give_item(id, "weapon_m4a1");                 cs_set_user_bpammo(id, CSW_M4A1, 200);                 g_bHasM4a1[id] = true;                 client_print_color(id, DontChange, "^4%s ^1You Bought ^3M4A1^1!", g_prefix);             }                             else             {                 client_print_color(id, DontChange, "^4%s ^1You Don't Have Enough ^3Money^1!", g_prefix);             }         }         case 2:         {             if ( iMoney >= get_pcvar_num(g_pCvarCostSuperM249))             {                 cs_set_user_money(id, iMoney - get_pcvar_num(g_pCvarCostSuperM249));                 give_item(id, "weapon_m249");                 cs_set_user_bpammo(id, CSW_M249, 200);                 g_bHasSuperM249[id] = true;                 client_print_color(id, DontChange, "^4%s ^1You Bought ^3M249^1!", g_prefix);             }                             else             {                 client_print_color(id, DontChange, "^4%s ^1You Don't Have Enough ^3Money^1!", g_prefix);             }         }         case 3:         {             if ( iMoney >= get_pcvar_num(g_pCvarCostG3))             {                 cs_set_user_money(id, iMoney - get_pcvar_num(g_pCvarCostG3));                 give_item(id, "weapon_g3sg1");                 cs_set_user_bpammo(id, CSW_G3SG1, 200);                 g_bHasG3[id] = true;                 client_print_color(id, DontChange, "^4%s ^1You Bought ^3G3SG1^1!", g_prefix);             }                         else             {                 client_print_color(id, DontChange, "^4%s ^1You Don't Have Enough ^3Money^1!", g_prefix);             }         }            case 4:         {             if ( iMoney >= get_pcvar_num(g_pCvarCostGAK))             {                 cs_set_user_money(id, iMoney - get_pcvar_num(g_pCvarCostGAK));                 client_cmd(id, "goldenshop_goldenak");                 g_bHasGAK[id] = true;                 client_print_color(id, DontChange, "^4%s ^1You Bought ^3AVI BB AK47^1!", g_prefix);             }                         else             {                 client_print_color(id, DontChange, "^4%s ^1You Don't Have Enough ^3Money^1!", g_prefix);             }         }           }     menu_destroy(menu2);     return PLUGIN_HANDLED; }   public Player_Spawn_Post( id ) {     if(is_user_alive(id))     {         client_print(id, print_chat, "Type /Shop to buy cool items!");         g_bHasSuperM249[id] = false;         g_bHasG3[id] = false;         g_bHasAk47[id] = false;         g_bHasM4a1[id] = false;         g_bHasGAK[id] = false;     } }   public client_disconnect(id) {     g_bHasSuperM249[id] = false;     g_bHasG3[id] = false;     g_bHasM4a1[id] = false;     g_bHasAk47[id] = false;     g_bHasGAK[id] = false; }   public ham_TakeDamage_Pre(victim, inflictor, attacker, Float:damage, damage_bits) {     if( !IsPlayer( attacker ) || !is_user_alive( attacker ) || inflictor != attacker )     {         return;     }     if ( g_bHasSuperM249[attacker] && get_user_weapon(attacker) == CSW_M249 )     {         SetHamParamFloat( 4, damage * 2 );     }         if ( g_bHasM4a1[attacker] && get_user_weapon(attacker) == CSW_M4A1 )     {         SetHamParamFloat( 4, damage * 2 );     }         if ( g_bHasAk47[attacker] && get_user_weapon(attacker) == CSW_AK47 )     {         SetHamParamFloat( 4, damage * 2 );     }         if ( g_bHasG3[attacker] && get_user_weapon(attacker) == CSW_G3SG1 )     {         SetHamParamFloat( 4, damage * 4 );     }     } stock const g_szTeamName[Colors][] = {     "UNASSIGNED",     "TERRORIST",     "CT",     "SPECTATOR" }; stock client_print_color(id, iColor=DontChange, const szMsg[], any:...) {     if( id && !is_user_connected(id) )     {         return 0;     }     if( iColor > Grey )     {         iColor = DontChange;     }     new szMessage[192];     if( iColor == DontChange )     {         szMessage[0] = 0x04;     }     else     {         szMessage[0] = 0x03;     }     new iParams = numargs();     if(id)     {         if( iParams == 3 )         {             copy(szMessage[1], charsmax(szMessage)-1, szMsg);         }         else         {             vformat(szMessage[1], charsmax(szMessage)-1, szMsg, 4);         }         if( iColor )         {             new szTeam[11];             get_user_team(id, szTeam, charsmax(szTeam));             Send_TeamInfo(id, id, g_szTeamName[iColor]);             Send_SayText(id, id, szMessage);             Send_TeamInfo(id, id, szTeam);         }         else         {             Send_SayText(id, id, szMessage);         }     }     return 1; } stock Send_TeamInfo(iReceiver, iPlayerId, szTeam[]) {     static iTeamInfo = 0;     if( !iTeamInfo )     {         iTeamInfo = get_user_msgid("TeamInfo");     }     message_begin(iReceiver ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, iTeamInfo, .player=iReceiver);     write_byte(iPlayerId);     write_string(szTeam);     message_end(); } stock Send_SayText(iReceiver, iPlayerId, szMessage[]) {     static iSayText = 0;     if( !iSayText )     {         iSayText = get_user_msgid("SayText");     }     message_begin(iReceiver ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, iSayText, .player=iReceiver);     write_byte(iPlayerId);     write_string(szMessage);     message_end(); }
__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.

Last edited by Supremache; 09-23-2020 at 21:21.
Supremache is offline
Brentio
New Member
Join Date: Sep 2020
Old 10-01-2020 , 11:40   Re: Some helps at this script
Reply With Quote #5

does anyone have knife menu for basebuilder and just for vips ? with ability

like

knife1 - multi jump
knife 2 - double damage
knife 3 - speed
knife 4 - gravity
Brentio is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 10-01-2020 , 21:41   Re: Some helps at this script
Reply With Quote #6

Quote:
Originally Posted by Brentio View Post
does anyone have knife menu for basebuilder and just for vips ? with ability

like

knife1 - multi jump
knife 2 - double damage
knife 3 - speed
knife 4 - gravity
Search there's many plugin like that on google/youtube,
__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.
Supremache is offline
Zeky
Member
Join Date: Jul 2019
Old 10-02-2020 , 01:44   Re: Some helps at this script
Reply With Quote #7

Quote:
Originally Posted by Brentio View Post
does anyone have knife menu for basebuilder and just for vips ? with ability

like

knife1 - multi jump
knife 2 - double damage
knife 3 - speed
knife 4 - gravity

Use OciXCrom Knife System
Zeky is offline
Brentio
New Member
Join Date: Sep 2020
Old 10-02-2020 , 09:39   Re: Some helps at this script
Reply With Quote #8

i found one but how i can make it just for vips.
Code:
#include <amxmodx>
#include <amxmisc>
#include <engine> 
#include <vault>
#include <fun>

#define PLUGIN "Knife Mod"
#define VERSION "1.0" 
#define AUTHOR "spunko"

#define TASK_INTERVAL 4.0  
#define MAX_HEALTH 255  
#define ACCESS ADMIN_LEVEL_H FLAG

new knife_model[33] 
new g_Menu

new CVAR_HIGHSPEED
new CVAR_LOWSPEED
new CVAR_LOWGRAV
new CVAR_NORMGRAV
new CVAR_HEALTH_ADD
new CVAR_HEALTH_MAX
new CVAR_DAMAGE 

public plugin_init() { 
	
	register_plugin(PLUGIN, VERSION, AUTHOR) 
	
	register_event( "Damage", "event_damage", "be" )
	register_event("CurWeapon","CurWeapon","be","1=1") 
	
	g_Menu = register_menuid("Knife Mod")
	register_menucmd(g_Menu, 1023, "knifemenu")
	
	register_clcmd("say /knife", "display_knife")
	
	CVAR_HIGHSPEED = register_cvar("km_highspeed","340")
	CVAR_LOWSPEED = register_cvar("km_lowspeed","170")
	CVAR_HEALTH_ADD = register_cvar("km_addhealth", "3")
	CVAR_HEALTH_MAX = register_cvar("km_maxhealth", "75")
	CVAR_DAMAGE = register_cvar("km_damage", "2")
	CVAR_LOWGRAV = register_cvar("km_lowgravity" , "400")
	CVAR_NORMGRAV = get_cvar_pointer("sv_gravity")
	
	set_task(480.0, "kmodmsg", 0, _, _, "b")
}

public plugin_precache() { 
	precache_model("models/knife-mod/v_butcher.mdl") 
	precache_model("models/knife-mod/p_butcher.mdl") 
	precache_model("models/knife-mod/v_machete.mdl")
	precache_model("models/knife-mod/p_machete.mdl")
	precache_model("models/knife-mod/v_bak.mdl")
	precache_model("models/knife-mod/p_bak.mdl")
	precache_model("models/knife-mod/v_pocket.mdl")
	precache_model("models/knife-mod/p_pocket.mdl")
	precache_model("models/v_knife.mdl") 
	precache_model("models/p_knife.mdl")
} 

public display_knife(id) {
	new menuBody[512]
	add(menuBody, 511, "\rKnife Mod\w^n^n")
	add(menuBody, 511, "1. Machete \y(More Damage/Low Speed)\w^n")
	add(menuBody, 511, "2. Bak Knife \y(No Footsteps)\w^n")
	add(menuBody, 511, "3. Pocket Knife \y(High Speed)\w^n")
	add(menuBody, 511, "4. Butcher Knife \y(Low Gravity)\w^n")
	add(menuBody, 511, "5. Default Knife \y(Health Regeneration)\w^n^n")
	add(menuBody, 511, "0. Exit^n")
	
	new keys = ( 1<<0 | 1<<1 | 1<<2 | 1<<3 | 1<<4 | 1<<9 )
	show_menu(id, keys, menuBody, -1, "Knife Mod")
}

public knifemenu(id, key) {
	switch(key) 
	{
		case 0: SetKnife(id , 4)
		case 1: SetKnife(id , 2)
		case 2: SetKnife(id , 3)
		case 3: SetKnife(id , 1)
		case 4: SetKnife(id , 0)
		default: return PLUGIN_HANDLED
	}
	SaveData(id)
	return PLUGIN_HANDLED
} 

public SetKnife(id , Knife) {
	knife_model[id] = Knife
	
	new Clip, Ammo, Weapon = get_user_weapon(id, Clip, Ammo) 
    if (item == MENU_EXIT || !is_user_alive(id) || cs_get_user_team(id) != CS_TEAM_CT) 
		return PLUGIN_HANDLED
	
	new vModel[56],pModel[56]
	
	switch(Knife)
	{
		case 0: {
			format(vModel,55,"models/v_knife.mdl")
			format(pModel,55,"models/p_knife.mdl")
			give_item(id, "weapon_knife");
		}
		case 1: {
			format(vModel,55,"models/knife-mod/v_butcher.mdl")
			format(pModel,55,"models/knife-mod/p_butcher.mdl")
			give_item(id, "weapon_knife");
		}
		case 2: {
			format(vModel,55,"models/knife-mod/v_bak.mdl")
			format(pModel,55,"models/knife-mod/p_bak.mdl")
			give_item(id, "weapon_knife");
		}
		case 3: {
			format(vModel,55,"models/knife-mod/v_pocket.mdl")
			format(pModel,55,"models/knife-mod/p_pocket.mdl")
			give_item(id, "weapon_knife");
		}
		case 4: {
			format(vModel,55,"models/knife-mod/v_machete.mdl")
			format(pModel,55,"models/knife-mod/p_machete.mdl")
			give_item(id, "weapon_knife");
		}
	} 
	
	entity_set_string(id, EV_SZ_viewmodel, vModel)
	entity_set_string(id, EV_SZ_weaponmodel, pModel)
	
	return PLUGIN_HANDLED;  
}

public event_damage( id ) {
	
	new victim_id = id;
	if( !is_user_connected( victim_id ) ) return PLUGIN_CONTINUE
	new dmg_take = read_data( 2 );
	new dmgtype = read_data( 3 );
	new Float:multiplier = get_pcvar_float(CVAR_DAMAGE);
	new Float:damage = dmg_take * multiplier;
	new health = get_user_health( victim_id );
	
	new iWeapID, attacker_id = get_user_attacker( victim_id, iWeapID );
	
	if( !is_user_connected( attacker_id ) || !is_user_alive( victim_id ) ) {
		return PLUGIN_HANDLED
	}
	
	if( iWeapID == CSW_KNIFE && knife_model[attacker_id] == 4 ) {
		
		if( floatround(damage) >= health ) {
			if( victim_id == attacker_id ) {
				return PLUGIN_CONTINUE
				}else{
				log_kill( attacker_id, victim_id, "knife", 0 );
			}
			
			return PLUGIN_CONTINUE
			}else {
			if( victim_id == attacker_id ) return PLUGIN_CONTINUE
			
			fakedamage( victim_id, "weapon_knife", damage, dmgtype );
		}
	}
	return PLUGIN_CONTINUE
}

public CurWeapon(id)
	{
	new Weapon = read_data(2)
	
	// Set Knife Model
	SetKnife(id, knife_model[id])   
	
	// Task Options
	
	if(knife_model[id] == 0 && !task_exists(id) && Weapon == CSW_KNIFE)
		set_task(TASK_INTERVAL , "task_healing",id,_,_,"b")
	else if(task_exists(id))
		remove_task(id)
	
	// Abilities
	set_user_footsteps(id , ( (knife_model[id] == 2 && Weapon == CSW_KNIFE) ? 1 : 0) )
	
	new Float:Gravity = ((knife_model[id] == 1 && Weapon == CSW_KNIFE)? get_pcvar_float(CVAR_LOWGRAV) : get_pcvar_float(CVAR_NORMGRAV)) / 800.0
	set_user_gravity(id , Gravity)
	
	// Speed
	new Float:Speed
	if(Weapon != CSW_KNIFE || knife_model[id] < 3)
		return PLUGIN_CONTINUE
	else if(knife_model[id] == 3)
		Speed = get_pcvar_float(CVAR_HIGHSPEED)
	else if(knife_model[id] == 4)
		Speed = get_pcvar_float(CVAR_LOWSPEED)
	
	set_user_maxspeed(id, Speed)
	
	return PLUGIN_HANDLED   
	
}

stock log_kill(killer, victim, weapon[],headshot) {
	user_silentkill( victim );
	
	message_begin( MSG_ALL, get_user_msgid( "DeathMsg" ), {0,0,0}, 0 );
	write_byte( killer );
	write_byte( victim );
	write_byte( headshot );
	write_string( weapon );
	message_end();
	
	new kfrags = get_user_frags( killer );
	set_user_frags( killer, kfrags++ );
	new vfrags = get_user_frags( victim );
	set_user_frags( victim, vfrags++ );
	
	return  PLUGIN_CONTINUE
} 


public task_healing(id) {  
	new addhealth = get_pcvar_num(CVAR_HEALTH_ADD)  
	if (!addhealth)
		return  
	
	new maxhealth = get_pcvar_num(CVAR_HEALTH_MAX)  
	if (maxhealth > MAX_HEALTH) { 
		set_pcvar_num(CVAR_HEALTH_MAX, MAX_HEALTH)  
		maxhealth = MAX_HEALTH 
	}  
	
	new health = get_user_health(id)   
	
	if (is_user_alive(id) && (health < maxhealth)) { 
		set_user_health(id, health + addhealth)
		set_hudmessage(0, 255, 0, -1.0, 0.25, 0, 1.0, 2.0, 0.1, 0.1, 4)
		show_hudmessage(id,"<< !!HEAL IN PROGRESS!! >>")
		message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, id)
		write_short(1<<10)
		write_short(1<<10)
		write_short(0x0000)
		write_byte(0)
		write_byte(200)
		write_byte(0)
		write_byte(75)
		message_end()
	}
	
	else {
		if (is_user_alive(id) && (health > maxhealth))
			remove_task(id)
	}
}  

public client_disconnect(id) {  
	if(task_exists(id)) remove_task(id)  
}  


public kmodmsg() { 
	
	client_print(0,print_chat,"[AMXX] Type /knife to change your knife skins")
}  

public client_authorized(id)
	{
	LoadData(id)
}

SaveData(id)
{ 
	
	new authid[32]
	get_user_authid(id, authid, 31)
	
	new vaultkey[64]
	new vaultdata[64]
	
	format(vaultkey, 63, "KMOD_%s", authid)
	format(vaultdata, 63, "%d", knife_model[id])
	set_vaultdata(vaultkey, vaultdata)
}

LoadData(id) 
{ 
	new authid[32] 
	get_user_authid(id,authid,31)
	
	new vaultkey[64], vaultdata[64]
	
	format(vaultkey, 63, "KMOD_%s", authid)
	get_vaultdata(vaultkey, vaultdata, 63)
	knife_model[id] = str_to_num(vaultdata)
	
} 
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/
i putted
Code:
 if (item == MENU_EXIT || !is_user_alive(id) || cs_get_user_team(id) != CS_TEAM_CT)
to make it just for cts but i got errors.
Code:
//AMXXPC compile.exe
// by the AMX Mod X Dev Team


//// knife_menu.sma
// C:\Users\Mohamed\Desktop\CS1.6 Mods\s\knife_menu.sma(94) : warning 217: loose
 indentation
// C:\Users\Mohamed\Desktop\CS1.6 Mods\s\knife_menu.sma(94) : error 017: undefin
ed symbol "item"
// C:\Users\Mohamed\Desktop\CS1.6 Mods\s\knife_menu.sma(97) : warning 217: loose
 indentation
// C:\Users\Mohamed\Desktop\CS1.6 Mods\s\knife_menu.sma(132) : warning 204: symb
ol is assigned a value that is never used: "Weapon"
//
// 1 Error.
// Could not locate output file C:\Users\Mohamed\Desktop\CS1.6 Mods\s\compiled\k
nife_menu.amx (compile failed).
//
// Compilation Time: 1.74 sec
// ----------------------------------------

Press enter to exit ...

Last edited by Brentio; 10-02-2020 at 09:44.
Brentio is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:59.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode