This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

[TUT] Enumerations (enum)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-09-2010 , 07:33   Re: [TUT] Enumerations (enum)
Reply With Quote #1

That's not related to the subject. I don't see the point to talk about that. See yourself in the HLSDK or whatever. Coders are free to choose the style they want to their plugins.
__________________
Arkshine is offline
pokemonmaster
princess milk
Join Date: Nov 2010
Location: Somewhere in this world
Old 01-14-2013 , 15:56   Re: [TUT] Enumerations (enum)
Reply With Quote #2

I have a compile error when using charsmax
PHP Code:
new gsz_Motds[][MOTD] = {
    { 
"http://link1.com""Admin Rules"},
    { 
"http://link2.com""General Rules"},
    { 
"http://link3.com""Website Rules"},
    { 
"http://link4.com""Server Rules"},
    { 
"http://link5.com""^n^nBan times"}
}


enum _:MOTD
{
    
LINK[100] = 0,
    
TITLE[50],
    
ACCESS
}

BuildMenu()
{
    
gMenu menu_create("Rules Menu""menu_handler")
    
    new 
iCallBack menu_makecallback("handle_callback")
    
    new 
szInfo[4]
    new 
iSize sizeof gsz_Motds )
    
    for(new 
iiSizei++)
    {
        
formatex(szInfocharsmax(szInfo), "%d"i)
        
        while(
contain(gsz_Motds[i][TITLE], "^n") != -1)
        {
            
// Error: Expected token: "]", but found "-identifier-" on line 60
            
replace(gsz_Motds[i][TITLE], charsmax(gsz_Motds[i][TITLE]), "^n"""// Error is here ...
            
menu_addblank(gMenu)
        }
        
        
menu_additem(gMenugsz_Motds[i][TITLE], szInfo0gsz_Motds[i][ACCESS] ? iCallBack : -1)
    }

__________________
اَشْهَدُ اَنْ لَّآ اِلٰهَ اِلَّا اللہُ وَحْدَه لَا شَرِيْكَ لَه وَ اَشْهَدُ اَنَّ مُحَمَّدًا عَبْدُه وَرَسُوْلُه
No longer active in AMXX. Sorry.

Last edited by pokemonmaster; 01-14-2013 at 15:57.
pokemonmaster is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 10-09-2010 , 08:19   Re: [TUT] Enumerations (enum)
Reply With Quote #3

Fine. Thanks for being jerk.
__________________
hleV is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-09-2010 , 08:30   Re: [TUT] Enumerations (enum)
Reply With Quote #4

Look, you have already your answer (yours) and you still ask. You are talking about a notation which has already been discussed elsewhere. You can find plenty of references like HLSDK or HLSDK:S. I'm not sure to understand why you insist on that, you should well aware it doesn't matter and pawn != c/c++.
__________________

Last edited by Arkshine; 10-09-2010 at 08:34.
Arkshine is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 10-09-2010 , 12:44   Re: [TUT] Enumerations (enum)
Reply With Quote #5

Quote:
Originally Posted by Arkshine View Post
Look, you have already your answer (yours) and you still ask. You are talking about a notation which has already been discussed elsewhere. You can find plenty of references like HLSDK or HLSDK:S. I'm not sure to understand why you insist on that, you should well aware it doesn't matter and pawn != c/c++.
I was wondering because I never seen anyone using m_ for members of enumeration. While Pawn is not C/C++, its enumeration reminds of C/C++' structures. The question is also related to enumerations, which is what this thread is all about. Sorry that my question didn't look good enough for you to answer (answer well).
__________________
hleV is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 10-09-2010 , 12:46   Re: [TUT] Enumerations (enum)
Reply With Quote #6

Quote:
Originally Posted by hleV View Post
I was wondering because I never seen anyone using m_ for members of enumeration.
I have in my private plugins because I had to basically create a class like you would in C++ but using a different plugin to handle the class.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-09-2010 , 12:54   Re: [TUT] Enumerations (enum)
Reply With Quote #7

Quote:
The question is also related to enumerations, which is what this thread is all about. Sorry that my question didn't look good enough for you to answer (answer well).
The thread is about the use of an enum, not about how naming a var/item/whatyouwant. For that, it's related to the coder's style and there is already a thread about that. That's why there was no point to talk about that there. Also just because the pawn syntax is near of the c/c++ doesn't mean you have to use the same way of naming a var.
__________________
Arkshine is offline
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 10-09-2010 , 13:12   Re: [TUT] Enumerations (enum)
Reply With Quote #8

Just for your information Hlev m_* is use to declare offsets like m_iPlayerSucks = 343
__________________

My Plugins For ZP

Inactive due to College and Studies
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 10-09-2010 , 13:16   Re: [TUT] Enumerations (enum)
Reply With Quote #9

Quote:
Originally Posted by abdul-rehman View Post
Just for your information Hlev m_* is use to declare offsets like m_iPlayerSucks = 343
Wrong. m_* is used for member variables within a class.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 10-09-2010 , 13:37   Re: [TUT] Enumerations (enum)
Reply With Quote #10

Quote:
Originally Posted by Exolent[jNr] View Post
Wrong. m_* is used for member variables within a class.
OK
But what r member variables
__________________

My Plugins For ZP

Inactive due to College and Studies
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
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:33.


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