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

[Stock] Auto Exec Config File


Post New Thread Reply   
 
Thread Tools Display Modes
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-14-2010 , 01:39   Re: [Stock] Auto Exec Config File
Reply With Quote #11

Obviously because i'm too lazy, i may do it though.
Gonna see what you said in previous post later...

-edit-
Your way only seem to set cvars, i want to send commands as well.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 12-14-2010 at 01:55.
ConnorMcLeod is offline
Seta00
The Seta00 user has crashed.
Join Date: Jan 2010
Location: Berlin
Old 12-14-2010 , 09:13   Re: [Stock] Auto Exec Config File
Reply With Quote #12

Maybe if you do a server_exec() before exec'ing your config file to be sure it will only execute your command on that frame?
This is just a guess but I'd give it a try, since I don't know how the engine exec's config files internally.
Seta00 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-14-2010 , 11:17   Re: [Stock] Auto Exec Config File
Reply With Quote #13

I don't remember what is the problem when you don't send server_exec, if it is only that the execution can be delayed, then i should let it optional.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 12-14-2010 , 13:00   Re: [Stock] Auto Exec Config File
Reply With Quote #14

Quote:
Originally Posted by ConnorMcLeod View Post
Your way only seem to set cvars, i want to send commands as well.
Ah yes, I missed that bit.
__________________
Brad is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 12-14-2010 , 18:34   Re: [Stock] Auto Exec Config File
Reply With Quote #15

Quote:
Originally Posted by ConnorMcLeod View Post
Your way only seem to set cvars, i want to send commands as well.
You can still do that.

Code:
new pointer = get_cvar_pointer(cvar) if(pointer) {     // do cvar stuff } else {     // send as command }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 12-14-2010 , 20:45   Re: [Stock] Auto Exec Config File
Reply With Quote #16

Quote:
Originally Posted by ConnorMcLeod View Post
I don't remember what is the problem when you don't send server_exec, if it is only that the execution can be delayed, then i should let it optional.
When you don't send it, you have no idea when your CVARs will be set. Thus, you read the config file and assume the CVARs are set, so you try to use them and WTFAPPLESAUCE they're not set. Using server_exec() forces the server to do it's thing and you don't get any WTFAPPLESAUCEs unless, you know... You suck at programming.
__________________
Brad is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 12-14-2010 , 21:30   Re: [Stock] Auto Exec Config File
Reply With Quote #17

Also, if you wanted support for checking commands, I wrote this stock awhile ago:

Code:
bool:servcmd_exists(const command[]) bool:clcmd_exists(const command[]) bool:concmd_exists(const command[]) bool:user_can_use_cmd(id, const command[]) bool:xcmd_exists(const command[], id=-1, required_flags=0)

Code:
#define servcmd_exists(%1) xcmd_exists(%1, 0) #define clcmd_exists(%1) xcmd_exists(%1, 1) #define concmd_exists(%1) xcmd_exists(%1) #define user_can_use_cmd(%1,%2) xcmd_exists(%2, %1, get_user_flags(%1)) stock bool:xcmd_exists(const command[], id=-1, const required_flags=0) {     new i, _command[32], flags     while(get_concmd(i++, _command, charsmax(_command), flags, "", 0, required_flags, id))     {         if(equali(command, _command))         {             return true         }     }     return false }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-15-2010 , 01:35   Re: [Stock] Auto Exec Config File
Reply With Quote #18

Quote:
Originally Posted by Brad View Post
When you don't send it, you have no idea when your CVARs will be set. Thus, you read the config file and assume the CVARs are set, so you try to use them and WTFAPPLESAUCE they're not set. Using server_exec() forces the server to do it's thing and you don't get any WTFAPPLESAUCEs unless, you know... You suck at programming.
That's why i could let the server_exec optional and disabled by default, so depending on what you put in your plugin, you can set that param ON.
amxx.cfg is executed at plugin_init without server_exec for example.
Also, anyone have an idea on what max can be that delay ?
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Seta00
The Seta00 user has crashed.
Join Date: Jan 2010
Location: Berlin
Old 12-15-2010 , 06:30   Re: [Stock] Auto Exec Config File
Reply With Quote #19

Quote:
Originally Posted by ConnorMcLeod View Post
Also, anyone have an idea on what max can be that delay ?
In time? 1/FPS seconds
Seta00 is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 12-18-2011 , 06:34   Re: [Stock] Auto Exec Config File
Reply With Quote #20

Want to bring this up, since this is pretty useful. What about Brads situation with seg fault, is that fixed now?

Good job on this.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
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 09:43.


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