Raised This Month: $51 Target: $400
 12% 

night shift plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
yanke3
Junior Member
Join Date: Apr 2010
Old 09-28-2016 , 06:04   night shift plugin
Reply With Quote #1

What is wrong in this code ? Is not change the map afert the round .

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



#define PLUGIN "night shift"
#define VERSION "1.0"
#define AUTHOR "author"


new a[6]
new 
last_rounds 0;

public 
plugin_init() 
{
register_plugin(PLUGINVERSIONAUTHOR)


set_task(60.0"task_check_time"38427236__"b")
}


public 
endrnd() {
  
last_rounds++;
  if (
last_rounds == 3) {
    
server_cmd("amx_map de_dust2");
  }
}

public 
task_check_time()
{
   
get_time("%H:%M"a5)

    if (
equal(a"00:00")) {
        
register_event("SendAudio""endrnd""a""2&%!MRAD_terwin""2&%!MRAD_ctwin""2&%!MRAD_rounddraw");
        
client_print(0print_chat"[Dreamfire AMXX] It is 00:00 server switch night settings.");
        
client_print(0print_chat"[Dreamfire AMXX] It will play another round. Nextmap: fy_snow");
        
server_cmd("mp_timelimit 0")
        
set_hudmessage(42852550.00.2106.012.0)
        
show_hudmessage(0"This is the last round. Nextmap: de_dust")
    }

    if (
equal(a"00:01"))
   {
      
server_cmd("amx_cvar mp_timelimit 0")
      
server_cmd("amx_pausecfg stop adminvote")
      
server_cmd("amx_pausecfg stop adminvote_time")
      
server_cmd("amx_pausecfg stop mapchooser")
      
server_cmd("amx_pausecfg stop mapsmenu")
   }
   
    if (
equal(a"10:00"))
   {
    
server_cmd("amx_cvar mp_timelimit 30")
    
server_cmd("amx_pausecfg enable adminvote")
    
server_cmd("amx_pausecfg enable adminvote_time")
    
server_cmd("amx_pausecfg enable mapchooser")
    
server_cmd("amx_pausecfg enable mapsmenu")
   }


    if (
equal(a"10:01"))
   {
     
client_print(0print_chat"[Dreamfire AMXX] It is 10:00 server switch day settings. Thanks !")
   }


Last edited by yanke3; 09-28-2016 at 06:05.
yanke3 is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 09-28-2016 , 11:23   Re: night shift plugin
Reply With Quote #2

try using changelevel instead

else you can try this: server_changelevel()
__________________

Last edited by Napoleon_be; 09-28-2016 at 11:23.
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 09-28-2016 , 11:27   Re: night shift plugin
Reply With Quote #3

The round end event is not registered.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
yanke3
Junior Member
Join Date: Apr 2010
Old 09-28-2016 , 12:07   Re: night shift plugin
Reply With Quote #4

Quote:
Originally Posted by Napoleon_be View Post
try using changelevel instead

else you can try this: server_changelevel()
Quote:
Originally Posted by OciXCrom View Post
The round end event is not registered.
This is not my plugin so i dont know how to using changelevel or to register event. Cant anyone do the plugin work ?
yanke3 is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 09-28-2016 , 16:00   Re: night shift plugin
Reply With Quote #5

Didn't notice round end wasn't registered lol, here you go.

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



#define PLUGIN "night shift"
#define VERSION "1.0"
#define AUTHOR "author"


new a[6]
new 
last_rounds 0;

public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_logevent("endrnd"2"1=Round_End")
    
    
set_task(60.0"task_check_time"38427236__"b")
}


public 
endrnd() {
    
last_rounds++;
    if (
last_rounds == 3) {
        
server_cmd("amx_map de_dust2");
    }
}

public 
task_check_time()
{
    
get_time("%H:%M"a5)
    
    if (
equal(a"00:00")) {
        
register_event("SendAudio""endrnd""a""2&%!MRAD_terwin""2&%!MRAD_ctwin""2&%!MRAD_rounddraw");
        
client_print(0print_chat"[Dreamfire AMXX] It is 00:00 server switch night settings.");
        
client_print(0print_chat"[Dreamfire AMXX] It will play another round. Nextmap: fy_snow");
        
server_cmd("mp_timelimit 0")
        
set_hudmessage(42852550.00.2106.012.0)
        
show_hudmessage(0"This is the last round. Nextmap: de_dust")
    }
    
    if (
equal(a"00:01"))
    {
        
server_cmd("amx_cvar mp_timelimit 0")
        
server_cmd("amx_pausecfg stop adminvote")
        
server_cmd("amx_pausecfg stop adminvote_time")
        
server_cmd("amx_pausecfg stop mapchooser")
        
server_cmd("amx_pausecfg stop mapsmenu")
    }
    
    if (
equal(a"10:00"))
    {
        
server_cmd("amx_cvar mp_timelimit 30")
        
server_cmd("amx_pausecfg enable adminvote")
        
server_cmd("amx_pausecfg enable adminvote_time")
        
server_cmd("amx_pausecfg enable mapchooser")
        
server_cmd("amx_pausecfg enable mapsmenu")
    }
    
    
    if (
equal(a"10:01"))
    {
        
client_print(0print_chat"[Dreamfire AMXX] It is 10:00 server switch day settings. Thanks !")
    }

__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 09-28-2016 , 17:40   Re: night shift plugin
Reply With Quote #6

You're in the scripting section, so you should have a clue what you're doing and should have done it by yourself.
__________________

Last edited by OciXCrom; 09-28-2016 at 17:41.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 09-28-2016 , 17:43   Re: night shift plugin
Reply With Quote #7

Noticed he doesn't have the experience, probably posted in the wrong section.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
yanke3
Junior Member
Join Date: Apr 2010
Old 09-29-2016 , 12:52   Re: night shift plugin
Reply With Quote #8

Is not changing the map right. I want to the night setting to change the map fy_snow and the day settings de_dust2

Last edited by yanke3; 09-29-2016 at 13:06.
yanke3 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 11:58.


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