[Tutorial] Modular Programming
#12

Quote:
Originally Posted by AndySedeyn
View Post
I'm relatively new to modular programming. Sometimes an include is not being included for some reason.

Example:
PHP Code:
#include "./AntiCheat/ac_money.pwn"
#include "./AntiCheat/ac_health.pwn"
// Inside ac_money
#if defined _ac_money_included
    #endinput
#endif
#define _ac_money_included
// Inside ac_health
#if defined _ac_health_included
    #endinput
#endif
#define _ac_health_included
// Under the #include directives in the main file
#if !defined _ac_health_included
    #error Anti health hack is not included
#endif
#if !defined _ac_money_included
    #error Anti money hack not included
#endif 
'ac_money' is included first in the example above and that will show the error: 'Anti health hack not included'.

Changing their position:
PHP Code:
#include "./AntiCheat/ac_health.pwn"
#include "./AntiCheat/ac_money.pwn" 
Now it will pop the error: "Anti money hack not included'.

Putting them together in one file works, but I don't want that obviously. Any suggestion on why that could happen? The rest of my modules get included perfectly.
Is the folder inside gamemodes? If yes include them this way #include "folder/pwnfile.pwn". Also make sure you put the anti-cheat first before other modules just to make sure these hooked function functions properly. also its unnecessary to have. if !defined directive.
Reply


Messages In This Thread
Modular Programming - by PatrickGTR - 29.12.2015, 20:23
Re: Modular Programming - by CrazyChoco - 29.12.2015, 20:27
Re: Modular Programming - by Sasino97 - 29.12.2015, 21:03
Re: Modular Programming - by Pottus - 29.12.2015, 21:17
Re: Modular Programming - by Dayvison_ - 29.12.2015, 21:28
Re: Modular Programming - by VincenzoDrift - 30.12.2015, 09:13
Re: Modular Programming - by PatrickGTR - 30.12.2015, 13:15
Re: Modular Programming - by [XST]O_x - 30.12.2015, 13:22
Re: Modular Programming - by PrO.GameR - 30.12.2015, 13:32
Re: Modular Programming - by PatrickGTR - 30.12.2015, 14:47
Re: Modular Programming - by AndySedeyn - 01.01.2016, 03:14
Re: Modular Programming - by PatrickGTR - 01.01.2016, 17:54
Re: Modular Programming - by AndySedeyn - 01.01.2016, 18:05
Re: Modular Programming - by PatrickGTR - 01.01.2016, 18:21
Re: Modular Programming - by AndySedeyn - 01.01.2016, 18:26
Re: Modular Programming - by Kimble - 06.09.2016, 20:41
Re: Modular Programming - by PrO.GameR - 06.09.2016, 21:51
Re: Modular Programming - by SickAttack - 06.09.2016, 21:52
Re: Modular Programming - by K0P - 07.09.2016, 16:55
Re: Modular Programming - by Misiur - 07.09.2016, 17:17
Re: Modular Programming - by Crayder - 07.09.2016, 17:48
Re: Modular Programming - by OneDay - 07.09.2016, 19:12
Re: Modular Programming - by AndySedeyn - 07.09.2016, 19:37
Re: Modular Programming - by TakeiT - 22.09.2016, 22:30
Re: Modular Programming - by Alcatrik - 03.10.2016, 14:50
Re: Modular Programming - by SickAttack - 03.10.2016, 17:20
Re: Modular Programming - by Crayder - 03.10.2016, 18:00
Re: Modular Programming - by SickAttack - 03.10.2016, 22:24
Re: Modular Programming - by theralio - 11.01.2019, 08:12
Re: Modular Programming - by GRiMMREAPER - 13.01.2019, 14:41
Re: Modular Programming - by RogueDrifter - 21.01.2019, 18:42
Re: Modular Programming - by Calisthenics - 21.01.2019, 18:56
Re: Modular Programming - by Logic_ - 23.01.2019, 07:05

Forum Jump:


Users browsing this thread: 1 Guest(s)