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

Why do this Plugin Have alot errors?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Taha_rajper
Member
Join Date: Jun 2021
Location: Under The Sea
Old 09-19-2022 , 04:21   Why do this Plugin Have alot errors?
Reply With Quote #1

Hello Everyone, i've Coded myself a Custom vipmenu plugin, i saw it 2-3times but idk why do it have errors, if anyone knows let me know, or if anyone can fix it please?

Last edited by Taha_rajper; 09-19-2022 at 09:15.
Taha_rajper is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 09-19-2022 , 07:55   Re: Why do this Plugin Have alot errors?
Reply With Quote #2

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

enum eShopItems
{
	ITEM_NAME[ 64 ],
	ITEM_COUNT,
	ITEM_ACCESS
}

new const g_szItems[ ][eShopItems] = 
{
	{ "\y+100 \wHealth", 100, ADMIN_ALL },
	{ "\y+200 \wArmor", 200, ADMIN_ALL },
	{ "\y600 \wGravity", 600, ADMIN_ALL },
	{ "\y450 \wSpeed", 450, ADMIN_ALL },
	{ "\wGrenade Pack", 0, ADMIN_ALL },
	{ "\wNightvision [\yFor Dark Maps\w]", 0, ADMIN_ALL },
	{ "\wAll in One \r(Admins Only)", 0, ADMIN_CHAT },
}

new g_iHasSpeed[ 33 ];

public plugin_init( )
{
	register_plugin( "VIP SHOP", "1.0", "Supremache" );
	
	register_clcmd("menu_vip", "VIPShopMenu", ADMIN_LEVEL_H, "VIP's Menu" );
	
	RegisterHam( Ham_Item_PreFrame, "player", "@CBase_Player_ResetMaxSpeed", 1 );
}

@CBase_Player_ResetMaxSpeed( id )
{
	if( ! is_user_alive( id ) || !g_iHasSpeed[ id ] )
	{
		return;
	}
	
	set_pev( id, pev_maxspeed, float( g_szItems[ 3 ][ ITEM_COUNT ] ) );
}

public VIPShopMenu( id, iLevel, iCid )
{
	if( !cmd_access( id, iLevel, iCid, 1 ) )
	{
		return PLUGIN_HANDLED;
	}
	
	new szID[ 5 ], iMenu = menu_create( "VIP MENU:", "VIPShopHandler" )
	
	for( new i ; i < sizeof g_szItems; i++ )
	{
		num_to_str( i, szID, charsmax( szID ) );
		menu_additem( iMenu, g_szItems[ i ][ ITEM_NAME ], szID, g_szItems[ i ][ ITEM_ACCESS ] );
	}
	
	menu_display( id, iMenu );
	return PLUGIN_HANDLED;
}

public VIPShopHandler( id, iMenu, iItem ) 
{
	if( iItem != MENU_EXIT )
	{
		static szData[ 10 ], iUnused;
		menu_item_getinfo( iMenu, iItem, iUnused, szData, charsmax(szData), .callback = iUnused )
		new iItemID = str_to_num( szData );
		
		switch( iItemID )
		{
			case 0: set_pev( id, pev_health, pev( id, pev_health ) + float( g_szItems[ iItemID ][ ITEM_COUNT ] ) );
			case 1: set_pev( id, pev_armorvalue, pev( id, pev_armorvalue ) + float( g_szItems[ iItemID ][ ITEM_COUNT ] ) );
			case 2: set_pev( id, pev_gravity, float( g_szItems[ iItemID ][ ITEM_COUNT ] ) / 800.0 );
			case 3: g_iHasSpeed[ id ] = true;
			case 4: { give_item(id, "CSW_HEGRENADE"); give_item(id, "CSW_SMOKEGRENADE"); }
			case 5: cs_set_user_nvg( id );
			case 6: 
			{
				g_iHasSpeed[ id ] = true;
				set_pev( id, pev_health, pev( id, pev_health ) + float( g_szItems[ iItemID ][ ITEM_COUNT ] ) );
				set_pev( id, pev_armorvalue, pev( id, pev_armorvalue ) + float( g_szItems[ iItemID ][ ITEM_COUNT ] ) );
				set_pev( id, pev_gravity, float( g_szItems[ iItemID ][ ITEM_COUNT ] ) / 800.0 );
				give_item(id, "CSW_HEGRENADE");
				give_item(id, "CSW_SMOKEGRENADE");
				cs_set_user_nvg( id );
			}
			
		}
	}
	menu_destroy( iMenu );
	return PLUGIN_HANDLED;
}
__________________
Youtube.com/Supremache

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

Last edited by Supremache; 09-22-2022 at 07:08.
Supremache is offline
Taha_rajper
Member
Join Date: Jun 2021
Location: Under The Sea
Old 09-19-2022 , 09:14   Re: Why do this Plugin Have alot errors?
Reply With Quote #3

Thank you so much

Last edited by Taha_rajper; 09-19-2022 at 09:14.
Taha_rajper 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 10:01.


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