Shop or anything for Coins Plugin?

В този раздел можете да подавате всякакви заявки за намиране, изработка или преработка на плъгини/модове.
Аватар
Infamous2018
Извън линия
Foreigner
Foreigner
Мнения: 522
Регистриран на: 08 Апр 2018, 16:56
Се отблагодари: 14 пъти
Получена благодарност: 21 пъти

Shop or anything for Coins Plugin?

Мнение от Infamous2018 » 30 Мар 2020, 11:55

Hello, is there anywhere an Shop for the Coinssystem? I am using this here but u get coins and idk what i can do with this. Anyone have an shop or an idea ?

Код за потвърждение: Избери целия код

#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

#define PLUGIN "Coins System"
#define VERSION "1.0"
#define AUTHOR "6u3oH"

#define CLASSNAME_DEFAULT "info_null"
#define CLASSNAME_SET "info_coin"
#define PATH_DATABASE "addons/amxmodx/data/coins_system.dat"
#define COIN_MODEL "models/coin/mario_coin.mdl"
#define COIN_SOUND "coin/coin.wav"

#define PDATA_KILLHEAD_OFFSET 75
#define PDATA_KILLGREN_OFFSET 76
#define PDATA_PLAYER_OFFSET 5

/*----------------------------------------------------------
 ------------------------ ????????? ------------------------
 ---------------------------------------------------------*/

#define VIP_FLAG ADMIN_LEVEL_H

#define COIN_GIVE_KILL 1 // Wie viele Münzen für einen einfachen Kill geben sollen
#define COIN_GIVE_KILL_HEAD 1 // Wie viele Münzen für einen Kill am Kopf geben sollen
#define COIN_GIVE_KILL_KNIFE 1 // Wie viele Münzen für einen Messertod geben sollen
#define COIN_GIVE_KILL_GRENADE 1 // Wie viele Münzen zum Töten einer Granate geben sollen

#define COIN_DROP_COINS // Kommentiere die Zeile aus, damit keine Münzen aus dem Player fallen
#define COIN_NUM_DROPKILL_MIN 1 // Die Mindestanzahl an Münzen, die fallen, wenn ein Spieler stirbt
#define COIN_NUM_DROPKILL_MAX 1 // Die maximale Anzahl von Münzen, die fallen, wenn ein Spieler stirbt

#define COIN_TIME_REMOVE 10 // Nach wie vielen Sekunden werden die abgelegten Münzen entfernt (auskommentieren, damit sie erst am Ende der Runde entfernt werden)

/*----------------------------------------------------------
 ------------------------ ????????? ------------------------
 ---------------------------------------------------------*/

new g_iMaxPlayers;
new g_iCoin[33];

public plugin_precache()
{
	precache_model(COIN_MODEL);
	precache_sound(COIN_SOUND);
}

public plugin_cfg() write_file(PATH_DATABASE, "[Datenbank] [Coins System]", 0);
public client_connect(id) load_coins(id);
public client_disconnected(id) save_coins(id);

public plugin_natives()
{
	register_native("get_user_coins", "get_user_coins", true)
	register_native("set_user_coins", "set_user_coins", true)
}

public get_user_coins(id) return g_iCoin[id];
public set_user_coins(id, iNum) g_iCoin[id] = iNum;

public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR);
	
	#if defined COIN_DROP_COINS
	RegisterHam(Ham_Killed, "player", "fw_KilledPlayerPost", true);
	#endif
	RegisterHam(Ham_Touch, CLASSNAME_DEFAULT, "fw_TouchCoinPost", true);
	#if defined COIN_TIME_REMOVE
	RegisterHam(Ham_Think, CLASSNAME_DEFAULT, "fw_ThinkCoinPost", true);
	#endif
	
	register_logevent("event_RoundEnd", 2, "1=Round_End");

	g_iMaxPlayers = get_maxplayers();
	set_task(2.0, "Task_HudMsg", .flags = "b");
}

#if defined COIN_DROP_COINS
public fw_KilledPlayerPost(iVictim, iAttacker, iCorpse)
{
	if(!is_user_connected(iVictim))
		return;
		
	if(g_iCoin[iVictim] > 0)
	{
		new Float: fOrigin[3], Float: fVelocity[3];
		pev(iVictim, pev_origin, fOrigin);
		
		new iRandom = random_num(COIN_NUM_DROPKILL_MIN, COIN_NUM_DROPKILL_MAX);
		
		for(new i; i <= iRandom; i++)
		{
			if(!g_iCoin[iVictim])
				return;
			
			new iEnt = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, CLASSNAME_DEFAULT));
			
			set_pev(iEnt, pev_classname, CLASSNAME_SET);
			set_pev(iEnt, pev_origin, fOrigin);
			set_pev(iEnt, pev_solid, SOLID_TRIGGER);
			set_pev(iEnt, pev_movetype, MOVETYPE_BOUNCE);
			
			engfunc(EngFunc_SetSize, iEnt, Float: {-10.0, -10.0, -10.0}, Float: {10.0, 10.0, 10.0});
			engfunc(EngFunc_SetModel, iEnt, COIN_MODEL);
			
			fVelocity[0] = random_float(10.0, 50.0);
			fVelocity[1] = random_float(10.0, 50.0);
			fVelocity[2] = random_float(100.0, 150.0);
	    
			set_pev(iEnt, pev_velocity, fVelocity);
			
			#if defined COIN_TIME_REMOVE
			set_pev(iEnt, pev_nextthink, get_gametime() + COIN_TIME_REMOVE);
			#endif
		}
	}
		
	if(!is_user_connected(iAttacker))
		return;
	
	if(iVictim == iAttacker)
		return;
	
	new iGiveCoin = g_iCoin[iAttacker];
	
	if(get_pdata_int(iVictim, PDATA_KILLGREN_OFFSET) & DMG_GRENADE)
		g_iCoin[iAttacker] += COIN_GIVE_KILL_GRENADE;
	else if(iAttacker == pev(iVictim, pev_dmg_inflictor) && get_user_weapon(iAttacker) == CSW_KNIFE)
		g_iCoin[iAttacker] += COIN_GIVE_KILL_KNIFE;
	else if(get_pdata_int(iVictim, PDATA_KILLHEAD_OFFSET, PDATA_PLAYER_OFFSET) == HIT_HEAD)
		g_iCoin[iAttacker] += COIN_GIVE_KILL_HEAD;
	else
		g_iCoin[iAttacker] += COIN_GIVE_KILL;
		
	if(get_user_flags(iAttacker) & VIP_FLAG)
		g_iCoin[iAttacker] *= 2;
		
	iGiveCoin = g_iCoin[iAttacker] - iGiveCoin;
		
	set_hudmessage(0, 255, 0, -1.0, 0.26, 0, 0.1, 2.0, 0.1, 0.1, 3);
	show_hudmessage(iAttacker, "+%i ?????", iGiveCoin);
}

public fw_TouchCoinPost(iEnt, id)
{
	if(!pev_valid(iEnt) || !is_user_alive(id))
		return;
			
	static sClassName[32];
	pev(iEnt, pev_classname, sClassName, charsmax(sClassName));
		
	if(!equal(sClassName, CLASSNAME_SET))
		return;
		
	g_iCoin[id]++;
	emit_sound(id, CHAN_WEAPON, COIN_SOUND, VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
	
	set_pev(iEnt, pev_flags, pev(iEnt, pev_flags) | FL_KILLME);
}
#endif

#if defined COIN_TIME_REMOVE
public fw_ThinkCoinPost(iEnt)
{
	if(!pev_valid(iEnt))
		return;
		
	static sClassName[32];
	pev(iEnt, pev_classname, sClassName, charsmax(sClassName));
	
	if(!equal(sClassName, CLASSNAME_SET))
		return;
		
	set_pev(iEnt, pev_flags, pev(iEnt, pev_flags) | FL_KILLME);
}
#endif

public event_RoundEnd()
{
	new iEnt = FM_NULLENT;
	
	while((iEnt = engfunc(EngFunc_FindEntityByString, iEnt, "classname", CLASSNAME_SET)))
		if(pev_valid(iEnt))
			set_pev(iEnt, pev_flags, pev(iEnt, pev_flags) | FL_KILLME);
}

public Task_HudMsg()
{
	set_hudmessage(200, 200, 200, 0.01, 0.90, 0, 0.1, 1.0, 0.1, 0.1, 4);
	
	for(new id = 1; id < g_iMaxPlayers; id++)
	{
		if(!is_user_alive(id))
			continue;
		
		show_hudmessage(id, "???? ??????: %i", g_iCoin[id]);
	}
}

public load_coins(id)
{
	new iLine = 1, iLen, sData[64], sKey[38], sAuthID[38];
	get_user_authid(id, sAuthID, charsmax(sAuthID));
	
	while((iLine = read_file(PATH_DATABASE, iLine, sData, charsmax(sData), iLen)))
	{
		parse(sData, sKey, 37);
		
		if(equal(sKey, sAuthID))
		{
			parse(sData, sKey, 37, sKey, 37);
			g_iCoin[id] = str_to_num(sKey);
			
			return;
		}
	}
	
	g_iCoin[id] = 0;
}

public save_coins(id)
{
	new iLine = 1, iLen, sData[64], sKey[38], sAuthID[38];
	get_user_authid(id, sAuthID, charsmax(sAuthID));
	
	while((iLine = read_file(PATH_DATABASE, iLine, sData, charsmax(sData), iLen)))
	{
		parse(sData, sKey, 37);
		
		if(equal(sKey, sAuthID))
		{
			format(sData, charsmax(sData), "%s %i", sAuthID, g_iCoin[id]);
			write_file(PATH_DATABASE, sData, iLine-1);
			
			return;
		}
	}
	
	format(sData, charsmax(sData), "%s %i", sAuthID, g_iCoin[id]);
	write_file(PATH_DATABASE, sData, -1);
}

Аватар
atmax
Извън линия
Потребител
Потребител
Мнения: 492
Регистриран на: 22 Мар 2018, 15:06
Се отблагодари: 37 пъти
Получена благодарност: 43 пъти

Shop or anything for Coins Plugin?

Мнение от atmax » 30 Мар 2020, 12:33

Download one shop plugin and then use those natives:

Код за потвърждение: Избери целия код

public plugin_natives()
{
	register_native("get_user_coins", "get_user_coins", true)
	register_native("set_user_coins", "set_user_coins", true)
}
Rest in peace my friend I always will remember you! 🖤👊

Аватар
Infamous2018
Извън линия
Foreigner
Foreigner
Мнения: 522
Регистриран на: 08 Апр 2018, 16:56
Се отблагодари: 14 пъти
Получена благодарност: 21 пъти

Shop or anything for Coins Plugin?

Мнение от Infamous2018 » 30 Мар 2020, 13:14

Found this one, could u add this native maybe ?

i added in line this

public plugin_natives()
{
register_native("get_user_coins", "get_user_coins", true)
register_native("set_user_coins", "set_user_coins", true)
}

Now it should work only via coins????

Код за потвърждение: Избери целия код

/********************************************************/
/* Mega Shop by: TheArmagedon 				*/	
/*							*/
/* ##Weapon Shop##					*/
/* ##Extras Shop##					*/
/* ##Admin Shop##					*/
/*							*/		
/* Change the Cvars on mega_shop.cfg			*/
/*							*/	
/* Sorry if my english is bad.				*/
/*							*/
/********************************************************/

////////////////////////////////////////////////////////////////////////////////////////////////////
// INCLUDES
////////////////////////////////////////////////////////////////////////////////////////////////////
#include <amxmodx>
#include <fun>
#include <fakemeta_util>
#include <hamsandwich>
#include <amxmisc>
#include <cstrike>
#include <engine>
////////////////////////////////////////////////////////////////////////////////////////////////////
// Define
////////////////////////////////////////////////////////////////////////////////////////////////////
#define HE_GRENADE	(1<<0)
#define SMOKE_GRENADE	(1<<1)
#define FLASH_GRENADE	(1<<2)

#define MAX_PLAYERS	32
#define MAXSLOTS 32

////////////////////////////////////////////////////////////////////////////////////////////////////
// COLORCHAT
////////////////////////////////////////////////////////////////////////////////////////////////////
enum Color
{
	YELLOW = 1, // Yellow
	GREEN, // Green Color
	TEAM_COLOR, // Red, grey, blue
	GREY, // grey
	RED, // Red
	BLUE, // Blue
}

new TeamInfo;
new SayText;
new MaxSlots;

new TeamName[][] = 
{
	"",
	"TERRORIST",
	"CT",
	"SPECTATOR"
}
new bool:IsConnected[MAXSLOTS + 1];

////////////////////////////////////////////////////////////////////////////////////////////////////
// Pcvars
////////////////////////////////////////////////////////////////////////////////////////////////////
new plugin_onoff, specspeed, speclife, specgrav, gravcost, ammocost, speccost, bhopcost, silentcost, glowcost
new gravityam, bhop_onoff, ammo_onoff, grav_onoff, spec_onoff, silent_onoff, glow_onoff, noclip_onoff
new noclipcost, nocliptime, gmodetime, gmodecost, gmode_onoff, money_onoff
// Menus-pcvar
new admmenuon, extrason, weaponson
// Weap.Menu - pcvar
new powerawp, powerak, powercolt
new akcost, awpcost, coltcost

// NOCLIP
#define GetPlayerHullSize(%1)  ( ( pev ( %1, pev_flags ) & FL_DUCKING ) ? HULL_HEAD : HULL_HUMAN )

enum Coord_e { Float:x, Float:y, Float:z };

////////////////////////////////////////////////////////////////////////////////////////////////////
// Bool's
////////////////////////////////////////////////////////////////////////////////////////////////////
new bool:has_awp[33]
new bool:has_ak[33]
new bool:has_colt[33]
new bool:g_Gravity[33]
new bool:g_UnAmmo[33]
new bool:g_Alive[33]
new bool:g_SilentF[33]
new bool:g_Glow[33]
new bool:g_GodMode[33]
new bool:g_NoClip[33]
new bool:oneRound[33]

// Bhop
new bool:g_HasBhop[33]
new g_iCdWaterJumpTime[33]

////////////////////////////////////////////////////////////////////////////////////////////////////
// Plugin Start
////////////////////////////////////////////////////////////////////////////////////////////////////
public plugin_init()
{
	// Register Plugin
	register_plugin("Mega Shop","1.0","TheArmagedon")
	
	// Register Lang
	register_dictionary("mega_shop.txt")
	
	// Say
	register_clcmd("say /megashop","ovomenu");
	register_clcmd("say_team /megashop","ovomenu");
	register_clcmd("say .megashop","ovomenu");
	register_clcmd("say_team .megashop","ovomenu");
	register_clcmd("say /mshop","ovomenu");
	register_clcmd("say_team /mshop","ovomenu");
	register_clcmd("say .mshop","ovomenu");
	register_clcmd("say_team .mshop","ovomenu");
	register_clcmd("say /shop", "ovomenu");
	register_clcmd("say_team /shop", "ovomenu");
	
	// Cvar's
	plugin_onoff	= register_cvar("amx_mega_shop", "1")
	grav_onoff	= register_cvar("amx_ms_gravity", "1")
	spec_onoff	= register_cvar("amx_ms_special", "1")
	bhop_onoff	= register_cvar("amx_ms_bunnyhop", "1")
	ammo_onoff	= register_cvar("amx_ms_ammo", "1")
	silent_onoff	= register_cvar("amx_ms_silentf", "1")
	glow_onoff	= register_cvar("amx_ms_glow", "1")
	noclip_onoff	= register_cvar("amx_ms_noclip", "1")
	gmode_onoff	= register_cvar("amx_ms_godmode", "1")
	money_onoff	= register_cvar("amx_ms_money", "1")
	gravityam	= register_cvar("amx_ms_gravity_amount", "0.5")
	specspeed	= register_cvar("amx_ms_special_speed", "500.0")
	speclife	= register_cvar("amx_ms_special_life", "150")
	specgrav	= register_cvar("amx_ms_special_gravity", "0.7")
	weaponson	= register_cvar("amx_ms_weapon_menu", "1")
	extrason	= register_cvar("amx_ms_extra_menu", "1")
	admmenuon	= register_cvar("amx_ms_admin_menu", "1")
	powerawp	= register_cvar("amx_ms_weapon_awp", "1")
	powerak		= register_cvar("amx_ms_weapon_ak47", "1")
	powercolt	= register_cvar("amx_ms_weapon_m4a1", "1")
	// Cvar's --- Price - EXTRAS
	gravcost	= register_cvar("amx_ms_gravity_cost", "9000")
	ammocost	= register_cvar("amx_ms_ammo_cost", "16000")
	speccost	= register_cvar("amx_ms_special_cost", "13000")
	bhopcost	= register_cvar("amx_ms_bhop_cost", "15000")
	silentcost	= register_cvar("amx_ms_silentf_cost", "7000")
	glowcost	= register_cvar("amx_ms_glow_cost", "3000")
	// Cvar's --- Price - WEAPONS
	awpcost		= register_cvar("amx_ms_awp_cost", "16000")
	akcost		= register_cvar("amx_ms_ak47_cost", "16000")
	coltcost	= register_cvar("amx_ms_colt_cost", "16000")
	// Cvar's --- Price - ADMIN MENU
	noclipcost	= register_cvar("amx_ms_noclip_cost", "15000")
	gmodecost	= register_cvar("amx_ms_godmod_cost", "16000")
	nocliptime	= register_cvar("amx_ms_noclip_time", "10.0")
	gmodetime	= register_cvar("amx_ms_godmod_time", "10.0")
	
	// Bhop
	RegisterHam(Ham_Player_Jump, "player", "Player_Jump")
	register_forward(FM_UpdateClientData, "UpdateClientData")
	register_forward(FM_CmdStart, "CmdStart")
	
	// AMMO
	register_event("CurWeapon" , "event_CurWeapon" , "be" , "1=1");
	
	// Weapons
	register_event( "Damage", "event_damage", "be" )
	
	// Death
	register_event( "DeathMsg", "EventDeath", "a");
	
	// COLORCHAT
	TeamInfo = get_user_msgid("TeamInfo");
	SayText = get_user_msgid("SayText");
	MaxSlots = get_maxplayers();
	
	// ROUND START
	register_logevent( "Event_RoundStart", 2, "1=Round_Start" );
	
}
////////////////////////////////////////////////////////////////////////////////////////////////////
// Precache Model
////////////////////////////////////////////////////////////////////////////////////////////////////
public plugin_precache() {
	precache_model("models/v_awp.mdl")
	precache_model("models/v_ak47.mdl") 
	precache_model("models/v_m4a1.mdl")
}
////////////////////////////////////////////////////////////////////////////////////////////////////
// STOCKS
////////////////////////////////////////////////////////////////////////////////////////////////////
stock maxclip(wpnid) 
{
		
	static ca;
	ca = 0;

	switch (wpnid) 
	{
		case CSW_P228 : ca = 13;
		case CSW_SCOUT : ca = 10;
		case CSW_HEGRENADE : ca = 0;
		case CSW_XM1014 : ca = 7;
		case CSW_C4 : ca = 0;
		case CSW_MAC10 : ca = 30;
		case CSW_AUG : ca = 30;
		case CSW_SMOKEGRENADE : ca = 0;
		case CSW_ELITE : ca = 15;
		case CSW_FIVESEVEN : ca = 20;
		case CSW_UMP45 : ca = 25;
		case CSW_SG550 : ca = 30;
		case CSW_GALI : ca = 35;
		case CSW_FAMAS : ca = 25;
		case CSW_USP : ca = 12;
		case CSW_GLOCK18 : ca = 20;
		case CSW_AWP : ca = 10;
		case CSW_MP5NAVY : ca = 30;
		case CSW_M249 : ca = 100;
		case CSW_M3 : ca = 8;
		case CSW_M4A1 : ca = 30;
		case CSW_TMP : ca = 30;
		case CSW_G3SG1 : ca = 20;
		case CSW_FLASHBANG : ca = 0;
		case CSW_DEAGLE	: ca = 7;
		case CSW_SG552 : ca = 30;
		case CSW_AK47 : ca = 30;
		case CSW_P90 : ca = 50;
	}
	return ca;
}


stock nade_flags()
{
	static buffer[8];

	return read_flags(buffer);
}

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
}
////////////////////////////////////////////////////////////////////////////////////////////////////
// IS USER ALIVE
////////////////////////////////////////////////////////////////////////////////////////////////////
public Check_Alive(id)
{
	g_Alive[id] = bool:is_user_alive(id)
}
////////////////////////////////////////////////////////////////////////////////////////////////////
// Death EVENT
////////////////////////////////////////////////////////////////////////////////////////////////////
public EventDeath( ) {
	
	new iVictim = read_data( 2 );
	
	disableall(iVictim)
	
	g_Alive[iVictim] = bool:is_user_alive(iVictim)
	
	return PLUGIN_CONTINUE;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
// ROUND START
////////////////////////////////////////////////////////////////////////////////////////////////////
public Event_RoundStart(  ) {
	
	new iPlayers[32], iNum
	get_players( iPlayers, iNum, "c" );
	
	for(new i; i < iNum; i++)
		disableall(iPlayers[i])
	
}
////////////////////////////////////////////////////////////////////////////////////////////////////
// UNLIMITED AMMO
////////////////////////////////////////////////////////////////////////////////////////////////////
public event_CurWeapon(id)
{
	if(!is_user_alive(id))
		return PLUGIN_CONTINUE;

	if(g_UnAmmo[id])
	{
		static wpnid, clip;
		wpnid = read_data(2);
		clip = read_data(3);

		give_ammo(id , wpnid , clip);
	}

	return PLUGIN_CONTINUE;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
// WELCOME MSG / CONFIG
////////////////////////////////////////////////////////////////////////////////////////////////////
public client_putinserver(id) 
{
	set_task(8.0, "sv_msg", id)
	set_task(150.0, "sv_msg", id, _, _, "b")
}
public plugin_cfg()
{
	new icfg[32]
	get_configsdir(icfg, sizeof icfg - 1);
	server_cmd("exec %s/mega_shop.cfg", icfg)
	server_exec();
}
public sv_msg(id) {
	ColorChat(id, RED, "%L", id, "WELCOME_MSG");
}
////////////////////////////////////////////////////////////////////////////////////////////////////
// SET ALL FALSE ON CLIENT CONNECT/DISCONNECT
////////////////////////////////////////////////////////////////////////////////////////////////////
public client_connect(id)
{
	g_UnAmmo[id] = false;
	g_Gravity[id] = false;
	g_HasBhop[id] = false;
	g_Glow[id] = false
	g_NoClip[id] = false
	g_GodMode[id] = false
	// Set oneRound  true
	oneRound[id] = true
}
public client_disconnect(id)
{
	g_UnAmmo[id] = false;
	g_Gravity[id] = false;
	g_HasBhop[id] = false;
	g_Alive[id] = false
	g_Glow[id] = false
	g_NoClip[id] = false
	g_GodMode[id] = false
}
////////////////////////////////////////////////////////////////////////////////////////////////////
// UNLIMITED AMMO (GIVE AMMO)
////////////////////////////////////////////////////////////////////////////////////////////////////
public give_ammo(id , wpnid , clip)
{
	if(!is_user_alive(id))
		return;

	if(	wpnid==CSW_C4		||
		wpnid==CSW_KNIFE	||
		wpnid==CSW_HEGRENADE	||
		wpnid==CSW_SMOKEGRENADE	||
		wpnid==CSW_FLASHBANG	) 
			return;

	if(!clip)
	{
		static weapname[33];
		get_weaponname(wpnid , weapname , 32);

		static wpn
		wpn = -1;
		while((wpn = find_ent_by_class(wpn , weapname)) != 0)
		{
			if(id == entity_get_edict(wpn , EV_ENT_owner))
			{
				cs_set_weapon_ammo(wpn , maxclip(wpnid))
				break;
			}
		}
	}
}
// Check nades
public check_for_nades(id)
{
	if(!is_user_alive(id))
		return;

	if(nade_flags() & HE_GRENADE)
	{
		if(!user_has_weapon(id , CSW_HEGRENADE))
			give_item(id , "weapon_hegrenade");
	}
	if(nade_flags() & SMOKE_GRENADE)
	{
		if(!user_has_weapon(id , CSW_SMOKEGRENADE))
			give_item(id , "weapon_smokegrenade");
	}
	if(nade_flags() & FLASH_GRENADE)
	{
		if(!user_has_weapon(id , CSW_FLASHBANG))
			give_item(id , "weapon_flashbang");
	}
}
////////////////////////////////////////////////////////////////////////////////////////////////////
// PLAYER DIE
////////////////////////////////////////////////////////////////////////////////////////////////////
public fw_PlayerKilled(victim, attacker, shouldgib)
{
	// Victim has Gravity/Bhop/Unlimited Ammo
	if(g_Gravity[victim] && g_HasBhop[victim] && g_UnAmmo[victim])
	{
		g_Gravity[victim] = false
		g_HasBhop[victim] = false
		g_UnAmmo[victim] = false
	}
	// Victim has P.Weapon's
	if(has_ak[victim] && has_awp[victim] && has_colt[victim])
	{
		has_colt[victim] = false
		has_ak[victim] = false
		has_awp[victim] = false
	}
}	
////////////////////////////////////////////////////////////////////////////////////////////////////
// MENU START!
////////////////////////////////////////////////////////////////////////////////////////////////////
public ovomenu(id)
{
	new Buffer[32]
	if(oneRound[id] == true) {
		if(get_pcvar_num(plugin_onoff) == 1) {	
			if(is_user_alive(id)) {
				new menu = menu_create("Main Menu:", "menu_handler");
			
				if(get_pcvar_num(weaponson) == 1) {
					formatex(Buffer, 31, "%L", id, "MENU_ITEM_1", 0);
					menu_additem(menu, Buffer, "1");
				}
				if(get_pcvar_num(extrason) == 1) {
					formatex(Buffer, 31, "%L", id, "MENU_ITEM_2", 0);
					menu_additem(menu, Buffer, "2");
				}
				if(get_pcvar_num(admmenuon) == 1 && get_user_flags(id) & ADMIN_ADMIN) {
					formatex(Buffer, 31, "%L", id, "MENU_ITEM_3", 0);
					menu_additem(menu, Buffer, "3");
				} else { 
					ColorChat(id, BLUE, "^4[MegaShop]^3 You opened the ^4Mega Shop.");
				}
				menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
			
				//Menu Display
				menu_display(id, menu, 0);
			}
			else
			ColorChat(id, BLUE, "^4[MegaShop]^3 You need to be alive.");
			return PLUGIN_HANDLED;
		} 
		else
			ColorChat(id, BLUE, "^4[MegaShop]^3 Function disabled.");
		return PLUGIN_HANDLED;
	} else
		ColorChat(id, BLUE, "^4[MegaShop]^3 %L.", id, "ONEPERROUND");
	return PLUGIN_HANDLED;
}
// Show Weapon/Extras/Adm Menu
public menu_handler(id, menu, item)
{
	if( item == MENU_EXIT )
	{
	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 1:
	{
		menuweapon(id)
	}
	case 2:
	{
		menuextra(id)
	}
	case 3:
	{
		menuadm(id)
	}
	}
	menu_destroy(menu);
	return PLUGIN_HANDLED;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
// WEAPON MENU
////////////////////////////////////////////////////////////////////////////////////////////////////
public menuweapon(id)
{
	new Buffer[32]
	if(get_pcvar_num(weaponson) == 1) {
		if(is_user_alive(id)) {
	new menu = menu_create("P.Weapon Menu:", "sec_menu_handler");

	if(get_pcvar_num(powerawp) == 1) {
	formatex(Buffer, 31, "Power AWP - (%d$)", get_pcvar_num(awpcost));
	menu_additem(menu, Buffer, "1");
	}
	if(get_pcvar_num(powerak) == 1) {
	formatex(Buffer, 31, "Power AK47 - (%d$)", get_pcvar_num(akcost));
	menu_additem(menu, Buffer, "2");
	}
	if(get_pcvar_num(powercolt) == 1) {
	formatex(Buffer, 31, "Power Colt-M4A1 - (%d$)", get_pcvar_num(coltcost));
	menu_additem(menu, Buffer, "3");
	}
	menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
	//Menu Display
	menu_display(id, menu, 0);
		} else {
	ColorChat(id, BLUE, "^4[MegaShop]^3 You need to be alive.");
	return PLUGIN_HANDLED;
	}
		} else {
	ColorChat(id, BLUE, "^4[MegaShop]^3 Function disabled.");
	return PLUGIN_HANDLED;
	}
	return PLUGIN_CONTINUE;
}
// Weapon Menu function
public sec_menu_handler(id, menu, item)
{
	if( item == MENU_EXIT )
	{
	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 1: 
	{
		if(get_pcvar_num(powercolt) == 0) {
		ColorChat(id, BLUE, "^4[P.Weapon]^3 Item Disabled!");
		return PLUGIN_HANDLED;
		}
		new money = cs_get_user_money(id);
		new cost = get_pcvar_num(awpcost);
	
		if(money > cost || money == cost) {
		cs_set_user_money(id, money - cost);
			
		ColorChat(id, BLUE, "^4[P.Weapon]^3 %L ^4Power Awp.", id, "BUY");
		has_awp[id] = true
	
		give_item(id, "weapon_awp");
			
		oneRound[id] = false;
			
		new Weapon = get_user_weapon(id)
		
		if(Weapon == CSW_AWP)
			entity_set_string(id, EV_SZ_viewmodel, "models/v_awp.mdl")
			} else	{
		ColorChat(id, BLUE, "^4[P.Weapon]^3 %L.", id, "MONEY");
				}
	}
	case 2:
	{
		if(get_pcvar_num(powercolt) == 0)  {
		ColorChat(id, BLUE, "^4[P.Weapon]^3 Item Disabled!");
		return PLUGIN_HANDLED;
		}
		new money = cs_get_user_money(id);
		new cost = get_pcvar_num(akcost);
	
		if(money > cost || money == cost) {
		cs_set_user_money(id, money - cost);
			
		ColorChat(id, BLUE, "^4[P.Weapon]^3 %L ^4Power AK-47.", id, "BUY");
		has_ak[id] = true
			
		give_item(id, "weapon_ak47");
			
		oneRound[id] = false;
		
		new Weapon = get_user_weapon(id)
				
		if(Weapon == CSW_AK47)
			entity_set_string(id, EV_SZ_viewmodel, "models/v_ak47.mdl")
			} else	{
		ColorChat(id, BLUE, "^4[P.Weapon]^3 %L.", id, "MONEY");
				}	
	}
	case 3: 
	{
		if(get_pcvar_num(powercolt) == 0) {
		ColorChat(id, BLUE, "^4[P.Weapon]^3 Item Disabled!");
		return PLUGIN_HANDLED;
		}
		new money = cs_get_user_money(id);
		new cost = get_pcvar_num(coltcost);
	
		if(money > cost || money == cost) {
		cs_set_user_money(id, money - cost);
			
		ColorChat(id, BLUE, "^4[P.Weapon]^3 %L ^4Power M4A1.", id, "BUY");
		has_colt[id] = true
			
		oneRound[id] = false;
			
		give_item(id, "weapon_m4a1");
				
		new Weapon = get_user_weapon(id)
				
		if(Weapon == CSW_M4A1)
			entity_set_string(id, EV_SZ_viewmodel, "models/v_m4a1.mdl")
			} else	{
		ColorChat(id, BLUE, "^4[P.Weapon]^3 %L.", id, "MONEY");
				}		
	}
    }
	menu_destroy(menu);
	return PLUGIN_HANDLED;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
// EXTRAS MENU
////////////////////////////////////////////////////////////////////////////////////////////////////
public menuextra(id)
{
		new Buffer[32]
		
		if(get_pcvar_num(extrason) == 1) {
			if(is_user_alive(id)) {
			
		new menu = menu_create("Extra Menu:", "trd_menu_handler");
	
		if(get_pcvar_num(grav_onoff) == 1) {
		formatex(Buffer, 31, "%L - (%d$)", id, "EXTRA_LOW_GRAV", get_pcvar_num(gravcost));
		menu_additem(menu, Buffer, "1");
		}
		if(get_pcvar_num(ammo_onoff) == 1) {
		formatex(Buffer, 31, "%L - (%d$)", id, "EXTRA_UNLI_AMMO", get_pcvar_num(ammocost));
		menu_additem(menu, Buffer, "2");
		}
		if(get_pcvar_num(bhop_onoff) == 1) {
		formatex(Buffer, 31, "BunnyHop - (%d$)", get_pcvar_num(bhopcost));
		menu_additem(menu, Buffer, "3");
		}
		if(get_pcvar_num(spec_onoff) == 1) {
		formatex(Buffer, 31, "%L - (%d$)", id, "EXTRA_SPEC_ARMOR", get_pcvar_num(speccost));
		menu_additem(menu, Buffer, "4");
		}
		if(get_pcvar_num(silent_onoff) == 1) {
		formatex(Buffer, 31, "%L - (%d$)", id, "EXTRA_SILENT_STEP", get_pcvar_num(silentcost));
		menu_additem(menu, Buffer, "5");
		}
		if(get_pcvar_num(glow_onoff) == 1) {
		formatex(Buffer, 31, "%L - (%d$)", id, "EXTRA_GLOW", get_pcvar_num(glowcost));
		menu_additem(menu, Buffer, "6");
		}
		menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
	
		//Menu Display
		menu_display(id, menu, 0);
    
			} else
			ColorChat(id, BLUE, "^4[MegaShop]^3 You need to be alive.");
			return PLUGIN_HANDLED;

		} else {
		ColorChat(id, BLUE, "^4[MegaShop]^3 Function disabled.");
		return PLUGIN_HANDLED;
	}
		return PLUGIN_CONTINUE;
}
// Extra Menu Function
public trd_menu_handler(id, menu, item)
{
	if( item == MENU_EXIT )
	{
	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 1:
	{
		if(get_pcvar_num(grav_onoff) == 0) {
		ColorChat(id, BLUE, "^4[Extra]^3 Item Disabled!");
		return PLUGIN_HANDLED;
		}
		new money = cs_get_user_money(id);
		new cost = get_pcvar_num(gravcost);
		
		if(money > cost || money == cost) {
		cs_set_user_money(id, money - cost);
		ColorChat(id, BLUE, "^4[Extra]^3 You bought ^4Low Gravity!");
		g_Gravity[id] = true;
		oneRound[id] = false;
		set_user_gravity(id, get_pcvar_float(gravityam));
		} else {
			ColorChat(id, BLUE, "^4[P.Weapon]^3 %L.", id, "MONEY");		
		}
	}
	case 2:
	{
		if(get_pcvar_num(ammo_onoff) == 0){
		ColorChat(id, BLUE, "^4[Extra]^3 Item Disabled!");
		return PLUGIN_HANDLED;
		}
		new money = cs_get_user_money(id);
		new cost = get_pcvar_num(ammocost);
		
		if(money > cost || money == cost) {
		cs_set_user_money(id, money - cost);
		ColorChat(id, BLUE, "^4[Extra]^3 %L ^4Unlimited Ammo!", id, "BUY");
		g_UnAmmo[id] = true;
		oneRound[id] = false;
		} else {
			ColorChat(id, BLUE, "^4[P.Weapon]^3 %L.", id, "MONEY");	
		}
	}
	case 3:
	{
		if(get_pcvar_num(bhop_onoff) == 0){
		ColorChat(id, BLUE, "^4[Extra]^3 Item Disabled!");
		return PLUGIN_HANDLED;
		}
		new money = cs_get_user_money(id);
		new cost = get_pcvar_num(bhopcost);
		
		if(money > cost || money == cost) {
		cs_set_user_money(id, money - cost);
		ColorChat(id, BLUE, "^4[Extra]^3 %L ^4Bhop!", id, "BUY");
		g_HasBhop[id] = true;
		oneRound[id] = false;
		} else {
			ColorChat(id, BLUE, "^4[P.Weapon]^3 %L.", id, "MONEY");
		}		
	}
	case 4:
	{
		if(get_pcvar_num(spec_onoff) == 0){
		ColorChat(id, BLUE, "^4[Extra]^3 Item Disabled!");
		return PLUGIN_HANDLED;
		}
		new money = cs_get_user_money(id);
		new cost = get_pcvar_num(speccost);
		
		if(money > cost || money == cost) {
		cs_set_user_money(id, money - cost);
		ColorChat(id, BLUE, "^4[Extra]^3 %L ^4Special Armor!", id, "BUY");
		g_Gravity[id] = true;
		oneRound[id] = false;
		set_user_maxspeed(id, get_pcvar_float(specspeed));
		set_user_health(id, get_pcvar_num(speclife));
		set_user_gravity(id, get_pcvar_float(specgrav));
		} else {
			ColorChat(id, BLUE, "^4[P.Weapon]^3 %L.", id, "MONEY");
			
		}
	}
	case 5:
	{
		if(get_pcvar_num(silent_onoff) == 0){
		ColorChat(id, BLUE, "^4[Extra]^3 Item Disabled!");
		return PLUGIN_HANDLED;
		}
		new money = cs_get_user_money(id);
		new cost = get_pcvar_num(silentcost);
		
		if(money > cost || money == cost) {
		cs_set_user_money(id, money - cost);
		ColorChat(id, BLUE, "^4[Extra]^3 %L You bought ^4Silent Footsteps!", id, "BUY");
		g_SilentF[id] = true;
		oneRound[id] = false;
		set_user_footsteps(id, 1)
		} else {
			ColorChat(id, BLUE, "^4[P.Weapon]^3 %L.", id, "MONEY");
		}
	}
	case 6:
	{
		if(get_pcvar_num(glow_onoff) == 0){
		ColorChat(id, BLUE, "^4[Extra]^3 Item Disabled!");
		return PLUGIN_HANDLED;
		}
		new money = cs_get_user_money(id);
		new cost = get_pcvar_num(glowcost);
		
		if(money > cost || money == cost) {
		cs_set_user_money(id, money - cost);
		
		new col1 = random_num(0, 255)
		new col2 = random_num(0, 255)
		new col3 = random_num(0, 255)
		
		ColorChat(id, BLUE, "^4[Extra]^3 %L ^4Glow!", id, "BUY");
		g_Glow[id] = true;	
		oneRound[id] = false;
		set_user_rendering(id, kRenderFxGlowShell, col1, col2, col3, kRenderNormal, 25)
		} else {
			ColorChat(id, BLUE, "^4[P.Weapon]^3 %L.", id, "MONEY");
		}
	}
		
    }
	menu_destroy(menu);
	return PLUGIN_HANDLED;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
// ADMIN MENU
////////////////////////////////////////////////////////////////////////////////////////////////////
public menuadm(id)
{
	new Buffer[32]
	if(get_pcvar_num(weaponson) == 1) {
		if(is_user_alive(id)) {
			new menu = menu_create("Admin Menu:", "adm_menu_handler");
		
			if(get_pcvar_num(noclip_onoff) == 1) {
			formatex(Buffer, 31, "Noclip [%d Sec] - (%d$)", get_pcvar_num(nocliptime), get_pcvar_num(noclipcost));
			menu_additem(menu, Buffer, "1");
			}
			if(get_pcvar_num(gmode_onoff) == 1) {
			formatex(Buffer, 31, "Godmode [%d Sec] - (%d$)", get_pcvar_num(gmodetime), get_pcvar_num(gmodecost));
			menu_additem(menu, Buffer, "2");
			}
			if(get_pcvar_num(money_onoff) == 1) {
			formatex(Buffer, 31, "+ 16000$", 0);
			menu_additem(menu, Buffer, "3");
			}
			menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
		
			//Menu Display
			menu_display(id, menu, 0);

		} else
			ColorChat(id, BLUE, "^4[MegaShop]^3 You need to be alive.");
		return PLUGIN_HANDLED;
	} else {
		ColorChat(id, BLUE, "^4[MegaShop]^3 Function disabled.");
		return PLUGIN_HANDLED;
	}
	return PLUGIN_CONTINUE;
}
// Admin Menu Function
public adm_menu_handler(id, menu, item)
{
	if( item == MENU_EXIT )
	{
	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 1: 
	{
		if(get_pcvar_num(noclip_onoff) == 0) {
		ColorChat(id, BLUE, "^4[Admin Menu]^3 Item Disabled!");
		return PLUGIN_HANDLED;
		}
		new money = cs_get_user_money(id);
		new cost = get_pcvar_num(noclipcost);
	
		if(money > cost || money == cost) {
		cs_set_user_money(id, money - cost);
			
		ColorChat(id, BLUE, "^4[Admin Menu]^3 %L ^4Noclip.", id, "BUY");
		g_NoClip[id] = true;
		oneRound[id] = false;

		set_user_noclip(id, 1)
		set_task(get_pcvar_float(nocliptime), "remove_noclip", id);
	
			} else {
			ColorChat(id, BLUE, "^4[P.Weapon]^3 %L.", id, "MONEY");
			}
	}
	case 2:
	{
		if(get_pcvar_num(gmode_onoff) == 0)  {
		ColorChat(id, BLUE, "^4[Admin Menu]^3 Item Disabled!");
		return PLUGIN_HANDLED;
		}
		new money = cs_get_user_money(id);
		new cost = get_pcvar_num(gmodecost);
	
		if(money > cost || money == cost) {
		cs_set_user_money(id, money - cost);
			
		ColorChat(id, BLUE, "^4[Admin Menu]^3 %L ^4God Mode.", id, "BUY");
		g_GodMode[id] = true
		oneRound[id] = false;
			
		set_user_godmode(id,1)
		set_task(get_pcvar_float(gmodetime), "remove_gmode", id);
			
			} else {
			ColorChat(id, BLUE, "^4[P.Weapon]^3 %L.", id, "MONEY");
			}	
	}
	case 3: 
	{
		if(get_pcvar_num(money_onoff) == 0) {
		ColorChat(id, BLUE, "^4[Admin Menu]^3 Item Disabled!");
		return PLUGIN_HANDLED;
		}	
		
		ColorChat(id, BLUE, "^4[Admin Menu]^3 You get 16000$.");	
		cs_set_user_money(id, 16000);	
		oneRound[id] = false;
		}	
	}
	menu_destroy(menu);
	return PLUGIN_HANDLED;
}	
////////////////////////////////////////////////////////////////////////////////////////////////////
// Remove GodMode/Noclip
////////////////////////////////////////////////////////////////////////////////////////////////////
// Remove Gmode (TIME)
public remove_gmode(id) {
	g_GodMode[id] = false;
	ColorChat(id, BLUE, "^4[MegaShop]^3 Your God Mode is now disabled.")
	set_user_godmode(id,0)
}
// Remove Noclip (TIME)
public remove_noclip(id) {
	g_NoClip[id] = false;
	ColorChat(id, BLUE, "^4[MegaShop]^3 Your NoClip is now disabled.")
	set_user_noclip(id, 0)
	ClientCommand_UnStick(id)
}
	
////////////////////////////////////////////////////////////////////////////////////////////////////
// BunnyHOP
////////////////////////////////////////////////////////////////////////////////////////////////////
public CmdStart(id, uc_handle, seed) {
	
	if(	is_user_alive(id)
	&& 	g_HasBhop[id]
	&&	get_uc(uc_handle, UC_Buttons) & IN_USE
	&&	pev(id, pev_flags) & FL_ONGROUND	) {
		static Float:fVelocity[3]
		pev(id, pev_velocity, fVelocity)
		fVelocity[0] *= 0.3
		fVelocity[1] *= 0.3
		fVelocity[2] *= 0.3
		set_pev(id, pev_velocity, fVelocity)
	}
}

public Player_Jump(id) {

	if( !is_user_alive(id) ) {
		return
	}
	
	if( g_iCdWaterJumpTime[id] ) {
		return
	}
	
	if( pev(id, pev_waterlevel) >= 2 ){
		return
	}
	
	static iFlags ; iFlags = pev(id, pev_flags)
	if( !(iFlags & FL_ONGROUND) ){
		return
	}
	
	static iOldButtons ; iOldButtons = pev(id, pev_oldbuttons)
	if( !g_HasBhop[id] && iOldButtons & IN_JUMP ){
		return
	}
	
	set_pev(id, pev_oldbuttons, iOldButtons | IN_JUMP)
	
	static Float:fVelocity[3]
	pev(id, pev_velocity, fVelocity)
	
	static Float:fFrameTime, Float:fPlayerGravity
	global_get(glb_frametime, fFrameTime)
	pev(id, pev_gravity, fPlayerGravity)
	
	new iLJ
	if(	(pev(id, pev_bInDuck) || iFlags & FL_DUCKING)
	&&	get_pdata_int(id, 356)
	&&	pev(id, pev_button) & IN_DUCK
	&&	pev(id, pev_flDuckTime)	){
		static Float:fPunchAngle[3], Float:fForward[3]
		pev(id, pev_punchangle, fPunchAngle)
		fPunchAngle[0] = -5.0
		set_pev(id, pev_punchangle, fPunchAngle)
		global_get(glb_v_forward, fForward)
		
		fVelocity[0] = fForward[0] * 560
		fVelocity[1] = fForward[1] * 560
		fVelocity[2] = 299.33259094191531084669989858532
		iLJ = 1
	}
	else
	{
		fVelocity[2] = 268.32815729997476356910084024775
	}
	
	fVelocity[2] -= fPlayerGravity * fFrameTime * 0.5 * 800
	
	set_pev(id, pev_velocity, fVelocity)
	
	set_pev(id, pev_gaitsequence, 6+iLJ)
	set_pev(id, pev_frame, 0.0)
}
public UpdateClientData(id, sendweapons, cd_handle)
{
	g_iCdWaterJumpTime[id] = get_cd(cd_handle, CD_WaterJumpTime)
}
////////////////////////////////////////////////////////////////////////////////////////////////////
// POWER WEAPONS
////////////////////////////////////////////////////////////////////////////////////////////////////
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:damage = dmg_take * 2.0;
	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
	}
	// AWP DMG
	if( iWeapID == CSW_AWP && has_awp[attacker_id] ) {
		
		if( floatround(damage) >= health ) {
			if( victim_id == attacker_id ) {
				return PLUGIN_CONTINUE
				}else{
				log_kill( attacker_id, victim_id, "awp", 0 );
			}
			
			return PLUGIN_CONTINUE
			}else {
			if( victim_id == attacker_id ) return PLUGIN_CONTINUE
			
			fakedamage( victim_id, "weapon_awp", damage, dmgtype );
		}
	}
	// AK47 DMG
	if( iWeapID == CSW_AK47 && has_ak[attacker_id] ) {
		
		if( floatround(damage) >= health ) {
			if( victim_id == attacker_id ) {
				return PLUGIN_CONTINUE
				}else{
				log_kill( attacker_id, victim_id, "ak47", 0 );
			}
			
			return PLUGIN_CONTINUE
			}else {
			if( victim_id == attacker_id ) return PLUGIN_CONTINUE

			fakedamage( victim_id, "weapon_ak47", damage, dmgtype );
		}
	}
	// COLT DMG
	if(iWeapID == CSW_M4A1 && has_colt[attacker_id]) 
	{
		if( floatround(damage) >= health ) {
			if( victim_id == attacker_id ) {
				return PLUGIN_CONTINUE
				}else{
				log_kill( attacker_id, victim_id, "m4a1", 0 );
			}
			return PLUGIN_CONTINUE
			}else {
			if( victim_id == attacker_id ) return PLUGIN_CONTINUE
			fakedamage( victim_id, "weapon_m4a1", damage, dmgtype );
		}
	}
	return PLUGIN_CONTINUE
}
// Normal Weapon Model (P.Weapon)
public CurWeapon(id)
{		
	// AWP
	if(get_pcvar_num(powerawp)) {
		
		new Weapon = read_data(2)
		
		if(Weapon == CSW_AWP && has_awp[id])
			entity_set_string(id, EV_SZ_viewmodel, "models/v_awp.mdl")
			
	}
	// AK47
	if(get_pcvar_num(powerak)) {
		
		new Weapon = read_data(2)
		
		if(Weapon == CSW_AK47 && has_ak[id])
			entity_set_string(id, EV_SZ_viewmodel, "models/v_ak47.mdl")
			
	}
	// Colt-m4a1
	if(get_pcvar_num(powercolt)) {
		
		new Weapon = read_data(2)
		
		if(Weapon == CSW_M4A1 && has_colt[id])
			entity_set_string(id, EV_SZ_viewmodel, "models/v_m4a1.mdl")
			
	}

}
////////////////////////////////////////////////////////////////////////////////////////////////////
// DISABLE ALL ITEMS
////////////////////////////////////////////////////////////////////////////////////////////////////
public disableall(id) {
	
	if(g_HasBhop[id]) {
		ColorChat(id, BLUE, "^4[MegaShop]^3 Your Bhop is now disabled.")
		g_HasBhop[id] = false;
	}
	if(g_UnAmmo[id]) {
		ColorChat(id, BLUE, "^4[MegaShop]^3 Your Ammo is now disabled.")
		g_UnAmmo[id] = false;
		
	}
	if(g_SilentF[id]) {
		ColorChat(id, BLUE, "^4[MegaShop]^3 Your Silent Footstep is now disabled.")
		g_SilentF[id] = false;
		set_user_footsteps(id, 0)
	
	}
	if(g_Glow[id]) {
		ColorChat(id, BLUE, "^4[MegaShop]^3 Your Glow is now disabled.")
		g_Glow[id] = false;
		set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderNormal, 0)
		
	}
	if(g_GodMode[id]) {
		ColorChat(id, BLUE, "^4[MegaShop]^3 Your God Mode is now disabled.")
		g_GodMode[id] = false
		set_user_godmode(id,0)
	}
	if(g_NoClip[id]) {
		ColorChat(id, BLUE, "^4[MegaShop]^3 Your NoClip is now disabled.")
		g_NoClip[id] = false
		set_user_noclip(id,0)
	}
	if(get_pcvar_num(plugin_onoff) == 1) {
		oneRound[id] = true
	}
}
////////////////////////////////////////////////////////////////////////////////////////////////////
// UNSTUCK (NOCLIP) - Sorry if the code is not my friend, but I got the code from my friend.
////////////////////////////////////////////////////////////////////////////////////////////////////
public ClientCommand_UnStick ( const id ) {
	
	new i_Value;
	
	if ( ( i_Value = UTIL_UnstickPlayer ( id, 32, 128 ) ) != 1 )
	{
		switch ( i_Value )
		{
			case 0  : client_print ( id, print_chat, "You're not stuck" );
				case -1 : client_print ( id, print_console, "..." );
			}
	}
	
	return PLUGIN_CONTINUE;
}


UTIL_UnstickPlayer ( const id, const i_StartDistance, const i_MaxAttempts ) {
	// --| Not alive, ignore.
	if ( !is_user_alive ( id ) )  return -1
	
	static Float:vf_OriginalOrigin[ Coord_e ], Float:vf_NewOrigin[ Coord_e ];
	static i_Attempts, i_Distance;
	
	// --| Get the current player's origin.
	pev ( id, pev_origin, vf_OriginalOrigin );
	
	i_Distance = i_StartDistance;
	
	while ( i_Distance < 1000 )
	{
		i_Attempts = i_MaxAttempts;
		
		while ( i_Attempts-- )
		{
			vf_NewOrigin[ x ] = random_float ( vf_OriginalOrigin[ x ] - i_Distance, vf_OriginalOrigin[ x ] + i_Distance );
			vf_NewOrigin[ y ] = random_float ( vf_OriginalOrigin[ y ] - i_Distance, vf_OriginalOrigin[ y ] + i_Distance );
			vf_NewOrigin[ z ] = random_float ( vf_OriginalOrigin[ z ] - i_Distance, vf_OriginalOrigin[ z ] + i_Distance );
			
			engfunc ( EngFunc_TraceHull, vf_NewOrigin, vf_NewOrigin, DONT_IGNORE_MONSTERS, GetPlayerHullSize ( id ), id, 0 );
			
			// --| Free space found.
			if ( get_tr2 ( 0, TR_InOpen ) && !get_tr2 ( 0, TR_AllSolid ) && !get_tr2 ( 0, TR_StartSolid ) )
			{
				// --| Set the new origin .
				engfunc ( EngFunc_SetOrigin, id, vf_NewOrigin );
				return 1;
			}
		}
		
		i_Distance += i_StartDistance;
	}
	
	// --| Could not be found.
	return 0;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
// COLOR CHAT
////////////////////////////////////////////////////////////////////////////////////////////////////
public ColorChat(id, Color:type, const msg[], {Float,Sql,Result,_}:...)
{
	static message[256];

	switch(type)
	{
		case YELLOW: // Yellow
		{
			message[0] = 0x01;
		}
		case GREEN: // Green
		{
			message[0] = 0x04;
		}
		default: // White, Red, Blue
		{
			message[0] = 0x03;
		}
	}

	vformat(message[1], 251, msg, 4);

	// Make sure message is not longer than 192 character. Will crash the server.
	message[192] = '^0';

	new team, ColorChange, index, MSG_Type;
	
	if(!id)
	{
		index = FindPlayer();
		MSG_Type = MSG_ALL;
	
	} else {
		MSG_Type = MSG_ONE;
		index = id;
	}
	
	team = get_user_team(index);	
	ColorChange = ColorSelection(index, MSG_Type, type);

	ShowColorMessage(index, MSG_Type, message);
		
	if(ColorChange)
	{
		Team_Info(index, MSG_Type, TeamName[team]);
	}
}

ShowColorMessage(id, type, message[])
{
	message_begin(type, SayText, _, id);
	write_byte(id)		
	write_string(message);
	message_end();	
}

Team_Info(id, type, team[])
{
	message_begin(type, TeamInfo, _, id);
	write_byte(id);
	write_string(team);
	message_end();

	return 1;
}

ColorSelection(index, type, Color:Type)
{
	switch(Type)
	{
		case RED:
		{
			return Team_Info(index, type, TeamName[1]);
		}
		case BLUE:
		{
			return Team_Info(index, type, TeamName[2]);
		}
		case GREY:
		{
			return Team_Info(index, type, TeamName[0]);
		}
	}

	return 0;
}

FindPlayer()
{
	new i = -1;

	while(i <= MaxSlots)
	{
		if(IsConnected[++i])
		{
			return i;
		}
	}

	return -1;
}

CFG

Код за потвърждение: Избери целия код

///////////////////////////////////////////
// Mega Shop Config File
// By: TheArmagedon
///////////////////////////////////////////

// Mega Shop ON/OFF (1/0)
amx_mega_shop 1

// Items EXTRA/ADMIN Shop ON/OFF (1/0)
amx_ms_gravity 1
amx_ms_special 1
amx_ms_bunnyhop 1
amx_ms_ammo 1
amx_ms_silentf 1
amx_ms_glow 1
amx_ms_noclip 0
amx_ms_godmode 0
amx_ms_money 0

// Items Settings
// Gravity
amx_ms_gravity_amount 0.5
// Special Player
amx_ms_special_speed 500.0
amx_ms_special_life 150
amx_ms_special_gravity 0.7

// Mega Shop (MENUS [ON/OFF])
amx_ms_weapon_menu 0
amx_ms_extra_menu 1
amx_ms_admin_menu 1

// Weapon Menu (Weapons [ON/OFF])
amx_ms_weapon_awp 0
amx_ms_weapon_ak47 0
amx_ms_weapon_m4a1 0

// Price - MENU EXTRA
amx_ms_gravity_cost 9000
amx_ms_ammo_cost 16000
amx_ms_special_cost 13000
amx_ms_bhop_cost 15000
amx_ms_silentf_cost 7000
amx_ms_glow_cost 3000

// Price - MENU WEAPONS
amx_ms_awp_cost 16000
amx_ms_ak47_cost 15000
amx_ms_colt_cost 15000

// Price/Time - ADMIN MENU
amx_ms_noclip_cost 15000
amx_ms_godmod_cost 16000
amx_ms_godmod_time 10.0
amx_ms_noclip_time 10.0

// MSG
echo "[MegaShop] Settings loaded successfully!"

Аватар
OciXCrom
Извън линия
Администратор
Администратор
Мнения: 7206
Регистриран на: 06 Окт 2016, 19:20
Местоположение: /resetscore
Се отблагодари: 117 пъти
Получена благодарност: 1295 пъти
Обратна връзка:

Shop or anything for Coins Plugin?

Мнение от OciXCrom » 30 Мар 2020, 13:45

viewtopic.php?f=21&t=50

cshop_settings.inc:

Код за потвърждение: Избери целия код

#if defined _cshop_settings_included
    #endinput
#endif

#define _cshop_settings_included
#define DEFAULT_SOUND "items/gunpickup2.wav"
#define FLAG_ADMIN ADMIN_BAN
#define LANG_TYPE LANG_SERVER
#define MAX_ITEMS 100

/*
	* Change the lines below if you want to use a native for your money currency, e.g. Ammo Packs, BaseBuilder Credits, JBPacks, etc.
	* Example (%1 = id | %2 = amount):
		native zp_get_user_ammo_packs(id)
		native zp_set_user_ammo_packs(id, amount)
		#define get_user_money(%1) zp_get_user_ammo_packs(%1)
		#define set_user_money(%1,%2) zp_set_user_ammo_packs(%1, %2)
*/

native get_user_coins(id)
native set_user_coins(id, iNum)

#define get_user_money(%1) get_user_coins(%1)
#define set_user_money(%1,%2) set_user_coins(%1, %2)

/* Don't touch this line unless you know what you're doing */
#define take_user_money(%1,%2) set_user_money(%1, get_user_money(%1) - %2)

Аватар
Infamous2018
Извън линия
Foreigner
Foreigner
Мнения: 522
Регистриран на: 08 Апр 2018, 16:56
Се отблагодари: 14 пъти
Получена благодарност: 21 пъти

Shop or anything for Coins Plugin?

Мнение от Infamous2018 » 30 Мар 2020, 14:05

fine oxi but how i disable unclip, health reg , awp ammo....

Аватар
atmax
Извън линия
Потребител
Потребител
Мнения: 492
Регистриран на: 22 Мар 2018, 15:06
Се отблагодари: 37 пъти
Получена благодарност: 43 пъти

Shop or anything for Coins Plugin?

Мнение от atmax » 30 Мар 2020, 14:08

Join in your server and type in console cshop_edit
Rest in peace my friend I always will remember you! 🖤👊

Аватар
Infamous2018
Извън линия
Foreigner
Foreigner
Мнения: 522
Регистриран на: 08 Апр 2018, 16:56
Се отблагодари: 14 пъти
Получена благодарност: 21 пъти

Shop or anything for Coins Plugin?

Мнение от Infamous2018 » 30 Мар 2020, 15:03

i did but the coinsystem dont work . when i am using anytrhing from shop i dont lost any coins after it. so idk lol

Аватар
OciXCrom
Извън линия
Администратор
Администратор
Мнения: 7206
Регистриран на: 06 Окт 2016, 19:20
Местоположение: /resetscore
Се отблагодари: 117 пъти
Получена благодарност: 1295 пъти
Обратна връзка:

Shop or anything for Coins Plugin?

Мнение от OciXCrom » 30 Мар 2020, 15:08

Did you recompile the Custom Shop plugin using the edited cshop_settings.inc file? I don't see why it wouldn't work.

Аватар
Infamous2018
Извън линия
Foreigner
Foreigner
Мнения: 522
Регистриран на: 08 Апр 2018, 16:56
Се отблагодари: 14 пъти
Получена благодарност: 21 пъти

Shop or anything for Coins Plugin?

Мнение от Infamous2018 » 30 Мар 2020, 15:12

sure i recompiled it. but maybe there is the problem with this coin system plugin. i have more as 400 K coins and this is impossible. so i think its the plugin :/

And i dont know how i can remove coins to 0 mean reset .

Публикувай отговор
  • Подобни теми
    Отговори
    Преглеждания
     Последно мнение

Обратно към “Заявки за плъгини”

Кой е на линия

Потребители разглеждащи този форум: 0 регистрирани и 10 госта