Forum

> > CS2D > Scripts > Execute files
Forums overviewCS2D overview Scripts overviewLog in to reply

English Execute files

14 replies
To the start Previous 1 Next To the start

old Execute files

HESY
User Off Offline

Quote
I use the following code:
1
os.execute("C:\Counter-Strike 2D\CounterStrike2D.exe")
But it is not working. This possibility does not exist or am I doing wrong?

old Re: Execute files

GeoB99
Moderator Off Offline

Quote
I don't get your point by "necessary to use the downloaded files", could you please explain it better? Anyways, to make you clear, os.execute requires an operative system command in order to execute it or such. So, in this case this is what you should do:
1
os.execute("start C:\Counter-Strike 2D\CounterStrike2D.exe")
Yet I wouldn't recommend it though because of what user Yates said.
edited 1×, last 21.01.16 05:01:49 pm

old Re: Execute files

Yates
Reviewer Off Offline

Quote
Uh, CS2D does not have any client side Lua so trying to do this would be impossible. And even if CS2D supported client side Lua it would be blocked anyway.

inb4 Starkkz & FFI

Also, you can dump files into sys/servertransfer.lst

old Re: Execute files

HESY
User Off Offline

Quote
user GeoB99 has written
I don't get your point by "necessary to use the downloaded files", could you please explain it better? Anyways, to make you clear, os.execute requires an operative system command in order to execute it or such. So, in this case this is what you should do:
1
os.execute("start C:\Counter-Strike 2D\CounterStrike2D.exe")
Yet I wouldn't recommend it though because of what user Yates said.


Using downloaded skins weapons.

1
os.execute("start C:\Counter-Strike 2D\CounterStrike2D.exe")

It works. But if there is a space in the name, then an error "Folder not found" (a standard folder called "Counter-Strike 2D")
There was a question how to solve this? For example add & # 32, but this is not true.

old Re: Execute files

EngiN33R
Moderator Off Offline

Quote
If it doesn't work with a space then you should probably surround the executable path and name with quotes.

I still don't understand why you're doing this. You do know that Lua scripts are executed server-side, right? And that Lua scripts are not transferred to players.

old Re: Execute files

HESY
User Off Offline

Quote
@user EngiN33R: Oh damn! How could I not think about it.
Thank you.

Two more questions ..
1. Is it possible to start a game that connects directly to the server? For example like: cs2d://127.0.0.1:80000
2. How can I find a path to the folder with the game? (Because not all located in the 'Program Files')

My answer on my second question:
1
os.execute("start CounterStrike2D.exe")
Right?

old Re: Execute files

Yates
Reviewer Off Offline

Quote
Why are you trying to do this exactly?

You have told us nothing of what you fully want to accomplish by doing this. Right now everyone here believes the same, you are trying to start an extra CS2D for a player who connects to a server on join, which will not work on a dedicated server, by the way. Yet you pursue whatever you want to do, which makes me wonder if you are actually trying to do what we believe you are doing.

old Re: Execute files

GeoB99
Moderator Off Offline

Quote
user HESY has written
My answer on my second question:
1
os.execute("start CounterStrike2D.exe")
Right?

That won't work at all though. Yes, sure, you want to execute CS2D binary executable although you have not defined the path of it thus returning an error. It can be done through some methods. That's self explanatory really.

user HESY has written
Using downloaded skins weapons.

Could you rephrase that? If you're referring at transferring files such as sounds and images then it can be done through adding your files path to the servertransfer.lst file just as it was mentioned by user Yates already. Less hassle.

old Re: Execute files

HESY
User Off Offline

Quote
user Yates has written
Why are you trying to do this exactly?

You have told us nothing of what you fully want to accomplish by doing this. Right now everyone here believes the same, you are trying to start an extra CS2D for a player who connects to a server on join, which will not work on a dedicated server, by the way. Yet you pursue whatever you want to do, which makes me wonder if you are actually trying to do what we believe you are doing.


A month ago I had the idea to use a weapon skins like in CS Source (if you played it, it can be seen, and if not, then yes, there is a weapon skins (!) the truth of CS:GO) *It's plugin

I came up with the substitution of the system of game skins on their own, even created a thread in the forum (do not worry, when the player leaves the game files are replaced back to the standard), but in the process of writing the script, I was faced with the problem that the running game will not see these replaced files. So I decided to stop.

But now I had a new idea based on the previous one:
1. The player comes to the server by downloading transferlist skins (I do not know what you write to me about it, I'm well aware of that )
2. Writes data to a file server (server ip, port, downloadable skins)
3. The game window is closed and the third-party programs (Skin Manager) I wrote it on the PHP Devel Studio because of all the languages they know best (but if plans succeed to rewrite Delphi, because it's my quite complete performance)
Yes, in the writing of this commentary, I realized that you can just close/open (reopen?) the game, but in the Skin Manager I made a map previously recorded information about the server and loaded skins, as there can be restore standard (default) skins/make backup files if, for some reason, this is not done automatically.
4. The player chooses the way to the game, presses runes and (if you answer my previous question about whether you can start the game with the right to connect to the server), then pressing it connects to the server and plays the defined skins.
5. When leaving the game, all nourish the starting position.

Translation is terrible, I know, but I hope you understand what I mean.

For EngiN33R original russian translate:
Spoiler >


user GeoB99 has written
That won't work at all though. Yes, sure, you want to execute CS2D binary executable although you have not defined the path of it thus returning an error. It can be done through some methods. That's self explanatory really.


1
os.execute("start \"Launcher\" \"%cd%\\skins\\manager.exe\"")
(code worked)
Оон, I ran into a problem, I do not know why, probably not enough memory, but files can not be opened. I tried to open a plain text file - and it opened.
1
os.execute("start \"Launcher\" \"%cd%\\skins\"")
Also open...

upd:
Daaamn!
Serverlist comment:
Quote
Only images (bmp,jpg,jpeg,png) and sounds (wav,ogg) are allowed! Other files will be ignored!

My idea was again down the toilet
edited 4×, last 21.01.16 08:41:31 pm

old Re: Execute files

VADemon
User Off Offline

Quote
Readme.txt has written
How to use:

- Please extract/unzip or install before playing
- Run CounterStrike2D or Launcher to start the game
- Visit www.CS2D.com/faq if you have any problems

Command line parameters (order does not matter):

-full / -fullscreen (Run in full-screen mode)
-win / -windowed (Run in windowed mode [Default])
-dx / -directx (Use DirectX [Windows only])
-gl / -opengl (Use OpenGL)
-16bit (Use 16 bit colordepth)
-24bit (Use 24 bit colordepth)
-32bit (Use 32 bit colordepth)
-w X (Screen resolution width [Default: 640])
-h Y (Screen resolution height [Default: 480])
-noopenal (disable OpenAL audio drivers)
-j ADDRESS / -join ADDRESS (Join a server)
-pw PW / -password PW (join or host with this password)
-map MAP (Host with this map)
-name NAME (Host with this name)
-maxplayers MAXPL (Host with this max players amount)*
-port PORT (Host on this port)*
-rcon PW (Host with this remote control password)*
-lua LUAFILE (Host with this Lua file, relative to "sys/lua/"-folder)
-nointro (Don't show the intro sequence)
-sys PATH (Use alternative "sys"-folder for settings)
-path PATH (Use alternative working directory)**
-offline / -off (Offline mode, no U.S.G.N. connection)
-nocache (Never load the cached serverlist)
-realport (Use this if players are not able to join via serverlist)
-rconlua (Allow to execute Lua via RCon. WARNING! SECURITY RISK!)

*) setting will become unchangeable at runtime
**) new directory must contain all required CS2D files
ATTENTION: Do not use any whitespaces!
Use ? (question mark) instead of spaces (for paths etc)

Example Commandline:
CounterStrike2D.exe -map de_dust -pw SECRETPASS -win


Why don't you let the player browse through the serverlist himself? (unless you want to make this tool for your own server)

old Re: Execute files

Yates
Reviewer Off Offline

Quote
Quite a neat idea. But you're thinking way too hard, just let the user select the folder where the CS2D executable is located with your 3rd party program. No need to go looking when the user can tell you and you save it.

old Re: Execute files

ohaz
User Off Offline

Quote
Sorry, but when I go to a server, I don't want the server to place executables on my machine. I don't want the server to mess with my files. I don't want the server to start and stop tools.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview