I need an explanation of a define
Hi,
Well, nothing... i just don't understand this code: PHP Code:
Also, apart of this... i see in some codes using two "!!", like in the code above... what means that? Thanks |
Re: I need an explanation of a define
MAX_ENTS simply tells how many entities can possibly be in the map. So instead of writing "900 + MAX_PLAYERS * 15" all the time, you use MAX_ENTS.
!! means "no" to "no", but giving you a bool value (1 or 0). If you had number 10, it will return number 1, if you had 0, you'll get 0. Code:
Code:
Code:
I'm not really familiar with "%", I'm afraid. |
Re: I need an explanation of a define
According to arkshine,
900 + MAX_PLAYERS * 15 should be replaced with : 900 + (MAX_PLAYERS-1) * 15 not that in plugins you can see, MAX_PLAYERS is 32 because they are public, but if you make a private plugin you can replace it with the real maxplayer amount of your server. |
Re: I need an explanation of a define
Don't why they remove -1 ; it would make sense to use MAX_PLAYERS.
|
Re: I need an explanation of a define
I know the basic things -.- like define and others... i added the first define so you can understand the second define.
The part that i didn't understand at all is exactly this: PHP Code:
@ Connor The code is used in your plugin kz buttonlocs xd Thanks to all |
Re: I need an explanation of a define
@Alucard^
The % operator is the modulo operator. It returns the remainder after division. So if you did 8 % 5, you'd get 3 as a return value. The _: "untags" certain things. For example, if you did something like PHP Code:
|
Re: I need an explanation of a define
Oh thanks...
About the _: thing... if i understand is for not use the enum things right? Thanks |
Re: I need an explanation of a define
Yes, it's more commonly used to detag members of an enum (don't know the pawn terminology for member).
No problem. |
Re: I need an explanation of a define
Quote:
|
| All times are GMT -4. The time now is 14:55. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.