AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   to much included (https://forums.alliedmods.net/showthread.php?t=24817)

wouter 03-03-2006 04:30

to much included
 
if i start scripting i include all files that i could possible use,
so i have allwys to much included, not that i get errors but don't think its good for the balast of the server.
anyway, is there a way to see wish #includes i used and wish not?

for example: used this for a script of 156 lines :lol:
Code:
#include <amxmodx> #include <amxmisc> #include <fun> #include <amxconst> #include <cstrike>

v3x 03-03-2006 05:36

It all depends if you need the specific module and/or .inc file. Do not include unecessary things. Say you're using the function remove_entity, then you'd need to include engine because that's the module it's in.

http://www.amxmodx.org/funcwiki.php

P.S. amxconst does not need to be included.

SSJ2GOKU 03-03-2006 10:05

actually

i would always include following modules, just to be sure

Code:
#include <amxmodx> #include <amxmisc> #include <engine>

wouter 03-03-2006 10:51

so there is no auto-way to check?
then i will need to read all the includes. bommer :lol:
to mush reading :p

thx although :up:

[ --<-@ ] Black Rose 03-03-2006 11:42

if you're using amxx studio
every time you use a func this shows up:
http://xthost.info/BlackRose/lol.JPG

Kraugh 03-03-2006 15:46

since version 1.50, modules that are included are automatically required to be running for your plugin to load. this makes it a bad idea to include just whatever you might need. for example, you might include engine because you think you will need it, but do not use any of its functions. a server that does not run engine module will not be able to load your plugin.

you could simply include amxmodx, and write up your script. if you come across a "function not defined" error, look up which include it is from via the funcwiki and include that. eventually you will learn which functions go with which includes.

wouter 03-03-2006 16:22

ok will remember that :)
first script then include :wink:


All times are GMT -4. The time now is 20:29.

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