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

[Request] OciXCrom Rank System


Post New Thread Reply   
 
Thread Tools Display Modes
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-12-2021 , 09:39   Re: [Request] OciXCrom Rank System
Reply With Quote #11

Doing the changes doesn't change the "$" symbol in the shop but it will start consuming XP instead of money.
To change the "$" symbol, refer to the "CSHOP_MONEY_CURRENCY" setting in CustomShop.ini.

You add the parachute plugin just like any other. I advise you to write it down in plugins-cshop.ini instead of plugins.ini.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
romeo72
Member
Join Date: Oct 2021
Old 12-12-2021 , 10:09   Re: [Request] OciXCrom Rank System
Reply With Quote #12

perfect ... now it worked !!

Thank you very much and I wish you a nice weekend!

best regards
__________________
romeo72 is offline
romeo72
Member
Join Date: Oct 2021
Old 12-12-2021 , 13:57   Re: [Request] OciXCrom Rank System
Reply With Quote #13

Hello OciXCrom,

unfortunately it's me again. I have now tried to add the parachute to the custom shop. but unfortunately the parachute is not displayed in the API or in the shop!?

I added the cshop_parachute.amxx to the / plugins folder.
and in the plugins-shop.ini I made the entry cshop_parachute.amxx.

the other addons (norecoil, longjump) are displayed via / shop.

would you like to help me there again?

best regards
__________________
romeo72 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-12-2021 , 14:24   Re: [Request] OciXCrom Rank System
Reply With Quote #14

Use the "amx_plugins <start num>" command to check if the plugin is running.
You also might want to check with the "cshop_items" command if the item was added successfully.

Post the output of those commands here. Make sure you're on the correct "amx_plugins" page when doing so.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
romeo72
Member
Join Date: Oct 2021
Old 12-12-2021 , 14:46   Re: [Request] OciXCrom Rank System
Reply With Quote #15

Hello OciXCrom,

the parachute amx_plugins is <34>

Code:
Currently loaded plugins:
       name                    version     author            file             status   
 [  1] Admin Base              1.8.2       AMXX Dev Team     admin.amxx       running  
 [  2] Admin Commands          1.8.2       AMXX Dev Team     admincmd.amxx    running  
 [  3] Admin Help              1.8.2       AMXX Dev Team     adminhelp.amxx   running  
 [  4] Slots Reservation       1.8.2       AMXX Dev Team     adminslots.amxx  running  
 [  5] Multi-Lingual System    1.8.2       AMXX Dev Team     multilingual.am  running  
 [  6] Menus Front-End         1.8.2       AMXX Dev Team     menufront.amxx   running  
 [  7] Commands Menu           1.8.2       AMXX Dev Team     cmdmenu.amxx     running  
 [  8] Players Menu            1.8.2       AMXX Dev Team     plmenu.amxx      running  
 [  9] Teleport Menu           1.8.2       AMXX Dev Team     telemenu.amxx    running  
 [ 10] Maps Menu               1.8.2       AMXX Dev Team     mapsmenu.amxx    running  
 [ 11] Plugin Menu             1.8.2       AMXX Dev Team     pluginmenu.amxx  running  
 [ 12] Admin Chat              1.8.2       AMXX Dev Team     adminchat.amxx   running  
 [ 13] Anti Flood              1.8.2       AMXX Dev Team     antiflood.amxx   running  
 [ 14] Scrolling Message       1.8.2       AMXX Dev Team     scrollmsg.amxx   running  
 [ 15] Info. Messages          1.8.2       AMXX Dev Team     imessage.amxx    running  
 [ 16] Admin Votes             1.8.2       AMXX Dev Team     adminvote.amxx   running  
 [ 17] TimeLeft                1.8.2       AMXX Dev Team     timeleft.amxx    running  
 [ 18] Pause Plugins           1.8.2       AMXX Dev Team     pausecfg.amxx    running  
 [ 19] Stats Configuration     1.8.2       AMXX Dev Team     statscfg.amxx    running  
 [ 20] Restrict Weapons        1.8.2       AMXX Dev Team     restmenu.amxx    running  
 [ 21] StatsX                  1.8.2       AMXX Dev Team     statsx.amxx      running  
 [ 22] Team Grenade Trail      1.2         Numb              grenade_trail.a  running  
 [ 23] Team Semiclip           2.0.0       schmurgel1983     cs_team_semicli  running  
 [ 24] Anti Flashbang Bug      1.1.1       Numb / ConnorMcL  no_team_flash.a  running  
 [ 25] Voices Management       1.0.2       ConnorMcLeod      Voices_Manageme  running  
 [ 26] Last Man Bets           0.9.5       JGHG              lastmanbets.amx  running  
 [ 27] Weapon Model + Sound R  1.3         GHW_Chronic       thron_grenade.a  running  
 [ 28] Accuracy Fix            3.0         Numb              accuracy_fix.am  running  
 [ 29] Task Scheduler          0.2         JustinHoMi        scheduler.amxx   running  
 [ 30] No Objectives           0.3         VEN               noobjectives.am  running  
 [ 31] Custom Shop             4.2.4       OciXCrom          custom_shop.amx  running  
 [ 32] CSHOP: Default Items    4.2.2       OciXCrom          cshop_items.amx  running  
 [ 33] Custom Shop: No Recoil  3.*         OciXCrom          cshop_norecoil.  running  
 [ 34] Parachute               1.3         KRoT@L/JTP10181   cshop_parachute  running  
 [ 35] OciXCrom's Rank System  3.10        OciXCrom          crx_ranksystem.  running  
 [ 36] CSDM Main               2.1.3d      CSDM Team         csdm_main.amxx   running  
 [ 37] CSDM Equip              2.1.3d      CSDM Team         csdm_equip.amxx  running  
 [ 38] CSDM Spawns             2.1.3d      CSDM Team         csdm_spawn_pres  running  
 [ 39] CSDM Misc               2.1.3d      CSDM Team         csdm_misc.amxx   running  
 [ 40] CSDM Stripper           2.1.3d      KWo               csdm_stripper.a  running  
 [ 41] CSDM Protection         2.1.3d      BAILOPAN          csdm_protection  running  
 [ 42] CSDM FFA                2.1.3d      CSDM Team         csdm_ffa.amxx    running  
 [ 43] CSDM Ticketing          2.1.3d      BAILOPAN          csdm_tickets.am  running  
 [ 44] CSDM Item Mode          2.1.3d      FALUCO & KWo & S  csdm_itemmode.a  running  
44 plugins, 44 running

since I only use the rank system and custom shop on dust 2, I made the entry (cshop_parachute.amxx) in the plugins-de_dust2.ini. just like the other addons of yours.
so far it's been going well too. it really only matters that the parachute appears in the custom shop and can be selected. just like your norecoil addon.

Quote:
// Mapvote Galileo v5.9.1-925
galileo.amxx disabled

// 2x2 Mode
mode.amxx disabled

// Granaten aufheben
realnadedrops.amxx disabled

// Roundtimer deaktivieren
noobjectives.amxx

// OciXCrom Custom Shop
custom_shop.amxx
cshop_items.amxx
cshop_norecoil.amxx
cshop_parachute.amxx

// OciXCrom Rank System
crx_ranksystem.amxx

// KWo 2.1.3d Deathmatch
// rename this file to disabled-csdm.ini to turn it off.
// rename it back to plugins-csdm.ini to turn it on.

// put a semi-colon in front of a plugin to disable it.
// add the word debug after a plugin to place it in debug mode
// for example: csdm_main.amxx debug
// remove a semi-colon to re-enable a plugin

// DEATCHMATCH
// Main plugin, required for most cases
csdm_main.amxx

// Weapons and equipment menus
csdm_equip.amxx

// Enables preset spawning and the preset spawning editor
// Map config files are located in configs/csdm
csdm_spawn_preset.amxx

// Miscellanious extra features, such as ammo refills
// and basic objective removals
csdm_misc.amxx

// Extra objective removals
csdm_stripper.amxx

// Spawn protection
csdm_protection.amxx

// Adds free-for-all mode (must be enabled in csdm.cfg too)
csdm_ffa.amxx

// Round ticketing mode, like FireArms. First team to use all
// of their death points loses the ability to respawn.
// (must be enabled in csdm.cfg too)
csdm_tickets.amxx

// Item mode (from CSDM1) with Item Editor
// Must be enabled in csdm.cfg as well (at the very bottom)
csdm_itemmode.amxx

Here are my cshop_items.sma:

Code:
/*
	* This plugin contains all the default items Custom Shop has to offer.
	* I don't suggest making any changes here, since they will be gone in future updates.
	* If you want to change something, use the in-game menu editor or the CustomShopItems.ini file.
*/

#include <amxmodx>
#include <cromchat>
#include <cstrike>
#include <customshop>
#include <fakemeta>
#include <fun>
#include <hamsandwich>

#define PLUGIN_VERSION "4.2.2"
#define TASK_HEALTHREGEN 400040
#define TASK_ARMORREGEN 400140
#define m_pActiveItem 373

additem DEFAULT_ITEMS[MAX_ITEMS]
new const g_iMaxClip[] = { 0, 13, 0, 10, 0, 7, 0, 30, 30, 0, 15, 20, 25, 30, 35, 25, 12, 20, 10, 30, 100, 8, 30, 30, 20, 0, 7, 30, 30, 0, 50 }

enum
{
	ITEM_HEALTH = 0, ITEM_ARMOR, ITEM_UNLCLIP, ITEM_UNLAMMO, ITEM_BOMBER, ITEM_SILENTSTEPS, ITEM_SPEED, ITEM_GRAVITY, ITEM_CHAMELEON, ITEM_DRUGS, ITEM_TRANSPARENCY,
	ITEM_INVIS, ITEM_MOREDAMAGE, ITEM_GODMODE, ITEM_HEALTHREGEN, ITEM_ARMORREGEN, ITEM_AWP
}

enum _:Items
{
	Id[32],
	Name[64],
	Price,
	Limit,
	Sound[128],
	Float:Duration
}

enum _:Settings
{
	Health_Amount,
	Armor_Amount,
	UnlClip_Ammo,
	UnlAmmo_Ammo,
	Bomber_Amount,
	Bomber_Type[20],
	Bomber_CSW,
	Float:Speed_Amount,
	Speed_Add,
	Float:Gravity_Amount,
	Drugs_Health,
	Drugs_FOV,
	Float:Drugs_Speed,
	Drugs_Speed_Add,
	Transparency_Amount,
	Invis_Amount,
	MoreDamage_Amount[10],
	HealthRegen_PerSec,
	HealthRegen_MaxHP,
	Float:HealthRegen_Frequency,
	ArmorRegen_PerSec,
	ArmorRegen_MaxAP,
	Float:ArmorRegen_Frequency,
	AWP_Ammo
}

new const g_eItems[][Items] = 
{
	{ "health", "+50 Health Points", 1500, 5, "items/smallmedkit1.wav" },
	{ "armor", "+100 Armor Points", 1000, 8, "items/ammopickup2.wav" },
	{ "unlclip", "Unlimited Clip", 3000, 3, DEFAULT_SOUND },
	{ "unlammo", "Unlimited Ammo", 200, 5, DEFAULT_SOUND },
	{ "bomber", "Bomber", 1600, 3, "x/x_pain2.wav" },
	{ "silentsteps", "Silent Footsteps", 3000, 1, DEFAULT_SOUND },
	{ "speed", "Faster Speed", 4300, 1, "misc/bipbip.wav" },
	{ "gravity", "Low Gravity", 2800, 1, DEFAULT_SOUND },
	{ "chameleon", "Chameleon", 9000, 1, DEFAULT_SOUND },
	{ "drugs", "Drugs (Speed + Health)", 8000, 2, DEFAULT_SOUND },
	{ "transparency", "Transparency", 2500, 1, DEFAULT_SOUND },
	{ "invis", "Invisibility (15 Seconds)", 16000, 1, "hornet/ag_buzz1.wav", 15.0 },
	{ "moredamage", "Double Damage", 10000, 1, DEFAULT_SOUND },
	{ "godmode", "Godmode (5 Seconds)", 16000, 1, "misc/stinger12.wav", 5.0 },
	{ "healthregen", "Health Regeneration", 1800, 1, "items/suitchargeok1.wav" },
	{ "armorregen", "Armor Regeneration", 2000, 1, "items/suitchargeok1.wav" },
	{ "awp", "AWP Sniper", 4750, 1, DEFAULT_SOUND }
}

new g_iSetFOV
new g_eSettings[Settings]
new bool:g_bHasItem[33][MAX_ITEMS]
new const CHAMELEON_MODELS[][][] = { { "gign", "gsg9", "sas", "urban" }, { "arctic", "guerilla", "leet", "terror" } }

public plugin_init()
{
	register_plugin("CSHOP: Default Items", PLUGIN_VERSION, "OciXCrom")
	register_dictionary("CustomShop.txt")
	register_event("CurWeapon", "OnChangeWeapon", "be", "1=1")
	RegisterHam(Ham_TakeDamage, "player", "PreTakeDamage")
	RegisterHam(Ham_Item_PreFrame, "player", "OnPlayerResetMaxSpeed", 1) 
	
	g_iSetFOV = get_user_msgid("SetFOV")
	
	new szPrefix[CC_MAX_PREFIX_SIZE]
	cshop_get_prefix(szPrefix, charsmax(szPrefix))
	CC_SetPrefix(szPrefix)
	
	g_eSettings[Health_Amount] = cshop_get_int(DEFAULT_ITEMS[ITEM_HEALTH], "Amount")
	g_eSettings[Armor_Amount] = cshop_get_int(DEFAULT_ITEMS[ITEM_ARMOR], "Amount")
	g_eSettings[UnlClip_Ammo] = cshop_get_int(DEFAULT_ITEMS[ITEM_UNLCLIP], "Clip Ammo")
	g_eSettings[UnlAmmo_Ammo] = cshop_get_int(DEFAULT_ITEMS[ITEM_UNLAMMO], "Backpack Ammo")
	g_eSettings[Bomber_Amount] = cshop_get_int(DEFAULT_ITEMS[ITEM_BOMBER], "Amount")
	cshop_get_string(DEFAULT_ITEMS[ITEM_BOMBER], "Type", g_eSettings[Bomber_Type], charsmax(g_eSettings[Bomber_Type]))
	g_eSettings[Bomber_CSW] = get_weaponid(g_eSettings[Bomber_Type])
	g_eSettings[Speed_Amount] = _:cshop_get_float(DEFAULT_ITEMS[ITEM_SPEED], "Amount")
	g_eSettings[Speed_Add] = cshop_get_int(DEFAULT_ITEMS[ITEM_SPEED], "Add To Current")
	g_eSettings[Gravity_Amount] = _:cshop_get_float(DEFAULT_ITEMS[ITEM_GRAVITY], "Amount")
	g_eSettings[Drugs_Health] = cshop_get_int(DEFAULT_ITEMS[ITEM_DRUGS], "Health")
	g_eSettings[Drugs_FOV] = cshop_get_int(DEFAULT_ITEMS[ITEM_DRUGS], "FOV")
	g_eSettings[Drugs_Speed] = _:cshop_get_float(DEFAULT_ITEMS[ITEM_DRUGS], "Speed")
	g_eSettings[Drugs_Speed_Add] = cshop_get_int(DEFAULT_ITEMS[ITEM_DRUGS], "Add Speed To Current")
	g_eSettings[Transparency_Amount] = cshop_get_int(DEFAULT_ITEMS[ITEM_TRANSPARENCY], "Amount")
	g_eSettings[Invis_Amount] = cshop_get_int(DEFAULT_ITEMS[ITEM_INVIS], "Amount")
	cshop_get_string(DEFAULT_ITEMS[ITEM_MOREDAMAGE], "Amount", g_eSettings[MoreDamage_Amount], charsmax(g_eSettings[MoreDamage_Amount]))
	g_eSettings[HealthRegen_PerSec] = cshop_get_int(DEFAULT_ITEMS[ITEM_HEALTHREGEN], "HP Per Second")
	g_eSettings[HealthRegen_MaxHP] = cshop_get_int(DEFAULT_ITEMS[ITEM_HEALTHREGEN], "Max HP")
	g_eSettings[HealthRegen_Frequency] = _:cshop_get_float(DEFAULT_ITEMS[ITEM_HEALTHREGEN], "Frequency")
	g_eSettings[ArmorRegen_PerSec] = cshop_get_int(DEFAULT_ITEMS[ITEM_ARMORREGEN], "AP Per Second")
	g_eSettings[ArmorRegen_MaxAP] = cshop_get_int(DEFAULT_ITEMS[ITEM_ARMORREGEN], "Max AP")
	g_eSettings[ArmorRegen_Frequency] = _:cshop_get_float(DEFAULT_ITEMS[ITEM_ARMORREGEN], "Frequency")
	g_eSettings[AWP_Ammo] = cshop_get_int(DEFAULT_ITEMS[ITEM_AWP], "Backpack Ammo")
}

public plugin_precache()
{
	for(new i; i < sizeof(g_eItems); i++)
		DEFAULT_ITEMS[i] = cshop_register_item(g_eItems[i][Id], g_eItems[i][Name], g_eItems[i][Price], g_eItems[i][Limit], g_eItems[i][Sound], g_eItems[i][Duration])
	
	cshop_set_int(DEFAULT_ITEMS[ITEM_HEALTH], "Amount", 50)
	cshop_set_int(DEFAULT_ITEMS[ITEM_ARMOR], "Amount", 100)
	cshop_set_int(DEFAULT_ITEMS[ITEM_UNLCLIP], "Clip Ammo", -1)
	cshop_set_int(DEFAULT_ITEMS[ITEM_UNLAMMO], "Backpack Ammo", 97280)
	cshop_set_int(DEFAULT_ITEMS[ITEM_BOMBER], "Amount", 20)
	cshop_set_string(DEFAULT_ITEMS[ITEM_BOMBER], "Type", "weapon_hegrenade")
	cshop_set_float(DEFAULT_ITEMS[ITEM_SPEED], "Amount", 300.0)
	cshop_set_int(DEFAULT_ITEMS[ITEM_SPEED], "Add To Current", 0)
	cshop_set_float(DEFAULT_ITEMS[ITEM_GRAVITY], "Amount", 0.5)
	cshop_set_int(DEFAULT_ITEMS[ITEM_DRUGS], "Health", 200)
	cshop_set_int(DEFAULT_ITEMS[ITEM_DRUGS], "FOV", 180)
	cshop_set_float(DEFAULT_ITEMS[ITEM_DRUGS], "Speed", 300.0)
	cshop_set_int(DEFAULT_ITEMS[ITEM_DRUGS], "Add Speed To Current", 0)
	cshop_set_int(DEFAULT_ITEMS[ITEM_TRANSPARENCY], "Amount", 75)
	cshop_set_int(DEFAULT_ITEMS[ITEM_INVIS], "Amount", 0)
	cshop_set_string(DEFAULT_ITEMS[ITEM_MOREDAMAGE], "Amount", "*2")
	cshop_set_int(DEFAULT_ITEMS[ITEM_HEALTHREGEN], "HP Per Second", 1)
	cshop_set_int(DEFAULT_ITEMS[ITEM_HEALTHREGEN], "Max HP", 150)
	cshop_set_float(DEFAULT_ITEMS[ITEM_HEALTHREGEN], "Frequency", 0.5)
	cshop_set_int(DEFAULT_ITEMS[ITEM_ARMORREGEN], "AP Per Second", 10)
	cshop_set_int(DEFAULT_ITEMS[ITEM_ARMORREGEN], "Max AP", 150)
	cshop_set_float(DEFAULT_ITEMS[ITEM_ARMORREGEN], "Frequency", 0.5)
	cshop_set_int(DEFAULT_ITEMS[ITEM_AWP], "Backpack Ammo", 30)
}

public client_putinserver(id)
	arrayset(g_bHasItem[id], false, sizeof(g_bHasItem[]))

public cshop_item_selected(id, iItem)
{
	if(iItem == DEFAULT_ITEMS[ITEM_HEALTH]) 			{ set_user_health(id, get_user_health(id) + g_eSettings[Health_Amount]); }
	else if(iItem == DEFAULT_ITEMS[ITEM_ARMOR]) 		{ cs_set_user_armor(id, get_user_armor(id) + g_eSettings[Armor_Amount], CS_ARMOR_VESTHELM); }
	else if(iItem == DEFAULT_ITEMS[ITEM_BOMBER])
	{
		give_item(id, "weapon_hegrenade")
		cs_set_user_bpammo(id, g_eSettings[Bomber_CSW], g_eSettings[Bomber_Amount])
	}
	else if(iItem == DEFAULT_ITEMS[ITEM_UNLCLIP])
	{		
		if(!weapon_uses_ammo(get_user_weapon(id)))
		{
			new szName[64]
			cshop_get_item_data(DEFAULT_ITEMS[ITEM_UNLCLIP], CSHOP_DATA_NAME, szName, charsmax(szName))
			CC_SendMessage(id, "%L", id, "CSHOP_CANT_ACTIVATE", szName)
			cshop_error_sound(id)
			return DONT_BUY
		}
		
		g_bHasItem[id][DEFAULT_ITEMS[ITEM_UNLCLIP]] = true
		OnChangeWeapon(id)
	}
	else if(iItem == DEFAULT_ITEMS[ITEM_UNLAMMO])
	{
		new iWeapon = get_user_weapon(id)
		
		if(!weapon_uses_ammo(iWeapon))
		{
			new szName[64]
			cshop_get_item_data(DEFAULT_ITEMS[ITEM_UNLAMMO], CSHOP_DATA_NAME, szName, charsmax(szName))
			CC_SendMessage(id, "%L", id, "CSHOP_CANT_ACTIVATE", szName)
			cshop_error_sound(id)
			return DONT_BUY
		}
		
		cs_set_user_bpammo(id, iWeapon, g_eSettings[UnlAmmo_Ammo])
	}
	else if(iItem == DEFAULT_ITEMS[ITEM_SILENTSTEPS]) 		{ set_user_footsteps(id); }
	else if(iItem == DEFAULT_ITEMS[ITEM_SPEED]) 			{ g_bHasItem[id][DEFAULT_ITEMS[ITEM_SPEED]] = true; OnPlayerResetMaxSpeed(id); }
	else if(iItem == DEFAULT_ITEMS[ITEM_GRAVITY]) 			{ set_user_gravity(id, g_eSettings[Gravity_Amount]); }
	else if(iItem == DEFAULT_ITEMS[ITEM_CHAMELEON]) 		{ cs_set_user_model(id, CHAMELEON_MODELS[(get_user_team(id) - 1)][random(4)]); }
	else if(iItem == DEFAULT_ITEMS[ITEM_DRUGS])
	{
		g_bHasItem[id][DEFAULT_ITEMS[ITEM_DRUGS]] = true
		set_user_health(id, get_user_health(id) + g_eSettings[Drugs_Health])
		set_user_drugs(id, g_eSettings[Drugs_FOV])
		OnPlayerResetMaxSpeed(id)
	}
	else if(iItem == DEFAULT_ITEMS[ITEM_TRANSPARENCY]) 		{ set_user_glow(id, .iAlpha = g_eSettings[Transparency_Amount]); }
	else if(iItem == DEFAULT_ITEMS[ITEM_INVIS]) 			{ set_user_glow(id, .iAlpha = g_eSettings[Invis_Amount]); }
	else if(iItem == DEFAULT_ITEMS[ITEM_MOREDAMAGE]) 		{ g_bHasItem[id][DEFAULT_ITEMS[ITEM_MOREDAMAGE]] = true; }
	else if(iItem == DEFAULT_ITEMS[ITEM_GODMODE]) 			{ set_user_godmode(id, 1); }
	else if(iItem == DEFAULT_ITEMS[ITEM_HEALTHREGEN]) 		{ g_bHasItem[id][DEFAULT_ITEMS[ITEM_HEALTHREGEN]] = true; set_task(g_eSettings[HealthRegen_Frequency], "RegenerateHealth", id + TASK_HEALTHREGEN, .flags = "b"); }
	else if(iItem == DEFAULT_ITEMS[ITEM_ARMORREGEN]) 		{ g_bHasItem[id][DEFAULT_ITEMS[ITEM_ARMORREGEN]] = true; set_task(g_eSettings[ArmorRegen_Frequency], "RegenerateArmor", id + TASK_ARMORREGEN, .flags = "b"); }
	else if(iItem == DEFAULT_ITEMS[ITEM_AWP]) 				{ give_item(id, "weapon_awp"); cs_set_user_bpammo(id, CSW_AWP, g_eSettings[AWP_Ammo]); }
	
	return BUY_ITEM
}

public cshop_item_removed(id, iItem)
{
	if(!is_user_alive(id))
		return
	
	if(iItem == DEFAULT_ITEMS[ITEM_UNLCLIP]) 				{ g_bHasItem[id][DEFAULT_ITEMS[ITEM_UNLCLIP]] = false; }
	else if(iItem == DEFAULT_ITEMS[ITEM_SILENTSTEPS]) 		{ set_user_footsteps(id, 0); }
	else if(iItem == DEFAULT_ITEMS[ITEM_SPEED]) 			{ g_bHasItem[id][DEFAULT_ITEMS[ITEM_SPEED]] = false; ExecuteHamB(Ham_Item_PreFrame, id); }
	else if(iItem == DEFAULT_ITEMS[ITEM_GRAVITY]) 			{ set_user_gravity(id); }
	else if(iItem == DEFAULT_ITEMS[ITEM_CHAMELEON]) 		{ cs_reset_user_model(id); }
	else if(iItem == DEFAULT_ITEMS[ITEM_DRUGS]) 			{ g_bHasItem[id][DEFAULT_ITEMS[ITEM_DRUGS]] = false; ExecuteHamB(Ham_Item_PreFrame, id); }
	else if(iItem == DEFAULT_ITEMS[ITEM_TRANSPARENCY]) 		{ remove_user_glow(id); }
	else if(iItem == DEFAULT_ITEMS[ITEM_INVIS]) 			{ remove_user_glow(id); }
	else if(iItem == DEFAULT_ITEMS[ITEM_MOREDAMAGE]) 		{ g_bHasItem[id][DEFAULT_ITEMS[ITEM_MOREDAMAGE]] = false; }
	else if(iItem == DEFAULT_ITEMS[ITEM_GODMODE]) 			{ set_user_godmode(id); }
	else if(iItem == DEFAULT_ITEMS[ITEM_HEALTHREGEN]) 		{ g_bHasItem[id][DEFAULT_ITEMS[ITEM_HEALTHREGEN]] = false; }
	else if(iItem == DEFAULT_ITEMS[ITEM_ARMORREGEN]) 		{ g_bHasItem[id][DEFAULT_ITEMS[ITEM_ARMORREGEN]] = false; }
}

public OnPlayerResetMaxSpeed(id)
{
	if(!is_user_alive(id))
		return
		
	if(g_bHasItem[id][DEFAULT_ITEMS[ITEM_DRUGS]])
		set_user_maxspeed(id, g_eSettings[Drugs_Speed_Add] ? get_user_maxspeed(id) + g_eSettings[Drugs_Speed] : g_eSettings[Drugs_Speed])
	else if(g_bHasItem[id][DEFAULT_ITEMS[ITEM_SPEED]])
		set_user_maxspeed(id, g_eSettings[Speed_Add] ? get_user_maxspeed(id) + g_eSettings[Speed_Amount] : g_eSettings[Speed_Amount])
}

public OnChangeWeapon(id)
{
	if(!is_user_alive(id))
		return
		
	if(g_bHasItem[id][DEFAULT_ITEMS[ITEM_UNLCLIP]])
	{
		new iWeapon = read_data(2)

		if(iWeapon < 0 || iWeapon > sizeof(g_iMaxClip) - 1)
			return
		
		if(weapon_uses_ammo(iWeapon))
		{
			new iActiveItem = get_pdata_cbase(id, m_pActiveItem)

			if(pev_valid(iActiveItem))
				cs_set_weapon_ammo(iActiveItem, g_eSettings[UnlClip_Ammo] == -1 ? g_iMaxClip[iWeapon] : g_eSettings[UnlClip_Ammo])
		}
	}
}

public PreTakeDamage(iVictim, iInflictor, iAttacker, Float:flDamage, iDamageBits)
{
	if(is_user_alive(iAttacker) && iAttacker != iVictim)
	{
		if(g_bHasItem[iAttacker][DEFAULT_ITEMS[ITEM_MOREDAMAGE]])
			SetHamParamFloat(4, math_add_f(flDamage, g_eSettings[MoreDamage_Amount]))
	}
}

public RegenerateHealth(id)
{
	id -= TASK_HEALTHREGEN
	
	if(!is_user_alive(id) || !g_bHasItem[id][DEFAULT_ITEMS[ITEM_HEALTHREGEN]])
	{
		remove_task(id + TASK_HEALTHREGEN)
		return
	}
		
	static iHealth
	iHealth = get_user_health(id)
	
	if(iHealth >= g_eSettings[HealthRegen_MaxHP])
		return
		
	set_user_health(id, clamp(iHealth + g_eSettings[HealthRegen_PerSec], .max = g_eSettings[HealthRegen_MaxHP]))
}

public RegenerateArmor(id)
{
	id -= TASK_ARMORREGEN
	
	if(!is_user_alive(id) || !g_bHasItem[id][DEFAULT_ITEMS[ITEM_ARMORREGEN]])
	{
		remove_task(id + TASK_ARMORREGEN)
		return
	}
	
	static iArmor
	iArmor = get_user_armor(id)
	
	if(iArmor >= g_eSettings[ArmorRegen_MaxAP])
		return
		
	cs_set_user_armor(id, clamp(iArmor + g_eSettings[ArmorRegen_PerSec], .max = g_eSettings[ArmorRegen_MaxAP]), CS_ARMOR_VESTHELM)
}

Float:math_add_f(Float:fNum, const szMath[])
{
    static szNewMath[16], Float:fMath, bool:bPercent, cOperator
   
    copy(szNewMath, charsmax(szNewMath), szMath)
    bPercent = szNewMath[strlen(szNewMath) - 1] == '%'
    cOperator = szNewMath[0]
   
    if(!isdigit(szNewMath[0]))
        szNewMath[0] = ' '
   
    if(bPercent)
        replace(szNewMath, charsmax(szNewMath), "%", "")
       
    trim(szNewMath)
    fMath = str_to_float(szNewMath)
   
    if(bPercent)
        fMath *= fNum / 100
       
    switch(cOperator)
    {
        case '+': fNum += fMath
        case '-': fNum -= fMath
        case '/': fNum /= fMath
        case '*': fNum *= fMath
        default: fNum = fMath
    }
   
    return fNum
}

bool:weapon_uses_ammo(iWeapon)
	return ((1 << iWeapon) & ((1 << CSW_KNIFE) | (1 << CSW_HEGRENADE) | (1 << CSW_FLASHBANG) | (1 << CSW_SMOKEGRENADE) | (1 << CSW_C4))) ? false : true

set_user_glow(id, iRed = 0, iGreen = 0, iBlue = 0, iAlpha)
	set_user_rendering(id, kRenderFxGlowShell, iRed, iGreen, iBlue, kRenderTransAlpha, iAlpha)
	
remove_user_glow(id)
	set_user_rendering(id, kRenderFxNone, 0, 0, 0, kRenderNormal, 0)

set_user_drugs(id, iAmount)
{
	message_begin(MSG_ONE, g_iSetFOV, {0, 0, 0}, id)
	write_byte(iAmount)
	message_end()
}
maybe you will find my mistake.

best regards
__________________
romeo72 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-12-2021 , 15:05   Re: [Request] OciXCrom Rank System
Reply With Quote #16

I meant the "cshop_items" console command, not the actual plugin with the same name.
This command will tell us if the item was registered or not.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-12-2021 , 15:08   Re: [Request] OciXCrom Rank System
Reply With Quote #17

Quote:
[ 34] Parachute 1.3 KRoT@L/JTP10181 cshop_parachute running
I just noticed that this is not the plugin I gave you, so there's your mistake.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
romeo72
Member
Join Date: Oct 2021
Old 12-12-2021 , 15:24   Re: [Request] OciXCrom Rank System
Reply With Quote #18

So if you mean the console command in the game, it shows me this:

Quote:
cshop_items
----- Custom Shop: 18 loaded items -----
#1: +50 Health Points [ Price: 1500XP | Limit: 5 ]
#2: +100 Armor Points [ Price: 1000XP | Limit: 8 ]
#3: Unlimited Clip [ Price: 3000XP | Limit: 3 ]
#4: Unlimited Ammo [ Price: 200XP | Limit: 5 ]
#5: Bomber [ Price: 1600XP | Limit: 3 ]
#6: Silent Footsteps [ Price: 3000XP | Limit: 1 ]
#7: Faster Speed [ Price: 4300XP | Limit: 1 ]
#8: Low Gravity [ Price: 2800XP | Limit: 1 ]
#9: Chameleon [ Price: 9000XP | Limit: 1 ]
#10: Drugs (Speed + Health) [ Price: 8000XP | Limit: 2 ]
#11: Transparency [ Price: 2500XP | Limit: 1 ]
#12: Invisibility (15 Seconds) [ Price: 16000XP | Limit: 1 | Duration: 14.8 ]
#13: Double Damage [ Price: 10000XP | Limit: 1 ]
#14: Godmode (5 Seconds) [ Price: 16000XP | Limit: 1 | Duration: 5.0 ]
#15: Health Regeneration [ Price: 1800XP | Limit: 1 ]
#16: Armor Regeneration [ Price: 2000XP | Limit: 1 ]
#17: AWP Sniper [ Price: 4750XP | Limit: 1 ]
#18: No Recoil [ Price: 12000XP | Limit: 1 | Duration: 5.0 ]
----- Custom Shop: 18 loaded items -----
ah ok then i got it wrong. i thought i could use every parachute plugin.

should i use this:

https://www.amxx-bg.info/forum/viewt...hp?f=53&t=3508

Code:
#include <amxmodx>
#include <customshop>
#include <fakemeta>
#include <hamsandwich>

#define _PLUGIN         "[ZP] Parachute"
#define _VERSION             "1.1"
#define _AUTHOR           "H.RED.ZONE"

#define PARACHUTE_MODEL "models/parachute.mdl"

#define MarkUserHasParachute(%0)	g_bitHasParachute |= (1<<(%0&31))
#define ClearUserHasParachute(%0)	g_bitHasParachute &= ~(1<<(%0&31))
#define HasUserParachute(%0)		g_bitHasParachute & (1<<(%0&31))

new g_bitHasParachute

#if !defined MAX_PLAYERS
const MAX_PLAYERS = 32
#endif

new g_iUserParachute[MAX_PLAYERS+1]

new bool:g_blCanUse[MAX_PLAYERS+1]

new Float:g_flEntityFrame[MAX_PLAYERS+1]

new g_iModelIndex
new g_pCvarFallSpeed
additem ITEM_PARACHUTE

new const PARACHUTE_CLASS[] = "parachute"

enum {
	deploy,
	idle,
	detach
}

public plugin_init() {
	register_plugin(_PLUGIN, _VERSION, _AUTHOR)

	g_pCvarFallSpeed = register_cvar("parachute_fallspeed", "30")

	register_forward( FM_CmdStart, "fw_Start" )
	
	RegisterHam(Ham_Spawn, "player", "Ham_CBasePlayer_Spawn_Post", 1)
	RegisterHam(Ham_Killed, "player", "Ham_CBasePlayer_Killed_Post", 1)
}

public plugin_precache() {
	g_iModelIndex = precache_model(PARACHUTE_MODEL)
	ITEM_PARACHUTE = cshop_register_item("parachute", "Parachute", 1000)
}

public cshop_item_selected(id, iItem)
{
    if(iItem == ITEM_PARACHUTE)
        g_blCanUse[id] = true
}

public cshop_item_removed(id, iItem)
{
    if(iItem == ITEM_PARACHUTE)
        g_blCanUse[id] = false
}

public client_putinserver(id) {
	if( HasUserParachute(id) ) {
		new iEnt = g_iUserParachute[id]
		if( iEnt ) {
			RemoveUserParachute(id, iEnt)
		}
		ClearUserHasParachute(id)
	}
}

public client_disconnect(id) {
	if( HasUserParachute(id) ) {
		new iEnt = g_iUserParachute[id]
		if( iEnt ) {
			RemoveUserParachute(id, iEnt)
		}
		ClearUserHasParachute(id)
	}
}

public Ham_CBasePlayer_Killed_Post( id ) {
	if( HasUserParachute(id) ) {
		new iEnt = g_iUserParachute[id]
		if( iEnt ) {
			RemoveUserParachute(id, iEnt)
		}
		ClearUserHasParachute(id)
	}
}

public Ham_CBasePlayer_Spawn_Post(id) {
	if( is_user_alive(id) ) {
		if( HasUserParachute(id) ) {
			new iEnt = g_iUserParachute[id]
			if( iEnt ) {
				RemoveUserParachute(id, iEnt)
			}
		}
		MarkUserHasParachute(id)
	}
}

RemoveUserParachute(id, iEnt) {
	engfunc(EngFunc_RemoveEntity, iEnt)
	g_iUserParachute[id] = 0
}

CreateParachute(id) {
	static iszInfoTarget
	if( !iszInfoTarget ) {
		iszInfoTarget = engfunc(EngFunc_AllocString, "info_target")
	}

	new iEnt = engfunc(EngFunc_CreateNamedEntity, iszInfoTarget)
	if( iEnt > 0) {
		static iszClass = 0
		if( !iszClass ) {
			iszClass = engfunc(EngFunc_AllocString, PARACHUTE_CLASS)
		}
		set_pev_string(iEnt, pev_classname, iszClass)
		set_pev(iEnt, pev_aiment, id)
		set_pev(iEnt, pev_owner, id)
		set_pev(iEnt, pev_movetype, MOVETYPE_FOLLOW)

		static iszModel = 0
		if( !iszModel ) {
			iszModel = engfunc(EngFunc_AllocString, PARACHUTE_MODEL)
		}
		set_pev_string(iEnt, pev_model, iszModel)
		set_pev(iEnt, pev_modelindex, g_iModelIndex)

		set_pev(iEnt, pev_sequence, deploy)
		set_pev(iEnt, pev_gaitsequence, 1)
		set_pev(iEnt, pev_frame, 0.0)
		g_flEntityFrame[id] = 0.0
		g_iUserParachute[id] = iEnt
		MarkUserHasParachute(id)
		new Float:fVecOrigin[3]
		pev(id, pev_origin, fVecOrigin)
		
		return iEnt
	}
	return 0
}

public fw_Start(id) {
	if( ~HasUserParachute(id) || !is_user_alive(id) || !g_blCanUse[id] ) {
		return
	}

	new Float:flFrame
	new iEnt = g_iUserParachute[id]

	if(iEnt > 0 && pev(id, pev_flags) & FL_ONGROUND) {

		if( pev(iEnt, pev_sequence) != detach ) {
			set_pev(iEnt, pev_sequence, detach)
			set_pev(iEnt, pev_gaitsequence, 1)
			set_pev(iEnt, pev_frame, 0.0)
			g_flEntityFrame[id] = 0.0
			set_pev(iEnt, pev_animtime, 0.0)
			set_pev(iEnt, pev_framerate, 0.0)
			return
		}

		pev(iEnt, pev_frame, flFrame)
		if( flFrame > 252.0 ) {
			RemoveUserParachute(id, iEnt)
			return
		}

		flFrame += 2.0

		g_flEntityFrame[id] = flFrame
		set_pev(iEnt, pev_frame, flFrame)

		return
	}

	if( pev(id, pev_button) & IN_USE ) {
		new Float:fVecVelocity[3], Float:fVelocity_z
		pev(id, pev_velocity, fVecVelocity)
		fVelocity_z = fVecVelocity[2]

		if( fVelocity_z < 0.0 ) {
			if(iEnt <= 0) {
				iEnt = CreateParachute(id)
			}

			fVelocity_z = floatmin(fVelocity_z + 15.0, -get_pcvar_float(g_pCvarFallSpeed))
			fVecVelocity[2] = fVelocity_z
			set_pev(id, pev_velocity, fVecVelocity)

			if( pev(iEnt, pev_sequence) == deploy ) {
				flFrame = g_flEntityFrame[id]++

				if( flFrame > 100.0 ) {
					set_pev(iEnt, pev_animtime, 0.0)
					set_pev(iEnt, pev_framerate, 0.4)
					set_pev(iEnt, pev_sequence, idle)
					set_pev(iEnt, pev_gaitsequence, 1)
					set_pev(iEnt, pev_frame, 0.0)
					g_flEntityFrame[id] = 0.0
				}
				else {
					set_pev(iEnt, pev_frame, flFrame)
				}
			}
		}
		else if(iEnt > 0) {
			RemoveUserParachute(id, iEnt)
		}
	}
	else if( iEnt > 0 && pev(id, pev_oldbuttons) & IN_USE ) {
		RemoveUserParachute(id, iEnt)
	}
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang10266\\ f0\\ fs16 \n\\ par }
*/
if it is, then I get the following error message when compiling:

Quote:
//AMXXPC compile.exe
// by the AMX Mod X Dev Team


//// cshop_parachute.sma
// 1. Compiler\scripting\cshop_parachute.sma(17) : error 017: undefined symbol "MAX_PLAYERS"
// 1. Compiler\scripting\cshop_parachute.sma(19) : error 009: invalid array size (negative or zero)
// 1. Compiler\scripting\cshop_parachute.sma(21) : error 009: invalid array size (negative or zero)
// 1. Compiler\scripting\cshop_parachute.sma(23) : error 009: invalid array size (negative or zero)
//
// 4 Errors.
// Could not locate output file D:\Incoming\4. Counter-Strike\Gameserver\Plugins\1. Compiler\scripting\compiled\cshop_parachute.a mx (compile failed).
//
// Compilation Time: 0,11 sec
// ----------------------------------------

Press enter to exit ...
where exactly do I have to insert the MAX_PLAYERS 32? I did not understand that.
__________________

Last edited by romeo72; 12-12-2021 at 15:28.
romeo72 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-12-2021 , 15:43   Re: [Request] OciXCrom Rank System
Reply With Quote #19

Of course you can't just download any plugin and expect it to magically be converted and added to the shop.

I really don't see how you can be getting that error.
Try adding #define MAX_PLAYERS 32 after the #include lines.
__________________

Last edited by OciXCrom; 12-12-2021 at 15:44.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-12-2021 , 16:03   Re: [Request] OciXCrom Rank System
Reply With Quote #20

MAX_PLAYERS wasn't defined prior to AMX Mod X 1.9.0+ so if he's using 1.8.2 then he should upgrade. If he's using 1.9.0+ then he needs to fix his installation.
__________________
fysiks is offline
Reply


Thread Tools
Display Modes

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 06:03.


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