AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   dynamic rename / move file (https://forums.alliedmods.net/showthread.php?t=164102)

gamer99 08-07-2011 10:22

dynamic rename / move file
 
Hi ,

I am just learning coding :oops:

Need one help .

suppose I have one directory

../sound/misc/custom/001.wav
../sound/misc/custom/002.wav
../sound/misc/custom/003.wav

it can be any but the sequence have to be a continuous sequence .

Now at the time of plugin_init

1) i need to put one random file to the folder misc and also after renaming it to fun .
../sound/misc/fun.wav

how can I do that ..it's for learning nothing else :)

Hunter-Digital 08-07-2011 10:42

Re: dynamic rename / move file
 
If you're talking about putting files on clients, it's impossible to place a different structure than the files precached, you can precache files in plugin_precache() with precache_*() functions.

But if you're talking about renaming and moving files on the server, see file.inc or http://www.amxmodx.org/funcwiki.php?go=inc&id=3

gamer99 08-07-2011 10:50

Re: dynamic rename / move file
 
okie .. actually i was trying to create one opengl detector ...

in such plugin

file will be there in a folder with sequence name like 001.dll / 002.dll

And at each round start randomly one file will be copied to ../opengl.dll

and server will check if the exact file exists on client .. if exists then kick :)

I have done the part where checking is done but not able to dynamic moving prt :(

Exolent[jNr] 08-07-2011 16:38

Re: dynamic rename / move file
 
Quote:

Originally Posted by gamer99 (Post 1527607)
And at each round start randomly one file will be copied to ../opengl.dll

and server will check if the exact file exists on client .. if exists then kick :)

Not possible. You can only precache the file at map start and force players to get the file before they are in the server.

Not possible. AMXX cannot see client-side files.

gamer99 08-08-2011 00:43

Re: dynamic rename / move file
 
I will check at the time of connect only ...

But for each precache / map change the file should change ...
got my point ?

fysiks 08-08-2011 01:05

Re: dynamic rename / move file
 
Once it's on the client machine, you can't change it's name or contents.

gamer99 08-08-2011 03:03

Re: dynamic rename / move file
 
Quote:

Originally Posted by fysiks (Post 1527990)
Once it's on the client machine, you can't change it's name or contents.

Okie .. seems like there is some confusion

Lemme explain

1) I have some opengl hack which we have to place in the counter strike installation folder in order to enable the hack . Now my main aim is to detect some of them

Detection logic .

1) I will have one folder in server ../opengl/
In that i will place all the opengl hack .
e.g. assume the name is 001.dll , 002.dll .........


2) Now at the time of map change i will select any one of the opengl (lets assume we have taken 002.dll) and will put it in the HLDS directory with name openg32l.dll ( so we need to move 002.dll to the base folder and have to rename it too opengl32.dll)

3) Now when client will connect I will check whether

  • client have any opengl -- if he dnt have then no prob is there .
  • If he have some opengl then i will check exact file with the opengl of the server's base directory . If its matching then punish him . If not matching don't do anything and let him play .

fysiks 08-08-2011 08:06

Re: dynamic rename / move file
 
Well, if it's client-side then you need to find another website to ask because this forum is for server-side scripting.

gamer99 08-08-2011 08:19

Re: dynamic rename / move file
 
Quote:

Originally Posted by fysiks (Post 1528124)
Well, if it's client-side then you need to find another website to ask because this forum is for server-side scripting.

it's not client side ....
It will not do any changes in client side ....

I think you are not getting my explanation ( may be I am a noob to make people understand my need :P)

fysiks 08-08-2011 08:23

Re: dynamic rename / move file
 
I don't understand how openGL has anything to do with the server. It's a client-side application. But, since you are seemingly hacking clients then maybe you should just stop asking here.

Anyways, all file modification functions are in the link in post #2.


All times are GMT -4. The time now is 03:19.

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