Raised This Month: $ Target: $400
 0% 

voting doesn't work


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
n0obie4life
Veteran Member
Join Date: Dec 2004
Old 05-27-2005 , 11:07   voting doesn't work
Reply With Quote #1

Code:
 public cmdknives(id){     new arg[2]     read_argv(1,arg,1)     set_hudmessage(200, 100, 0, -1.0, 0.25, 0, 1.0, 5.0, 0.1, 0.2, 2)     if(equal(arg, "1")){         knifeonly = 1         client_cmd(id,"weapon_knife")         console_print(id,"%L",LANG_PLAYER,"KNIVES_TURNED_ON")         client_print(0, print_chat,"%L",LANG_PLAYER, "KNIVES_TURNED_ON")         show_hudmessage(0,"%L",LANG_PLAYER,"KNIVES_ENABLED_HUD")         } else if(equal(arg, "0")){         knifeonly = 0         console_print(id,"%L",LANG_PLAYER,"KNIVES_TURNED_OFF")         client_print(0, print_chat,"%L",LANG_PLAYER, "KNIVES_TURNED_OFF")         show_hudmessage(0,"%L",LANG_PLAYER,"KNIVES_DISABLED_HUD")         }     return PLUGIN_HANDLED  }  public knivesgun(id){     if(knifeonly==0){         //nothing     }     if(knifeonly==1){         new clip, ammo         new usersweapon = get_user_weapon(id,clip,ammo)         if(usersweapon==CSW_KNIFE || usersweapon == CSW_C4 && get_cvar_num("vote_allowc4") == 1 ) {             //nothing             } else {             client_cmd(id,"weapon_knife")         }     }     return PLUGIN_CONTINUE  }  public cmdvoteknives(id){         if (get_cvar_num("vote_knivesvote") == 0 ) {     client_print(id,print_chat,"%L",LANG_PLAYER,"VOTE_KNIVES_DISABLED"); }         else if (get_cvar_num ("vote_knivesvote") == 1 ) {             new Float:voting = get_cvar_float("amx_last_voting")     if (voting > get_gametime()){         client_print(id,print_chat,"%L",LANG_PLAYER,"VOTE_CASTED")         return PLUGIN_HANDLED     }     if (voting && voting + get_cvar_float("amx_vote_delay") > get_gametime()) {         client_print(id,print_chat,"%L",LANG_PLAYER,"VOTE_WAIT")         return PLUGIN_HANDLED     }     new menu_msg[256]     new name[32]     format(menu_msg,255,"%L",LANG_PLAYER,"VOTE_KNIVES")     new Float:votetime = get_cvar_float("amx_vote_time") + 10.0     get_user_info(id, "name", name, 31)     set_cvar_float("amx_last_voting",  get_gametime() + votetime )     show_menu(0,(1<<0)|(1<<1),menu_msg,floatround(votetime))     set_task(votetime,"check_the_knife_votes")     client_print(0,print_chat,"%L",LANG_PLAYER,"VOTE_STARTED")     choice[0]=choice[1]=0     }     return PLUGIN_HANDLED  }  public count_knivesvotes(id,key){     if (get_cvar_float("amx_vote_answers") ) {         new name[32]         get_user_name(id,name,31)         client_print(0,print_chat,"* %s voted %s", name, key ? "against knives only" : "for knives only" )     }     ++choice[key]     return PLUGIN_HANDLED  }  public check_the_knife_votes(id){     if (choice[0] > choice[1]){         server_cmd("amx_knives 1")         client_print(0,print_chat,"%L",LANG_PLAYER,"VOTE_SUCEED_KNIVES",choice[0],choice[1])         } else {         server_cmd("amx_knives 0")         client_print(0,print_chat,"%L",LANG_PLAYER,"VOTE_FAILED_KNIVES",choice[0],choice[1])     }     return PLUGIN_HANDLED  }

why doesn't it work? i can't seem to vote...it returns a 0 & 0
__________________
Plugins:
none

n0obie4life 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 16:40.


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