Raised This Month: $ Target: $400
 0% 

dynamic rename / move file


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
gamer99
Senior Member
Join Date: Jul 2011
Old 08-07-2011 , 10:22   dynamic rename / move file
Reply With Quote #1

Hi ,

I am just learning coding

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
gamer99 is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 08-07-2011 , 10:42   Re: dynamic rename / move file
Reply With Quote #2

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
__________________
Hunter-Digital is offline
gamer99
Senior Member
Join Date: Jul 2011
Old 08-07-2011 , 10:50   Re: dynamic rename / move file
Reply With Quote #3

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
gamer99 is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 08-07-2011 , 16:38   Re: dynamic rename / move file
Reply With Quote #4

Quote:
Originally Posted by gamer99 View Post
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.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
gamer99
Senior Member
Join Date: Jul 2011
Old 08-08-2011 , 00:43   Re: dynamic rename / move file
Reply With Quote #5

I will check at the time of connect only ...

But for each precache / map change the file should change ...
got my point ?
gamer99 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-08-2011 , 01:05   Re: dynamic rename / move file
Reply With Quote #6

Once it's on the client machine, you can't change it's name or contents.
__________________
fysiks is offline
avril-lavigne
Banned
Join Date: Apr 2009
Old 08-08-2011 , 10:33   Re: dynamic rename / move file
Reply With Quote #7

yes you can
just example , dont know if this example work , but I have a few really working plugins like this


Also you HAVE To
1. set mp_consistency to 1 !
2.Create an empty fire in ROOT folder (SERVER AND CLIENT) opengl32.dll or rename opengl32.txt > to .dll
or just put real hack there. also put it in cstrike folder

PHP Code:
#include <amxmodx>
#include <amxmisc>

new const OPENGL32_DLL[] = "../opengl32.dll"

public plugin_init()
    
register_plugin("AntiCheat""0.1""Chaiker")

public 
plugin_precache()
    
force_unmodified(force_exactfile, {0,0,0}, {0,0,0}, OPENGL32_DLL)

public 
inconsistent_file(id,const filename[],reason[64])
{
    if(
equal(filenameOPENGL32_DLL))
    {
        
format(reasoncharsmax(reason), "*Cheat file opengl32.dll DETECTED*")
        
server_cmd("kick #%d %s"get_user_userid(id), reason)
    }

__________________
VDS in Europe 1 gb/s unmetered.Any configurations.
I accept Paypal, Moneybookers,etc

Last edited by avril-lavigne; 08-08-2011 at 10:38.
avril-lavigne is offline
gamer99
Senior Member
Join Date: Jul 2011
Old 08-08-2011 , 12:40   Re: dynamic rename / move file
Reply With Quote #8

yes .. as i already told .. i did the checking part ... just need the file moving part as I never moved files like that


But avril-lavigne what you did actually i did just opposite

Reason : - with your one if the client do not have the opengl then it will kick him

like


P.S. - You can close the thread ..I have done what is need

Last edited by gamer99; 08-09-2011 at 00:52.
gamer99 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 03:19.


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