Raised This Month: $ Target: $400
 0% 

[Req]Adding server_cmd(s)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Smoke123
Member
Join Date: Jul 2006
Old 09-08-2015 , 19:09   [Req]Adding server_cmd(s)
Reply With Quote #1

I need help adding server_cmd to this then allowing it to read off the server.cfg once the round actually starts. I'm no coder, but i promise you I did try but to no avail without errors.

A 35s Timer (instead of 60)
mp_footsteps set to 0
sv_maxspeed to 600
HALF-LiFE mp3's on diffrent maps changes instead of one "warm-up/mp3"

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <dhudmessage>
#include <hamsandwich>
#include <fun>
 
new TimerSecondsCvar
new bool:g_knife true
 
public plugin_init()
{
    
register_plugin"Auto rr" "1.0""ill" )
    
    
register_event("DeathMsg""on_death""a")
    
register_event"CurWeapon""EventCurWeapon""be""2!29" )
    
   
RegisterHam(Ham_Spawn"player""fw_PlayerSpawn_Post"1)
    
    
SecondsCvar register_cvar("auto_rr_time","35")
 
    
Timer get_pcvar_num(SecondsCvar)
    
set_task(1.0"start_rr_timer"___"a"Timer)
}
 
public 
plugin_precache()
{
   
precache_sound("misc/warmup.mp3")
}
 
public 
fw_PlayerSpawn_Post(id)
{
   if(!
is_user_alive(id))
        return
       
   if(
g_knife)
      
set_user_health(id55)
}
 
public 
on_death()
{
   new 
victim
   victim 
read_data(2)
    
   if(
g_knife)
      
set_task(1.0"fnRevivePlayer"victim)
}
 
public 
client_putinserver(id)
{
   if(
g_knife)
      
set_task(3.0"Start_sound"id)
}
 
public 
Start_sound(id)
{
   if(
g_knife)
   {
      
client_cmd(id"mp3 play sound/misc/warmup.mp3")
      if(!
is_user_alive(id) && (get_user_team(id) == || get_user_team(id) == 2) ) 
         
ExecuteHamB(Ham_CS_RoundRespawnid)
   }
}
 
public 
fnRevivePlayer(id
{
   if(!
is_user_alive(id)) 
      
ExecuteHamB(Ham_CS_RoundRespawnid)
      
}
 
public 
EventCurWeapon(id)
{
   if(
g_knife
      
engclient_cmd(id"weapon_knife");


}
 
public 
start_rr_timer()
{
    
Timer--
     
    
set_dhudmessage(135206235, -1.00.0800.00.01)
    
show_dhudmessage(0"Players are Connecting.....^nServer will restart in %d seconds"Timer)
 
    if(
Timer 1)
    {
      
server_cmd("sv_restartround 1")
      
set_task(3.0"rr_end")
      
client_cmd(0"mp3 stop");
      
g_knife false
    
}
}
 
public 
rr_end()
{
    
set_dhudmessagerandom_num(0255), random_num(0255), random_num(0255), -1.00.7826.03.00.11.5false )
    
show_dhudmessage(0"Good Luck & Enjoy the Server!")


Last edited by Smoke123; 09-10-2015 at 16:16.
Smoke123 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 09-08-2015 , 19:51   Re: [Req]Adding server_cmd(s)
Reply With Quote #2

Quote:
Originally Posted by Smoke123 View Post
adding server_cmd to this then allowing it to read off the server.cfg
What does that mean?
__________________
fysiks is offline
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 09-09-2015 , 06:31   Re: [Req]Adding server_cmd(s)
Reply With Quote #3

I think, you talk about plugin_cfg? To set cmds?
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
Smoke123
Member
Join Date: Jul 2006
Old 09-10-2015 , 16:04   Re: [Req]Adding server_cmd(s)
Reply With Quote #4

PHP Code:
public plugin_precache()
{
   
precache_sound("misc/warmup.mp3")
}
 
public 
fw_PlayerSpawn_Post(id)
{
  [
B] if(!is_user_alive(id))
        return
        
server_cmd ("mp_footsteps 0")
        
server_cmd("sv_max_speed 600")
        
server_cmd("sv_gravity 200"[/B]
       
   if(
g_knife)
      
set_user_health(id55)
}
 
]if(
Timer 1
    { 
      
server_cmd("sv_restartround 1")
      
server_cmd ("mp_footsteps 1")  //default
      
server_cmd("sv_max_speed 320"//default
       
server_cmd("sv_gravity 800"//default[/B]
      
set_task(3.0"rr_end"
      
client_cmd(0"mp3 stop"); 
      
g_knife false 
Sorry i had no clue that i posted this..thought i closed out the browser before actually posting this so this may be in the wrong forum (sorry Mods)

Let me retry my [REQ] basically I'd like to have a 35 sec. knife/fun server mode along with the precache of the 17 diffrent Half-Life.mp3's that play diffrent every new map change before the actual round start with the above cvars (Please see 1st posting). then allow the server to return to normal once the 35s are up (auto_rr). Hopefully you can understand me. Please see the above snippet of code of my lame attempt to be a CS coder...lol. I know for a fact i did fix the 35 secs (auto_rr) instead of the 60

Thank you for taking time to read this!

MODS feel free to move to scripting forum if needed
__________________

Last edited by Smoke123; 09-10-2015 at 17:07.
Smoke123 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 09-10-2015 , 21:01   Re: [Req]Adding server_cmd(s)
Reply With Quote #5

You should replace all those server_cmd() functions with set_cvar_num().
__________________
fysiks 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 21:29.


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