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

[req] Triple server restart


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
khashayar007
Senior Member
Join Date: Jan 2015
Location: Macedonia
Old 10-19-2016 , 07:54   [req] Triple server restart
Reply With Quote #1

Hi. I need a code when a player type /l server restarts round 3 times

Last edited by khashayar007; 10-19-2016 at 08:02.
khashayar007 is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 10-19-2016 , 08:08   Re: [req] Triple server restart
Reply With Quote #2

Untested

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Restart Round"
#define VERSION "1.0"
#define AUTHOR "NapoleoN#"

new iRestarts

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say /l""CmdRestart")
}

public 
CmdRestart(id) {
    if(!(
get_user_flags(id) & ADMIN_BAN)) {
        return 
PLUGIN_HANDLED
    
}
    
    if(
iRestarts == 3) {
        
iRestarts 0
    
}
    
    else {
        
server_cmd("sv_restartround 1")
        
set_task(1.0"CmdRestart"id)
        
iRestarts++
    }
    return 
PLUGIN_HANDLED

__________________

Last edited by Napoleon_be; 10-19-2016 at 08:08.
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
khashayar007
Senior Member
Join Date: Jan 2015
Location: Macedonia
Old 10-20-2016 , 04:00   Re: [req] Triple server restart
Reply With Quote #3

You set sv_roundrestart 1 for all 3 restarts but I want server to set sv_roundrestart 1 for the first restart then sv_roundrestart 2 for the second restart and sv_roundrestart 3 for the last restart.

Last edited by khashayar007; 10-20-2016 at 04:01.
khashayar007 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 10-20-2016 , 08:40   Re: [req] Triple server restart
Reply With Quote #4

Quote:
Originally Posted by khashayar007 View Post
You set sv_roundrestart 1 for all 3 restarts but I want server to set sv_roundrestart 1 for the first restart then sv_roundrestart 2 for the second restart and sv_roundrestart 3 for the last restart.
He did it exactly like you said in the first post.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 10-20-2016 , 10:42   Re: [req] Triple server restart
Reply With Quote #5

untested
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Restart Round"
#define VERSION "1.0"
#define AUTHOR "NapoleoN#"

new iRestarts

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say /l""CmdRestart")
}

public 
CmdRestart(id) {
    if(!(
get_user_flags(id) & ADMIN_BAN)) {
        return 
PLUGIN_HANDLED
    
}
    
    switch(
iRestarts) {
        case 
0: {
            
iRestarts++
            
server_cmd("sv_restartround 1")
            
set_task(1.0"CmdRestart"id)
        }
        case 
1: {
            
iRestarts++
            
server_cmd("sv_restartround 2")
            
set_task(2.0"CmdRestart"id)
        }
        case 
2: {
            
iRestarts++
            
server_cmd("sv_restartround 3")
            
set_task(3.0"CmdRestart"id)
        }
        case 
3: {
            
iRestarts 0
        
}
    }
    return 
PLUGIN_HANDLED

__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
khashayar007
Senior Member
Join Date: Jan 2015
Location: Macedonia
Old 10-20-2016 , 11:51   Re: [req] Triple server restart
Reply With Quote #6

Thank you so much Napoleon_be
khashayar007 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 16:03.


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