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 , 17:12   Re: [Request] OciXCrom Rank System
Reply With Quote #24

ok,
i have now inserted the command #define MAX_PLAYERS 32 after #include. and it was compiled without errors.

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

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

#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 

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

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)
}

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)
		
		g_blCanUse[id] = (get_user_team(id) == 2) ? true : false
	}
}

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 }
*/
Code:
amx_plugins
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] [ZP] Parachute          1.1         H.RED.ZONE        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

From the game console:

Code:
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 -----
Unfortunately, the parachute still does not appear in the Custom Shop for selection?
do you need more information to see what could be the cause?

best regards
__________________

Last edited by romeo72; 12-12-2021 at 17:20.
romeo72 is offline
 



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