AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Commands:Refrences (https://forums.alliedmods.net/showthread.php?t=185349)

Waleed 05-16-2012 05:54

Commands:Refrences
 
How to execute or precache an .ini file (simple text file) from addons/amxmodx/data/lang/myfile.ini



What is the refrence for server start,I want to grab the server start event,HOW?
.....OR.....
When server starts,execute the above file,HOW? Any module?

kiki33hun 05-16-2012 06:55

Re: Commands:Refrences
 
precache_generic?

hornet 05-16-2012 09:15

Re: Commands:Refrences
 
Hold up ... Lang files are text files, not INI files, and why would you want to precache it?

Server start is plugin_init().

Liverwiz 05-16-2012 11:00

Re: Commands:Refrences
 
Quote:

Originally Posted by Waleed (Post 1709840)
How to execute or precache an .ini file (simple text file) from addons/amxmodx/data/lang/myfile.ini

There's no point in pre-caching .ini .txt .log or .cfg files. they're all read on the fly.
Also...hornet is correct. lang files are .txt and are grabbed through register_dictionary(const file[])

Quote:

Originally Posted by Waleed (Post 1709840)
What is the refrence for server start,I want to grab the server start event,HOW?
.....OR.....
When server starts,execute the above file,HOW? Any module?

The server starts BEFORE the plugin starts. There are many events you can have things run at. client_putinserver(id), client_connect(id), spawn, plugin start, plugin end

the plugin first looks to plugin_init() function to run when it is called by the server.

I suppose hornet answerd all those questions, just thought i'd go a little more in depth. I'm bored.

fysiks 05-16-2012 21:29

Re: Commands:Refrences
 
Quote:

Originally Posted by Liverwiz (Post 1709967)
the plugin first looks to plugin_init() function to run when it is called by the server.

IIRC, plugin_init() is not the first function to be executed.

Neeeeeeeeeel.- 05-16-2012 21:43

Re: Commands:Refrences
 
I think the first is plugin_precache( ).

StickP0le 05-16-2012 22:10

Re: Commands:Refrences
 
Quote:

Originally Posted by Liverwiz (Post 1709967)
There's no point in pre-caching .ini .txt .log or .cfg files. they're all read on the fly.
Also...hornet is correct. lang files are .txt and are grabbed through register_dictionary(const file[])



The server starts BEFORE the plugin starts. There are many events you can have things run at. client_putinserver(id), client_connect(id), spawn, plugin start, plugin end

the plugin first looks to plugin_init() function to run when it is called by the server.

I suppose hornet answerd all those questions, just thought i'd go a little more in depth. I'm bored.

no, plugin precache is the first public to be called when you start a server

Liverwiz 05-16-2012 23:08

Re: Commands:Refrences
 
Quote:

Originally Posted by fysiks (Post 1710390)
IIRC, plugin_init() is not the first function to be executed.

Quote:

Originally Posted by Neeeeeeeeeel.- (Post 1710394)
I think the first is plugin_precache( ).

Quote:

Originally Posted by StickP0le (Post 1710399)
no, plugin precache is the first public to be called when you start a server

I stand corrected. But does plugin_precache() have any logic in it? or is it just precaches and loads?

Neeeeeeeeeel.- 05-16-2012 23:20

Re: Commands:Refrences
 
Quote:

Originally Posted by AMXMODX Wiki
Code:

plugin_precache - Actually first called forward

Syntax:
    public  plugin_precache (  )

Type:

    Forward
 
Notes:

    You should do all precaching here, as it is called on ServerActivate.




All times are GMT -4. The time now is 00:26.

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