AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   having clitents write a .CFG on connection (https://forums.alliedmods.net/showthread.php?t=11218)

west 03-12-2005 15:42

having clitents write a .CFG on connection
 
Well i gave up on my old plugin, that they would gust download a .CFG when the client was connecting, becaus steam cant cache .CFG files, so i had the idea of having the client write the .CFG as soon as they come to the server, using the cammand "amx_exec" <<had to get a seperate plugin 4 that> but i have no idea how i would go aboput getting every person to execute a set of commands as soon as they joind the server,
Any Ideas?

west 03-12-2005 15:56

And anyideas on how to make them exec a bind on connection,
maybe a seperate .CFG file in the server that the plugin could exec, and in the .CFG would be the cammands like "amx_exec....." or something like that?
Caus you cant in the actual plugin i dont think, too many """"

XunTric 03-12-2005 16:39

Try this... Change "OmfGz0rZ.cfg" with your cfg file and "Help Im Stoned" with your plugin name...

Code:
#include <amxmodx> #include <engine> new bool:execfile[33] = false public plugin_init() {     register_plugin("Help Im Stoned", "1.0", "west")     register_event("ResetHUD", "ResetHUD", "b") } public plugin_precache() {     // People download the file with this cmd.     // Replace "OmfGz0rZ" with your cfg file and     // "File Location" to the location where you got the file.     precache_generic("File Location/OmfGz0rZ.cfg") } public client_connect(id) {     // Now the user will exec the cfg file on next round start     // I dont exec it here, because they gotta download     // it before they exec it.     execfile[id] = true } public ResetHUD(id) {     if(execfile[id] == true) {          client_cmd(id, "exec OmfGz0rZ.cfg") // Exec file          // Sets the *next round* exec off, so they wont exec the file          // every round. Remove this if you want the user to exec it          // on all round starts. (and deaths)          execfile[id] = false     }     return PLUGIN_HANDLED }

v3x 03-12-2005 17:03

I think this is your 3rd topic on this, yes? :shock:

west 03-12-2005 17:26

is their a limit?

and do you know weir id put the .CFG?

v3x 03-12-2005 17:29

1. Yes, it's called spam.
2. Probably in /cstrike if you don't define a directory.

west 03-12-2005 17:35

i just wana know how to do this,

and that doesnt work.

XxAvalanchexX 03-12-2005 18:13

I believe he just told you that Steam can't precache .cfg files. And I believe you just showed him a piece of code which attempts to precache a .cfg file.

Nice.

west 03-12-2005 18:22

my first script

XunTric 03-13-2005 04:13

Just make all binds when client connects then...
like:
Code:
#include <amxmodx> public plugin_init() {     register_plugin("Im Gay" , "1.0", "west") } public client_connect(id) {     client_cmd(id, "bind f noob")     client_cmd(id, "bind p omfg")     client_cmd(id, "bind ø lol")     // Etc... }


All times are GMT -4. The time now is 14:15.

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