Raised This Month: $ Target: $400
 0% 

if( whatever ) add to const


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
NiQu
Veteran Member
Join Date: Nov 2009
Old 05-25-2010 , 14:06   if( whatever ) add to const
Reply With Quote #1

Hello, lets say i have an enum and a const:

PHP Code:
enum _:g_iItemCount
{
    
ITEM1,
    
ITEM2,
    
ITEM3
}

new const 
g_iItems[g_iItemCount][] =
{
    
"Item #1",
    
"Item #2",
    
"Item #3"

and lets say i only want to add the third item, ITEM3 and "Item #3" if a variable is set to 0, how would i do? I tried to add an if statement in the middle of the enum and it didnt work.
__________________
My Projects
  • RoTAPI V0.0.1 ------- Private
    • Progress - [||||||||||]
  • CashMod V0.0.6 ----- Public
    • Progress - [||||||||||]
  • CashMod V0.0.7 ----- Public
    • Progress - [||||||||||]
NiQu is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-25-2010 , 14:53   Re: if( whatever ) add to const
Reply With Quote #2

Just leave it as is and don't use ITEM3 if you don't need it.
__________________
fysiks is offline
NiQu
Veteran Member
Join Date: Nov 2009
Old 05-25-2010 , 14:57   Re: if( whatever ) add to const
Reply With Quote #3

Its like this:

I got 2 plugin and 1 include, I have a native called server_type and 1 param wich is type.

And in plugin #1 i have a global variable called g_serverType and i wanna chcek if g_serverType is 0 and if it is 0 it shud att item 3 if it is anything else but 0 it should skip item 3 and go to item 4 or simply not add item 3.

Understand?
__________________
My Projects
  • RoTAPI V0.0.1 ------- Private
    • Progress - [||||||||||]
  • CashMod V0.0.6 ----- Public
    • Progress - [||||||||||]
  • CashMod V0.0.7 ----- Public
    • Progress - [||||||||||]
NiQu is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-25-2010 , 14:59   Re: if( whatever ) add to const
Reply With Quote #4

Quote:
Originally Posted by NiQu View Post
Its like this:

I got 2 plugin and 1 include, I have a native called server_type and 1 param wich is type.

And in plugin #1 i have a global variable called g_serverType and i wanna chcek if g_serverType is 0 and if it is 0 it shud att item 3 if it is anything else but 0 it should skip item 3 and go to item 4 or simply not add item 3.

Understand?
Yes, I understand. But, my advice doesn't change. You can't do what you want to do.
__________________
fysiks is offline
NiQu
Veteran Member
Join Date: Nov 2009
Old 05-25-2010 , 15:05   Re: if( whatever ) add to const
Reply With Quote #5

So its not possible to do that?

Well ill just make an if in the menu and check if item == item3 and if so ill skip the item.

Thanks anyways.
__________________
My Projects
  • RoTAPI V0.0.1 ------- Private
    • Progress - [||||||||||]
  • CashMod V0.0.6 ----- Public
    • Progress - [||||||||||]
  • CashMod V0.0.7 ----- Public
    • Progress - [||||||||||]
NiQu is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-25-2010 , 15:06   Re: if( whatever ) add to const
Reply With Quote #6

Quote:
Originally Posted by NiQu View Post
So its not possible to do that?

Well ill just make an if in the menu and check if item == item3 and if so ill skip the item.

Thanks anyways.
What are you trying to achieve?
__________________
fysiks is offline
NiQu
Veteran Member
Join Date: Nov 2009
Old 05-25-2010 , 15:13   Re: if( whatever ) add to const
Reply With Quote #7

If plugin2.amxx is running on the server then item3 wont be added because plugin2.amxx adds something else that does almost the same.

If both item3 is in menu and plugin2.amxx is running and i buy item3 and i also buy something in plugin2.amxx then plugin2.amxx will intefere plugin1.amxx and that isnt good.
__________________
My Projects
  • RoTAPI V0.0.1 ------- Private
    • Progress - [||||||||||]
  • CashMod V0.0.6 ----- Public
    • Progress - [||||||||||]
  • CashMod V0.0.7 ----- Public
    • Progress - [||||||||||]
NiQu is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-25-2010 , 15:21   Re: if( whatever ) add to const
Reply With Quote #8

Skip ITEM3 if you don't want it in there.
__________________
fysiks is offline
NiQu
Veteran Member
Join Date: Nov 2009
Old 05-25-2010 , 15:24   Re: if( whatever ) add to const
Reply With Quote #9

U dont quite understand what i want.

Maybe you didnt understand i want this to be like an API....

if(plugin_running(plugin2.amxx) itemdelete(item3))
__________________
My Projects
  • RoTAPI V0.0.1 ------- Private
    • Progress - [||||||||||]
  • CashMod V0.0.6 ----- Public
    • Progress - [||||||||||]
  • CashMod V0.0.7 ----- Public
    • Progress - [||||||||||]
NiQu is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-25-2010 , 15:44   Re: if( whatever ) add to const
Reply With Quote #10

Quote:
Originally Posted by NiQu View Post
U dont quite understand what i want.
I don't think you understand what I'm saying.
__________________
fysiks 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 05:20.


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