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

Noob questions...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 05-23-2017 , 18:48   Noob questions...
Reply With Quote #1

Well, I was programming, and I realized I know writing the codes, but I have no idea of your operation. And I got another questions also...

1. What is different between 'static' and 'new'? How to know when to use each one?

2. What is different between:

Code:
// Create a var new g_maxplayers; g_maxplayers = get_maxplayers(); // Directly use get_maxplayers();

and how to the compiler understand this code?

3. What is different between PAWN and AMXX?

4. How to learn about things never used/views of includes? (Example: some defines from hlsdk_const).

5. Why add -1 into Array's length?

6. Who spawn first, the chicken or the egg? If is the egg, then all the animals spawn as an egg? Why?

7. Why use ' & ' instead of ' == ' comparing/using bitsums?
__________________









Last edited by CrazY.; 05-23-2017 at 19:05.
CrazY. is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 05-23-2017 , 19:09   Re: Noob questions...
Reply With Quote #2

2. It's optimization, if you'll use the same native more than one time, catch it at something. Cuz it will be catched and the computer need not check it's value 'cuz it was catched. That's what I can explain, wait for more people explain better.
3. Guess there's nothing difference, I mean, about the plugin. It's just a choice.
4. Searching it's API on amxmodx.org
5. Because array starts at 0 until it's size. It depends, not everytime you'll use -1.
6. That's the human's question, guess a mutation or somethin' else had a animal that put eggs, then the first chicken was created and there's us asking for it.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo

Last edited by EFFx; 05-23-2017 at 19:12.
EFFx is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 05-23-2017 , 19:13   Re: Noob questions...
Reply With Quote #3

2. Ok.
3. Hmm, well.

4. What?: (from hlsdk_const)
Code:
#define FL_CONVEYOR                     (1<<2) #define FL_GODMODE                      (1<<6) #define FL_NOTARGET                     (1<<7) #define FL_WORLDBRUSH                   (1<<25)     // Not moveable/removeable brush entity (really part of the world, but represented as an entity for transparency or something)

Ok, and now, how to use this?

5. Yeah, you're correct:
Code:
//- Don't need to add -1. for (new i = 0; i < ArraySize(array); i++)
6. Yeah, otherwise don't make sense.
__________________









Last edited by CrazY.; 05-23-2017 at 19:30.
CrazY. is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 05-23-2017 , 19:19   Re: Noob questions...
Reply With Quote #4

6. Yep, doesn't make sense. Maybe a mutation again, or evolution of an animal and his sex changed from D to eggs and that animal started to put eggs. Then the other animal from his egg put eggs too and there's us asking about it.

About static or new, you can search on google, there's a discussion about it, maybe it help:
https://forums.alliedmods.net/showpo...17&postcount=8
https://forums.alliedmods.net/showth...=40340?t=40340
https://forums.alliedmods.net/showthread.php?t=154229
https://forums.alliedmods.net/showth...87025?t=187025
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo

Last edited by EFFx; 05-23-2017 at 19:26.
EFFx is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 05-23-2017 , 19:22   Re: Noob questions...
Reply With Quote #5

HAHA, it's a funny question.

Then why this guy said this to me? (the code it's from Zombie Plague Fix5a, automatically he was criticizing the creator, not me).

Quote:
Originally Posted by KliPPy View Post
Also, as a side note, there's no reason to use static modifier as you assign values to these variables before using them anyway.
__________________









Last edited by CrazY.; 05-23-2017 at 19:38.
CrazY. is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-23-2017 , 19:27   Re: Noob questions...
Reply With Quote #6

1. In simple words - use it if it will be called very often - in client prethink, cmdstart, functions that are called on each frame, etc. Also with big arrays.

2. It's called caching. If you use it more than once - save its value in a variable. The value can't change during gameplay.

3. Um... AMXX is not a programming language.

6. amx_spawn_chicken, amx_spawn_egg

7. Both are used for different ocasions.
__________________

Last edited by OciXCrom; 05-23-2017 at 19:28.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 05-23-2017 , 19:38   Re: Noob questions...
Reply With Quote #7

3. o.O then, what the hell is AMXX?
6. haha, Ok.
__________________








CrazY. is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 05-23-2017 , 19:42   Re: Noob questions...
Reply With Quote #8

I searched a bit about these,

FL_CONVEYOR, you can use for check if the user is in the air

PHP Code:
#define FL_ONGROUND2    (FL_ONGROUND | FL_PARTIALGROUND | FL_INWATER | FL_CONVEYOR | FL_FLOAT) 
FL_GODMODE, as it's name says, it checks if the user has godmode enabled, AKA get_user_godmode().

FL_NOTARGET, guess it's the same as godmode, I didn't find anything explainable about it.

FL_WORLDBRUSH, as it's description says:

Quote:
// Not moveable/removeable brush entity (really part of the world, but represented as an entity for transparency or something)
That explains all, don't it?
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 05-23-2017 , 19:46   Re: Noob questions...
Reply With Quote #9

Yeah, this help me, but, how to use? haha
__________________








CrazY. is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-23-2017 , 19:49   Re: Noob questions...
Reply With Quote #10

3. It's a Metamod plugin

FL_NOTARGET is not same as godmode. With notarget enabled, monsters will ignore you.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
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 03:30.


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