SA-MP Forums Archive
How to make MAX_'SOMETHING' - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How to make MAX_'SOMETHING' (/showthread.php?tid=370400)



How to make MAX_'SOMETHING' - Gumica - 19.08.2012

Hi,

As the title is, I would like to make something same as MAX_PLAYERS which has IDs(ie.: 'playerid').
For like MAX_ITEMS and I would like to use that as 'itemid'.

Thank you in advance!!!


Re: How to make MAX_'SOMETHING' - TaLhA XIV - 19.08.2012

just define them on the top of the script like
PHP код:
#define MAX_ITEMS//something 
((please rep if I helped.))


Re: How to make MAX_'SOMETHING' - Shetch - 19.08.2012

Quote:
Originally Posted by TaLhA XIV
Посмотреть сообщение
just define them on the top of the script like
PHP код:
#define MAX_ITEMS//something 
((please rep if I helped.))
Stop reputation whoring, god damn!


Re: How to make MAX_'SOMETHING' - Gumica - 20.08.2012

Hmm, well I knew it but it is not what I wanted.

I still cannoted use it as itemid, right or I can?


Re: How to make MAX_'SOMETHING' - playbox12 - 20.08.2012

Depends on how you use it your MAX_ITEMS define, it's just a command to the pre compiler so the former gets replaced with the latter during compiling* (MAX_ITEMS will be replaced with whatever you put to the right 'MAX_ITEMS 50' will replace MAX_ITEMS with 50 everywhere in your script).

If you use it to define an array it'll make the array 50 slots big, that's all it does really, just simplifying your needs.

*Or actually just before it starts compiling, pre check.