Raised This Month: $ Target: $400
 0% 

Last round?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Bilal Pro
Senior Member
Join Date: Mar 2012
Location: Holland
Old 05-13-2012 , 08:44   Last round?
Reply With Quote #1

Hey there,

How will i find out what round is the last round?
__________________
  • Point System with rank titles for sale [X] [100% private]
  • VIP Menu for sale [X] [100% private]
  • HnS shop more features for sale [X] [100% private]
Contact: Bilalzaandam1234, on steam if you are interested.
Bilal Pro is offline
Bilal Pro
Senior Member
Join Date: Mar 2012
Location: Holland
Old 05-13-2012 , 08:56   Re: Last round?
Reply With Quote #2

Would this work for example:
PHP Code:
test get_timeleft()

if (
test <= 60)
{
    
client_print(0print_center"This is the last minute of the map!")

__________________
  • Point System with rank titles for sale [X] [100% private]
  • VIP Menu for sale [X] [100% private]
  • HnS shop more features for sale [X] [100% private]
Contact: Bilalzaandam1234, on steam if you are interested.
Bilal Pro is offline
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 05-13-2012 , 09:02   Re: Last round?
Reply With Quote #3

Test by yourself.
__________________
You can do anything you set your mind to, man.

Devil259 is offline
Bilal Pro
Senior Member
Join Date: Mar 2012
Location: Holland
Old 05-13-2012 , 09:18   Re: Last round?
Reply With Quote #4

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

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Mapbuild Vote"
#define VERSION "1.0"
#define AUTHOR "Bilal"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
set_task(1.0"CheckTimeleft"_,_,_"b")
}

public 
CheckTimeleft(id)
{
    new 
test get_timeleft()
    
    if (
test <= 60)
    {
        
CmdMenu(id)
    }
    return 
PLUGIN_CONTINUE
}

public 
CmdMenu(id)
{
    new 
menu menu_create("\yRate this map:""Menuhandler")
    
    
menu_additem(menu"Excellent""1")
    
menu_additem(menu"Good""2")
    
menu_additem(menu"Regular""3")
    
menu_additem(menu"Terrible""4")
    
    
menu_setprop(menuMPROP_EXITMEXIT_ALL)
    
menu_display(idmenu0)
}

public 
Menuhandler(idmenuitem)
{
    if (
item == MENU_EXIT)
    {
        
menu_destroy(menu)
        return 
PLUGIN_HANDLED
    
}
    
    new 
data[6], name[64], accescallback
    menu_item_getinfo
(menuitem ,accesdatacharsmax(data), namecharsmax(name), callback)
    new 
key str_to_num(data)
    
    switch (
key)
    {
        case 
1client_print(idprint_center"Thank you for your vote!")
            case 
2client_print(idprint_center"Thank you for your vote!")
            case 
3client_print(idprint_center"Thank you for your vote!")
            case 
4client_print(idprint_center"Thank you for your vote!")
        }
    return 
PLUGIN_HANDLED

Server is crashing when theres 1 minute left
__________________
  • Point System with rank titles for sale [X] [100% private]
  • VIP Menu for sale [X] [100% private]
  • HnS shop more features for sale [X] [100% private]
Contact: Bilalzaandam1234, on steam if you are interested.
Bilal Pro is offline
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 05-13-2012 , 09:23   Re: Last round?
Reply With Quote #5

Check that at round start.

Also, you can use this: http://forums.alliedmods.net/showthread.php?p=758905
__________________
<VeCo> is offline
Bilal Pro
Senior Member
Join Date: Mar 2012
Location: Holland
Old 05-13-2012 , 09:31   Re: Last round?
Reply With Quote #6

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

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Mapbuild Vote"
#define VERSION "1.0"
#define AUTHOR "Bilal"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_logevent("RoundStart"2"1=Round_Start")
}

public 
RoundStart()
{
    
set_task(1.0"CheckTimeleft"_,_,_"b")
}

public 
CheckTimeleft(id)
{
    new 
test get_timeleft()
    
    if (
test <= 60)
    {
        
CmdMenu(id)
    }
    return 
PLUGIN_CONTINUE
}

public 
CmdMenu(id)
{
    new 
menu menu_create("\yRate this map:""Menuhandler")
    
    
menu_additem(menu"Excellent""1")
    
menu_additem(menu"Good""2")
    
menu_additem(menu"Regular""3")
    
menu_additem(menu"Terrible""4")
    
    
menu_setprop(menuMPROP_EXITMEXIT_ALL)
    
menu_display(idmenu0)
}

public 
Menuhandler(idmenuitem)
{
    if (
item == MENU_EXIT)
    {
        
menu_destroy(menu)
        return 
PLUGIN_HANDLED
    
}
    
    new 
data[6], name[64], accescallback
    menu_item_getinfo
(menuitem ,accesdatacharsmax(data), namecharsmax(name), callback)
    new 
key str_to_num(data)
    
    switch (
key)
    {
        case 
1client_print(idprint_center"Thank you for your vote!")
            case 
2client_print(idprint_center"Thank you for your vote!")
            case 
3client_print(idprint_center"Thank you for your vote!")
            case 
4client_print(idprint_center"Thank you for your vote!")
        }
    return 
PLUGIN_HANDLED

Crash message: MSG_ONE or MSG_ONEUNRELIABLE with no target entity
__________________
  • Point System with rank titles for sale [X] [100% private]
  • VIP Menu for sale [X] [100% private]
  • HnS shop more features for sale [X] [100% private]
Contact: Bilalzaandam1234, on steam if you are interested.
Bilal Pro is offline
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 05-13-2012 , 09:32   Re: Last round?
Reply With Quote #7

You don't need a task. Use a loop to show the menu to all players.
__________________

Last edited by <VeCo>; 05-13-2012 at 09:32.
<VeCo> is offline
Bilal Pro
Senior Member
Join Date: Mar 2012
Location: Holland
Old 05-13-2012 , 09:35   Re: Last round?
Reply With Quote #8

Now i've tryed this.

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

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Mapbuild Vote"
#define VERSION "1.0"
#define AUTHOR "Bilal"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
set_task(1.0"CheckTimeleft"_,_,_"b")
}

public 
CheckTimeleft()
{
    new 
players[32], iNum
    get_players
(playersiNum"ch")
    new 
test get_timeleft()
    
    for (new 
i<iNumi++)
    {
        if (
test <= 60)
        {
            
CmdMenu(players[i])
        }
    }
    return 
PLUGIN_CONTINUE
}

public 
CmdMenu(id)
{
    new 
menu menu_create("\yRate this map:""Menuhandler")
    
    
menu_additem(menu"Excellent""1")
    
menu_additem(menu"Good""2")
    
menu_additem(menu"Regular""3")
    
menu_additem(menu"Terrible""4")
    
    
menu_setprop(menuMPROP_EXITMEXIT_ALL)
    
menu_display(idmenu0)
}

public 
Menuhandler(idmenuitem)
{
    if (
item == MENU_EXIT)
    {
        
menu_destroy(menu)
        return 
PLUGIN_HANDLED
    
}
    
    new 
data[6], name[64], accescallback
    menu_item_getinfo
(menuitem ,accesdatacharsmax(data), namecharsmax(name), callback)
    new 
key str_to_num(data)
    
    switch (
key)
    {
        case 
1client_print(idprint_center"Thank you for your vote!")
            case 
2client_print(idprint_center"Thank you for your vote!")
            case 
3client_print(idprint_center"Thank you for your vote!")
            case 
4client_print(idprint_center"Thank you for your vote!")
        }
    return 
PLUGIN_HANDLED

Doesn't show the menu, but the crash is fixed

EDIT: solved
__________________
  • Point System with rank titles for sale [X] [100% private]
  • VIP Menu for sale [X] [100% private]
  • HnS shop more features for sale [X] [100% private]
Contact: Bilalzaandam1234, on steam if you are interested.

Last edited by Bilal Pro; 05-13-2012 at 09:39.
Bilal Pro is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 05-13-2012 , 10:07   Re: Last round?
Reply With Quote #9

Instead of printing every message at your cases, delete the switch and just print it once instead of 4 times.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Bilal Pro
Senior Member
Join Date: Mar 2012
Location: Holland
Old 05-13-2012 , 10:56   Re: Last round?
Reply With Quote #10

Thanks
__________________
  • Point System with rank titles for sale [X] [100% private]
  • VIP Menu for sale [X] [100% private]
  • HnS shop more features for sale [X] [100% private]
Contact: Bilalzaandam1234, on steam if you are interested.
Bilal Pro is offline
Reply


Thread Tools
Display Modes

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 00:19.


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