Raised This Month: $ Target: $400
 0% 

Voting


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 03-08-2005 , 19:12   Voting
Reply With Quote #1

Hey, can someone give me an example of a simple "Yes, No" vote?
IE: amx_votekick
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
tight2089
Member
Join Date: Mar 2005
Location: Newport Beach, CA
Old 03-10-2005 , 21:59  
Reply With Quote #2

amx_votei do stuff like isTHISmapGAY?? yes NOway

you have to keep the quiestion together otherwise the next word is going to be an answer.

or


amx_vote DESTINYlikesHISmom OHya NOway

and

amx_kick destiny yes no

stuff like so!!
__________________
Condition Zero UWC3 Server I.P:
67.18.205.222:27015
Clan WebSite:
www.GamingC3nter.com
tight2089 is offline
Send a message via AIM to tight2089 Send a message via MSN to tight2089
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 03-10-2005 , 22:15  
Reply With Quote #3

a) You can use parentheses in amx_vote: amx_vote "Is Catwoman hot?" "Ooh yea!" "No way!"

b) He was asking for Small code which lets him display his own vote menu.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 03-11-2005 , 00:16  
Reply With Quote #4

LOL, geez.. I know how to work a damn command!! I just want to know how the heck to code a simple one.
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 03-11-2005 , 00:45  
Reply With Quote #5

Code:
#include <amxmodx> #include <amxmisc> // array of votes - votes[1] is yes and votes[0] is no new votes[2]; public plugin_init() {    register_plugin("Eargh!","0.10","Catwoman?!$4");    register_menucmd(register_menuid("voting"),1023,"voting_handler");    register_concmd("amx_dotehvote","cmd_dotehvote",ADMIN_VOTE,"- starts teh votez0rz!");    register_cvar("amx_vote_time","20.0"); } public cmd_dotehvote(id,level,cid) {    if(!cmd_access(id,level,cid,1)) {       return PLUGIN_HANDLED;    }    new menubody[128], keys;    format(menubody,127,"Do you like d00ds wit teh swurd?^n^n1. Yesergh^n2. Noes");    keys = MENU_KEY_1|MENU_KEY_2;    // player, keys, text, hold time, title    show_menu(id,keys,menubody,get_cvar_num("amx_vote_time"),"voting");    set_task(get_cvar_float("amx_vote_time"),"display_results");    return PLUGIN_HANDLED; } public voting_handler(id,key) {    // number they pressed -> key variable    // 1 -> 0    // 2 -> 1    // 3 -> 2    // ...    // 8 -> 7    // 9 -> 8    // 0 -> 9    // if they voted yes    if(key == 0) {       votes[0]++;    }    // if they voted no    if(key == 1) {       votes[1]++;    }    // if we should display their choices    if(get_cvar_num("amx_vote_answers")) {       new username[32];       get_user_name(id,username,31);       client_print(0,print_chat,"%s voted %s",username,(key == 0) ? "Yes" : "No");    } } public display_results() {    client_print(0,print_chat,"Voting results: %i Yes -- %i No",votes[0],votes[1]);    votes[0] = 0;    votes[1] = 0; }
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS

Last edited by XxAvalanchexX; 11-22-2006 at 15:47.
XxAvalanchexX is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 03-11-2005 , 01:16  
Reply With Quote #6

Nice, thanks.. One other small question to addon to this.. Say I wanted FF on or something, where would set_cvar_num("mp_friendlyfire",1) go if they voted yes?
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 03-11-2005 , 20:53  
Reply With Quote #7

In display_results, you'd compare votes[0] (the yes's) to votes[1] (the no's) depending on how you want your ratio to work, and then you set friendlyfire to on or off.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Newbster
Junior Member
Join Date: Feb 2005
Location: San Antonio, Texas
Old 03-13-2005 , 22:08  
Reply With Quote #8

What if i wanted it to vote 5 minutes before end of game? would set_task(30.0, "vote") work. (i changed name of function it would go to).
__________________
www.j00s.com (67.95.103.222)
-j00- Public clan server and website
(j00 spelt with two zeros not letters)
Newbster is offline
Send a message via AIM to Newbster
Newbster
Junior Member
Join Date: Feb 2005
Location: San Antonio, Texas
Old 03-13-2005 , 23:25  
Reply With Quote #9

Scratch that, this is what i have
Code:
temp = float(get_cvar_num("mp_combattime")-5)
set_task(temp,"vote",9678,"",0,"b")
will this set the function "vote" to execute 5 mins before game ends?
__________________
www.j00s.com (67.95.103.222)
-j00- Public clan server and website
(j00 spelt with two zeros not letters)
Newbster is offline
Send a message via AIM to Newbster
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 13:59.


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