Raised This Month: $ Target: $400
 0% 

Running functions on mp_timelimit


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Sutar
Senior Member
Join Date: Sep 2010
Old 09-24-2012 , 10:15   Running functions on mp_timelimit
Reply With Quote #1

For example, I have a hard mp_timelimit = 20 in server.cfg

ow to make the launch map_times() in plagin After having passed the 19 mint on card?

PHP Code:
#include <amxmodx>

public plugin_init() 
{
    
register_plugin("Test""1.0""Author")
}

public 
map_times()
{
...

So I did so, like running, but as you see failures would not be?

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

public plugin_init()
{
    
register_plugin("Nextmap Chooser""1.5""Sutar")
    
set_task(1.0"time_maps");
}

public 
time_maps()
    
set_task((get_timeleft() - 60.0), "cmd");

public 
cmd()
    
client_print(0print_chat"Vote Change Map - Start."); 
Here's wanted to do so, but did not work ...

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

public plugin_init()
{
    
register_plugin("Nextmap Chooser""1.5""Sutar")
    
set_task((get_pcvar_float(get_cvar_pointer("mp_timelimit")) - 60.0), "cmd");
}

public 
cmd()
    
client_print(0print_chat"Vote Change Map - Start.");


Last edited by Sutar; 09-24-2012 at 10:22.
Sutar is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 09-24-2012 , 18:42   Re: Running functions on mp_timelimit
Reply With Quote #2

This is done in mapchooser.sma (It's for 129 seconds remaining; you would use 60). Look there to see how to do it.
__________________

Last edited by fysiks; 09-24-2012 at 18:42.
fysiks is offline
Sutar
Senior Member
Join Date: Sep 2010
Old 09-25-2012 , 10:00   Re: Running functions on mp_timelimit
Reply With Quote #3

I downloaded on the Internet, and in the script that I have, I can not understand how it works ...
Decided to write))
So I did this:

Quote:
#include <amxmodx>
#include <amxmisc>

public plugin_init()
{
register_plugin("Nextmap Chooser", "1.5", "Sutar")
set_task(1.0, "time_maps");
}

public time_maps()
{
set_task((get_timeleft() - 60.0), "cmd_say_rtvs");
}

public cmd_say_rtvs()
{
if(get_timeleft() <= 60)
client_print(0, print_chat, "Start vote...");
else
set_task(1.0, "time_maps");
}
I want to make just such a work, and if there is a script better - tweak me))

Map lasts 20 minutes.
Players lost her 19 minutes. and start voting.
I have a well as the plug-in, which prolongs the playing time, namely "mp_timelimit".

For example, players played 15 minutes (up to 4 minutes of the vote), I extended the map for 15 minutes. And it must be voted nachel after 19 minutes.
Ie if the card is left to the end of 1 minute.
Sutar is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 09-25-2012 , 19:59   Re: Running functions on mp_timelimit
Reply With Quote #4

Copied directly from mapchooser.sma (literally, hence why it is not spaced correctly, you should fix the spacing yourself).

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

public plugin_init()
{
        
set_task(15.0"voteNextmap"987456""0"b")
}
public 
voteNextmap()
{
        new 
timeleft get_timeleft()
        
        if (
timeleft || timeleft 129)
        {
        }

__________________
fysiks is offline
Sutar
Senior Member
Join Date: Sep 2010
Old 09-26-2012 , 02:25   Re: Running functions on mp_timelimit
Reply With Quote #5

Game server I have not one, and each of them, get_timeleft () is a different meaning.

And with such a script as you have, I failed to do so, so that when the end of the card remains 1 minute, start voting.

Offers can be so rude?

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

public plugin_init()
{
        set_task(19.0, "voteNextmap")
}

public voteNextmap()
{
        if (get_timeleft() <= 60) {
                //start vote
        } else {
               set_task((get_timeleft()-60), "voteNextmap") //If the time card has been extended...
        }
}

Last edited by Sutar; 09-26-2012 at 02:25.
Sutar is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 09-26-2012 , 20:05   Re: Running functions on mp_timelimit
Reply With Quote #6

  • Please speak in english. Nothing you just said makes any sense.
  • Your code is nothing like what I posted. If you aren't going to take suggestions then don't ask questions. All you have to do is change teh 129 to 60.
__________________
fysiks is offline
Sutar
Senior Member
Join Date: Sep 2010
Old 09-27-2012 , 02:11   Re: Running functions on mp_timelimit
Reply With Quote #7

Your code is sent every 15 minutes using a function. This means that the function will start at 15, 30, 45, 60 ... minutes.
And I need the function starts, when the end of the map remains 1 minute.

Quote:
Please speak in english. Nothing you just said makes any sense.
Sorry, I use google to translate. I just live in Europe)

Last edited by Sutar; 09-27-2012 at 02:12.
Sutar is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 09-27-2012 , 02:14   Re: Running functions on mp_timelimit
Reply With Quote #8

Quote:
Originally Posted by Sutar View Post
Your code is sent every 15 minutes using a function.
Actually, it is every 15 seconds
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Sutar
Senior Member
Join Date: Sep 2010
Old 09-27-2012 , 06:28   Re: Running functions on mp_timelimit
Reply With Quote #9

Then what is the best script?
It is best to check every 15 seconds? or check once in about 1293 seconds.
Sutar is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 09-27-2012 , 06:50   Re: Running functions on mp_timelimit
Reply With Quote #10

And what if somebody changes the timeleft mid-map? Or if the current map gets extended? How will you account for those situations? While 15 seconds may be a bit frequent, only checking it once opens your script up to errors
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou 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 08:15.


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