Raised This Month: $ Target: $400
 0% 

[Request] OciXCrom Rank System


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 


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 20:20.


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