Raised This Month: $12 Target: $400
 3% 

Reload amx.cfg in every round.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
jonnzus
Epic Member
Join Date: Oct 2010
Location: Finland
Old 04-15-2012 , 15:06   Reload amx.cfg in every round.
Reply With Quote #1

Can someone make me code what reloads amx.cfg in every round, or some other ini/txt/.cfg file?

I got this kinda of code what reloads when someone connects.
When is exec that file there is commands what server should do then.

Code:
public client_putinserver(id) 
    server_cmd("exec cstrike\addons\amxmodx\configs\amx.cfg)

new g_msgChannel
__________________
Quote:
367. Everyone's copyright will be broken. No exceptions.

Last edited by jonnzus; 04-15-2012 at 15:11.
jonnzus is offline
Deidara
Member
Join Date: Jul 2010
Location: Romania
Old 04-15-2012 , 15:14   Re: Reload amx.cfg in every round.
Reply With Quote #2

Why do you not set a task every x seconds with a public on server_cmd?

Code:
#include < amxmodx >

public plugin_init()
{
register_plugin("Reload","1.0","Deidara");
set_task(30.0, "reload", _, _, _,"b");
}

public reload()
{
 server_cmd("exec cstrike/addons/amxmodx/configs/amx.cfg");
}

Last edited by Deidara; 04-15-2012 at 15:36.
Deidara is offline
Send a message via Yahoo to Deidara Send a message via Skype™ to Deidara
jonnzus
Epic Member
Join Date: Oct 2010
Location: Finland
Old 04-15-2012 , 15:19   Re: Reload amx.cfg in every round.
Reply With Quote #3

Quote:
Originally Posted by Deidara View Post
Why do you not set a task every x seconds with a public on server_cmd?

Code:
#include < amxmodx >

public plugin_init()
{
register_plugin("Reload","1.0","Deidara");
set_task(30.0, "reload", _, _, _,"b");
}

public reload()
{
 server_cmd("exec cstrikeaddonsamxmodxconfigsamx.cfg");
}
Thanks that OK too, to I have to put \ marks to cstike-addons-etc?
__________________
Quote:
367. Everyone's copyright will be broken. No exceptions.
jonnzus is offline
Deidara
Member
Join Date: Jul 2010
Location: Romania
Old 04-15-2012 , 15:21   Re: Reload amx.cfg in every round.
Reply With Quote #4

My bad, yes, you need to put "\"
cstrike\addons\amxmodx\configs\amx.cfg
Deidara is offline
Send a message via Yahoo to Deidara Send a message via Skype™ to Deidara
jonnzus
Epic Member
Join Date: Oct 2010
Location: Finland
Old 04-15-2012 , 15:30   Re: Reload amx.cfg in every round.
Reply With Quote #5

So this is right?


public reload()
{
server_cmd("exec cstrike\addons\amxmodx\configs\amx.cfg");
}


And when it loads that does server make those commands what are inside of amx.cfg?
__________________
Quote:
367. Everyone's copyright will be broken. No exceptions.
jonnzus is offline
Deidara
Member
Join Date: Jul 2010
Location: Romania
Old 04-15-2012 , 15:35   Re: Reload amx.cfg in every round.
Reply With Quote #6

Must be "/" not "\", so, this is the correct form:

Code:
public reload()
{
server_cmd("exec cstrike/addons/amxmodx/configs/amx.cfg");
}
When command exec, any settings in amx.cfg will load in real time

Last edited by Deidara; 04-15-2012 at 16:23.
Deidara is offline
Send a message via Yahoo to Deidara Send a message via Skype™ to Deidara
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 04-15-2012 , 16:18   Re: Reload amx.cfg in every round.
Reply With Quote #7

Untested:
Attached Files
File Type: sma Get Plugin or Get Source (Exec.sma - 899 views - 560 Bytes)
File Type: ini execfiles.ini (45 Bytes, 261 views)
__________________
kramesa is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-15-2012 , 16:42   Re: Reload amx.cfg in every round.
Reply With Quote #8

Quote:
Originally Posted by jonnzus View Post
So this is right?


public reload()
{
server_cmd("exec cstrike\addons\amxmodx\configs\amx.cfg");
}


And when it loads that does server make those commands what are inside of amx.cfg?
Remove "cstrike\" it already assumes you are in the cstrike directory. Also, the default file is actually called "amxx.cfg".

Quote:
Originally Posted by kramesa View Post
Untested:
Clearly. And, it's pointless to use a file for that. If you don't want it hardcoded, you could use a cvar. However, if the OP is able to compile the plugin him/herself then I would recommend hardcoding it.
__________________
fysiks is offline
jonnzus
Epic Member
Join Date: Oct 2010
Location: Finland
Old 04-15-2012 , 16:50   Re: Reload amx.cfg in every round.
Reply With Quote #9

Quote:
Originally Posted by fysiks View Post
Remove "cstrike\" it already assumes you are in the cstrike directory. Also, the default file is actually called "amxx.cfg".



Clearly. And, it's pointless to use a file for that. If you don't want it hardcoded, you could use a cvar. However, if the OP is able to compile the plugin him/herself then I would recommend hardcoding it.
Ok thanks.

Btw does it need to be like this;


server_cmd("exec /addons/amxmodx/configs/amxx.cfg");
or this?
server_cmd("exec "/addons/amxmodx/configs/amxx.cfg");
__________________
Quote:
367. Everyone's copyright will be broken. No exceptions.
jonnzus is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-15-2012 , 16:54   Re: Reload amx.cfg in every round.
Reply With Quote #10

Quote:
Originally Posted by jonnzus View Post
server_cmd("exec /addons/amxmodx/configs/amxx.cfg");
or this?
server_cmd("exec "/addons/amxmodx/configs/amxx.cfg");
The first one but without the first slash.
__________________
fysiks is offline
Reply


Thread Tools
Display Modes

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 09:20.


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