Raised This Month: $ Target: $400
 0% 

changing download directory


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
mrksmn
Member
Join Date: Aug 2010
Old 12-27-2010 , 20:02   changing download directory
Reply With Quote #1

i have this mp3 player sma:

Code:
/* AMXX Mod script.
* __  __ ___ ____      _   __  _    
*|  \/  | _ \__ / __ _/ | /  \| |__ 
*| |\/| |  _/|_ \ \ V / || () | '_ \
*|_|  |_|_| |___/  \_/|_(_)__/|_.__/
*                                   
* MP3 v1.0Beta - Steam
* This file is provided as is (no warranties). 
* 
* Play MP3's on your clients.
* Usage:
* amx_playmp3 <mp3file> - Plays a MP3 file on the client
* amx_repeatmp3 <mp3file> - Repeats a MP3 file on the client
* amx_stopmp3 - Stop all MP3's
*
* The MP3 player will look for it's files in ModDir/sound/mp3
*
* IMPORTANT: You will need to remove the three lines above "public plugin_precache()"
* and the line under under } in that block to enable Precaching of MP3 files.
* (Not tested yet)
*
* There allready a few MP3's in your HL, which will be listed in the thread also.
* (No precache required at all) 
*/ 

#include <amxmodx> 
#include <amxmisc> 

public admin_playmp3(id,level,cid) {
   if (!cmd_access(id,level,cid,2)) 
      return PLUGIN_HANDLED 
   new mp3var[1024] 
   read_argv(1,mp3var,1023) 
   client_cmd(0,"echo ^"Playing MP3.. Type mp3 stop to stop it.^";mp3 play ^"%s^"",mp3var) 
   return PLUGIN_HANDLED 
}

public admin_loopmp3(id,level,cid) {
   if (!cmd_access(id,level,cid,2)) 
      return PLUGIN_HANDLED 
   new mp3loopvar[1024] 
   read_argv(1,mp3loopvar,1023) 
   client_cmd(0,"echo ^"Playing MP3 with Repeat on.. Type mp3 stop to stop it.^";mp3 loop ^"%s^"",mp3loopvar) 
   return PLUGIN_HANDLED 
}

public admin_stopmp3(id,level,cid) {
   client_cmd(0,"echo ^"MP3 disabled..^";mp3 stop")
   return PLUGIN_HANDLED 
}

public  plugin_precache ( ) 
{  
  precache_sound("mp3/techno.mp3")
  precache_sound("mp3/shake.mp3")
}

public plugin_init(){ 
   register_plugin("MP3","1.0b","DutchTiger") 
   register_concmd("amx_mp3","admin_playmp3",ADMIN_LEVEL_A,"mp3 - Play a MP3 on their computer")
   register_concmd("amx_repeatmp3","admin_loopmp3",ADMIN_LEVEL_A,"mp3 - Repeat a MP3 on their computer")
   register_concmd("amx_stopmp3","admin_stopmp3",ADMIN_LEVEL_A,"Stops ALL MP3 files playing.")
   return PLUGIN_CONTINUE
}
can i change the directory of sounds? i want to download in cstrike/music directory. i dont want download in cstrike/sound/mp3.

how can i change this code

Code:
public  plugin_precache ( ) 
{  
  precache_sound("mp3/techno.mp3")
  precache_sound("mp3/shake.mp3")
}
mrksmn is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-28-2010 , 01:42   Re: changing download directory
Reply With Quote #2

You can't. It must be in the sound directory. You can change it to /cstrike/sound/music/ by changing the "mp3" to "music".

See below.
__________________

Last edited by fysiks; 12-28-2010 at 20:22.
fysiks is offline
mrksmn
Member
Join Date: Aug 2010
Old 12-28-2010 , 10:58   Re: changing download directory
Reply With Quote #3

why :s

we can download in models directory with other plugins
mrksmn is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 12-28-2010 , 11:31   Re: changing download directory
Reply With Quote #4

What is the advantage of downloading in cstrike/music ?
I don't see why it would be better then cstrike/sound.
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
mrksmn
Member
Join Date: Aug 2010
Old 12-28-2010 , 12:44   Re: changing download directory
Reply With Quote #5

asking for learn scripting

Last edited by mrksmn; 12-28-2010 at 12:51.
mrksmn is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 12-28-2010 , 13:20   Re: changing download directory
Reply With Quote #6

Yes, it is possible.

You shouldn't be using precache_sound() for .mp3 files, because it is meant for .wav files.

Use precache_generic() and the directory defaults to cstrike/
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
mrksmn
Member
Join Date: Aug 2010
Old 12-28-2010 , 15:11   Re: changing download directory
Reply With Quote #7

Quote:
Originally Posted by Exolent[jNr] View Post
Yes, it is possible.

You shouldn't be using precache_sound() for .mp3 files, because it is meant for .wav files.

Use precache_generic() and the directory defaults to cstrike/
thank you master. why do you help me, why anyone help the others?
becouse they are good persons
mrksmn is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-28-2010 , 15:19   Re: changing download directory
Reply With Quote #8

As a side note, if precache_sound is used for mp3, downloadurl won't work for those sounds.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
mrksmn
Member
Join Date: Aug 2010
Old 12-28-2010 , 15:46   Re: changing download directory
Reply With Quote #9

it works..
can i ask 1 question more
can i delete any file in users folder, or can i replace any file in users folders, when files are different
mrksmn is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 12-28-2010 , 16:04   Re: changing download directory
Reply With Quote #10

No. AMXX cannot see client files.

However, you can use force_unmodified() so that players must have the same version of the file that's on the server.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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 15:18.


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