Raised This Month: $ Target: $400
 0% 

[REQ] Simple Plugin (Please help fix)


Post New Thread Reply   
 
Thread Tools Display Modes
Versus1994
Senior Member
Join Date: Jan 2013
Old 07-06-2015 , 13:01   Re: [REQ] Simple Plugin
Reply With Quote #11

Yes, exactly, and yes 3 times pop up.
Versus1994 is offline
indraraj striker
Veteran Member
Join Date: Mar 2014
Location: Under the water
Old 07-06-2015 , 13:06   Re: [REQ] Simple Plugin
Reply With Quote #12

Quote:
Originally Posted by Versus1994 View Post
Yes, exactly, and yes 3 times pop up.
Test this if this will not work then test first one without any change
Attached Files
File Type: sma Get Plugin or Get Source (sv_talkvote.sma - 330 views - 2.0 KB)
indraraj striker is offline
Versus1994
Senior Member
Join Date: Jan 2013
Old 07-06-2015 , 13:27   Re: [REQ] Simple Plugin
Reply With Quote #13

Now 4 times, and when it was a tied at the last vote it disabled sv_alltalk.

Okay now I'll try without any change.

Edit:

I tried the first without changes and still it poped up 3 times

Last edited by Versus1994; 07-06-2015 at 13:55.
Versus1994 is offline
indraraj striker
Veteran Member
Join Date: Mar 2014
Location: Under the water
Old 07-06-2015 , 23:10   Re: [REQ] Simple Plugin
Reply With Quote #14

May be someone will help you
i m not able to understand as i dont have server to test it
indraraj striker is offline
Versus1994
Senior Member
Join Date: Jan 2013
Old 07-09-2015 , 10:48   Re: [REQ] Simple Plugin (Please help fix)
Reply With Quote #15

Okey, thanks for your work! Could somebody else help?
Versus1994 is offline
Kz1.0
Senior Member
Join Date: Jan 2013
Location: Vietnam
Old 07-09-2015 , 15:34   Re: [REQ] Simple Plugin (Please help fix)
Reply With Quote #16

Vote started after 20 sec since game commence or sv_restart.

PHP Code:
#include <amxmodx>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "GUG"

#define VOTE_TIME 15
#define DELAY_TIME 20

enum (+=100)
{
    
TASK_DELAY 14541,
    
TASK_STOP
}

enum
{
    
yes 0,
    
no
}

new 
g_iVote[2], g_iMaxPlayers
new bool:g_bVoted[33], g_bCanVote

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_event("TextMsg""eGameCommencing""a","2&#Game_C""2&#Game_w""2=#Game_will_restart_in")
    
register_clcmd("say /alltalk""fShowVoteMenu")
}

public 
fVoteStart()
{
    new 
Players[32], pnum
    get_players
(Playerspnum"ch")
    
g_iMaxPlayers pnum
    
    
for (new i=0i<pnumi++) 
    {
        
g_bVoted[Players[i]] = false
        fShowVoteMenu
(Players[i])
    }
    
    
set_task(float(VOTE_TIME), "fVoteStop"TASK_STOP)
    
client_print(0print_chat"Say /alltalk to show the vote menu")
    
    
g_bCanVote true
}

public 
fVoteStop()
{
    if (
g_iVote[yes] > g_iVote[no]) server_cmd("sv_alltalk 1")
    else if (
g_iVote[yes] < g_iVote[no]) server_cmd("sv_alltalk 0")
    else 
    {
        
client_print(0print_chat"Revote in %i seconds!"DELAY_TIME)
        
eGameCommencing()
    }
    
    
show_menu(00"^n"1)
    
g_bCanVote false
}

public 
fShowVoteMenu(id)
{
    if (
g_bVoted[id] || !g_bCanVote) return PLUGIN_HANDLED_MAIN
    
    
static menu
    menu 
menu_create("Sv_alltalk 1?""fShowVoteMenu_handler")
    
menu_additem(menu"Yes")
    
menu_additem(menu"No")
    
    
menu_display(idmenu)
    
    return 
PLUGIN_HANDLED_MAIN
}

public 
fShowVoteMenu_handler(idmenuitem
{
    new 
szName[33]; get_user_name(idszNamecharsmax(szName))
    
client_print(0print_chat"%s voted %s"szNameitem ?  "against" "for")
    
g_iVote[item]++
    
g_bVoted[id] = true
    
    
new total g_iVote[yes] + g_iVote[no]
    if (
total == g_iMaxPlayersfVoteStop()
}

public 
eGameCommencing()
{
    
remove_task(TASK_DELAY)
    
remove_task(TASK_STOP)
    
g_iVote[yes] = 0
    g_iVote
[no] = 0
    
    set_task
(float(DELAY_TIME), "fVoteStart"TASK_DELAY)


Last edited by Kz1.0; 07-09-2015 at 15:40.
Kz1.0 is offline
Versus1994
Senior Member
Join Date: Jan 2013
Old 07-16-2015 , 06:17   Re: [REQ] Simple Plugin (Please help fix)
Reply With Quote #17

Thanks, I will test it right away.

------

I dont see any problems here, I think it works great, thanks!

One more question can I change here:

menu_additem(menu, "Yes")
menu_additem(menu, "No")

Or then I'll have to change somewhere else too?

Last edited by Versus1994; 07-16-2015 at 07:09.
Versus1994 is offline
Kz1.0
Senior Member
Join Date: Jan 2013
Location: Vietnam
Old 07-16-2015 , 07:44   Re: [REQ] Simple Plugin (Please help fix)
Reply With Quote #18

You want to change the answer text? If so, just change there.
Kz1.0 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:37.


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