Raised This Month: $32 Target: $400
 8% 

how could do vote in menu ?


Post New Thread Reply   
 
Thread Tools Display Modes
undead52
Senior Member
Join Date: Dec 2016
Old 11-21-2017 , 16:11   Re: how could do vote in menu ?
Reply With Quote #11

after mapchange i wanna show this menu
undead52 is offline
KiLLeR.
Senior Member
Join Date: Jul 2014
Location: Bulgaria
Old 11-21-2017 , 16:33   Re: how could do vote in menu ?
Reply With Quote #12

Quote:
Originally Posted by undead52 View Post
after mapchange i wanna show this menu
set task for 5-10 seconds on client_putinserver then.
KiLLeR. is offline
undead52
Senior Member
Join Date: Dec 2016
Old 11-21-2017 , 16:43   Re: how could do vote in menu ?
Reply With Quote #13

Quote:
Originally Posted by KiLLeR. View Post
set task for 5-10 seconds on client_putinserver then.
doesnt it work for every people join ?
undead52 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 11-21-2017 , 20:55   Re: how could do vote in menu ?
Reply With Quote #14

You should try it and see what happens. client_putinserver() is called for every player when they enter the server.
__________________
fysiks is offline
TheWhitesmith
Senior Member
Join Date: Oct 2017
Location: Morocco :c
Old 11-22-2017 , 09:38   Re: how could do vote in menu ?
Reply With Quote #15

Players can vote 1 minute after mapchange, i'd suggest to set it lower so that players can't retry connection to vote multiple times

PHP Code:
new bool:g_bCanVote


public plugin_init() {
    
g_bCanVote true
    set_task
(60.0"reset_voting")
}

public 
client_putinserver(id) {
    if(
g_bCanVote)
        
set_task(5.0"vote_menu"id)
}

public 
reset_voting() {
    
g_bCanVote false

TheWhitesmith is offline
undead52
Senior Member
Join Date: Dec 2016
Old 11-22-2017 , 11:47   Re: how could do vote in menu ?
Reply With Quote #16

Quote:
Originally Posted by TheWhitesmith View Post
Players can vote 1 minute after mapchange, i'd suggest to set it lower so that players can't retry connection to vote multiple times

PHP Code:
new bool:g_bCanVote


public plugin_init() {
    
g_bCanVote true
    set_task
(60.0"reset_voting")
}

public 
client_putinserver(id) {
    if(
g_bCanVote)
        
set_task(5.0"vote_menu"id)
}

public 
reset_voting() {
    
g_bCanVote false

ty this will work,but there is 60 seconds warm up after 5 second warm up i'll show up for everyone the menu so it wont be problem

edit:actually client_putinserver work for once

Last edited by undead52; 11-22-2017 at 13:01.
undead52 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 14:48.


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