Raised This Month: $32 Target: $400
 8% 

Solved Stupid Problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
WOASRY
New Member
Join Date: Aug 2017
Old 08-10-2017 , 15:32   Stupid Problem
Reply With Quote #1



Code:
for(new i = 1; i <= MAX_CLASS; i++)
		{
			if( Furien_PlayerVariables[id][Level] >= Furien_Class_Counter[i][Level] )
			{
				formatex(string, sizeof(string), "\y%s \r[ Level: %d / XP: %d ]", Furien_Class_Counter[i][Name], Furien_Class_Counter[i][Level], Level_XP[Furien_Class_Counter[i][Level]][XP]);
				menu_additem ( menu, string, "AF", 0 );
			}
			else
			{
				formatex(string, sizeof(string), "\d%s [ Level: %d / XP: %d ]", Furien_Class_Counter[i][Name], Furien_Class_Counter[i][Level], Level_XP[Furien_Class_Counter[i][Level]][XP]);
				menu_additem ( menu, string, "AF", ADMIN_RCON );
			}
		}
Error Line
Code:
if( Furien_PlayerVariables[id][Level] >= Furien_Class_Counter[i][Level] )
Declaration:
Code:
#define MAX_LEVEL 30
enum PlayerVariables
{
	Level,
	XP,
	Credits,
	Has_ClassID,
	Has_PowerID
};
new Furien_PlayerVariables[33][PlayerVariables];

enum LevelVariables
{
	Level,
	XP
};
static const Level_XP[MAX_LEVEL + 1][LevelVariables] = 
{
	/* Level, XP */
	{0, 0},
	{1, 500},
	{2, 1000},
	{3, 2000},
	{4, 3000},
	{5, 4000},
	{6, 6000},
	{7, 8000},
	{8, 10000},
	{9, 12000},
	{10, 15000},
	{11, 18000},
	{12, 21000},
	{13, 24000},
	{14, 27000},
	{15, 30000},
	{16, 35000},
	{17, 40000},
	{18, 45000},
	{19, 50000},
	{20, 55000},
	{21, 60000},
	{22, 70000},
	{23, 80000},
	{24, 90000},
	{25, 100000},
	{26, 110000},
	{27, 120000},
	{28, 130000},
	{29, 140000},
	{30, 150000}
};

Last edited by WOASRY; 08-17-2017 at 17:37.
WOASRY is offline
DjSoftero
Veteran Member
Join Date: Nov 2014
Location: Lithuania
Old 08-12-2017 , 03:02   Re: Stupid Problem
Reply With Quote #2

try removing formatex in next line and in menu_additem use "" sometimes compiler gives completely wrong line
__________________
retired chump
DjSoftero is offline
Old 08-12-2017, 03:43
jimaway
This message has been deleted by jimaway.
Old 08-12-2017, 05:03
Ayman Khaled
This message has been deleted by Ayman Khaled. Reason: nvm
WOASRY
New Member
Join Date: Aug 2017
Old 08-17-2017 , 12:41   Re: Stupid Problem
Reply With Quote #3

Up
WOASRY is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 08-17-2017 , 12:53   Re: Stupid Problem
Reply With Quote #4

Is there "Level" constant in any other Enumeration in your code?
klippy is offline
WOASRY
New Member
Join Date: Aug 2017
Old 08-17-2017 , 17:09   Re: Stupid Problem
Reply With Quote #5




this?
WOASRY is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 08-17-2017 , 18:07   Re: Stupid Problem
Reply With Quote #6

Prefix all your Enumeration members. A constant is not namespaced when you define it in an Enumeration, it's still in the global namespace. Each time you define "Level" in another Enumeration, you are actually redefining "Level" and just putting another tag to it (hence the tag mismatch warning too).

Last edited by klippy; 08-17-2017 at 18:08.
klippy is offline
Reply



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 01:58.


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