Raised This Month: $ Target: $400
 0% 

Voting


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



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