Raised This Month: $ Target: $400
 0% 

Commands:Refrences


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Waleed
Senior Member
Join Date: May 2012
Location: Pakistan
Old 05-16-2012 , 05:54   Commands:Refrences
Reply With Quote #1

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?
Waleed is offline
Send a message via Skype™ to Waleed
kiki33hun
Veteran Member
Join Date: Jul 2011
Location: Magyarország
Old 05-16-2012 , 06:55   Re: Commands:Refrences
Reply With Quote #2

precache_generic?
__________________
kiki33hun is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 05-16-2012 , 09:15   Re: Commands:Refrences
Reply With Quote #3

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

Server start is plugin_init().
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 05-16-2012 , 11:00   Re: Commands:Refrences
Reply With Quote #4

Quote:
Originally Posted by Waleed View Post
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 View Post
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.
Liverwiz is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-16-2012 , 21:29   Re: Commands:Refrences
Reply With Quote #5

Quote:
Originally Posted by Liverwiz View Post
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.
__________________
fysiks is offline
StickP0le
Senior Member
Join Date: Jan 2010
Location: cuantocabron.com
Old 05-16-2012 , 22:10   Re: Commands:Refrences
Reply With Quote #6

Quote:
Originally Posted by Liverwiz View Post
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
__________________
Steam: stickp0le
StickP0le is offline
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 05-16-2012 , 23:08   Re: Commands:Refrences
Reply With Quote #7

Quote:
Originally Posted by fysiks View Post
IIRC, plugin_init() is not the first function to be executed.
Quote:
Originally Posted by Neeeeeeeeeel.- View Post
I think the first is plugin_precache( ).
Quote:
Originally Posted by StickP0le View Post
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?
Liverwiz is offline
Neeeeeeeeeel.-
Some Guy Yellin'
Join Date: Jul 2010
Location: Argentina
Old 05-16-2012 , 21:43   Re: Commands:Refrences
Reply With Quote #8

I think the first is plugin_precache( ).
__________________
Neeeeeeeeeel.- is offline
Send a message via Skype™ to Neeeeeeeeeel.-
Neeeeeeeeeel.-
Some Guy Yellin'
Join Date: Jul 2010
Location: Argentina
Old 05-16-2012 , 23:20   Re: Commands:Refrences
Reply With Quote #9

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.
__________________

Last edited by Neeeeeeeeeel.-; 05-16-2012 at 23:21.
Neeeeeeeeeel.- is offline
Send a message via Skype™ to Neeeeeeeeeel.-
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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