Raised This Month: $12 Target: $400
 3% 

[HELP] Compare variables.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
monster321
Member
Join Date: Apr 2012
Old 04-11-2015 , 13:15   [HELP] Compare variables.
Reply With Quote #1

I'm working in a plugin with a special day votes, and i have a question about it. Example:

Code:
#include < amxmodx > #include < amxmisc > new vote_active, voteday[ 3 ]; // Init public plugin_init() {     // Register     register_plugin( "Compare variables", "1.0", "monster321" )         // Clcmd TEST     register_clcmd( "say test", "test_plugin" ) } // CMD TestPlugin public test_plugin( id ) {     if( !is_user_admin( id ) || vote_active )         return PLUGIN_HANDLED;         for( new i; i <= 32; i++ )     {         if( !is_user_connected( i ) )             continue;                     vote_menu( i )                 voteday[ 0 ] = 0;         voteday[ 1 ] = 0;         voteday[ 2 ] = 0;         vote_active = true;                 set_task( 15.0, "vote_end", i )     } } // Special day vote public vote_menu( id ) {     new menu = menu_create( "\wWhat you want to play?", "vote_handler" )         menu_additem( menu, "\ySpecial day 1", "1" )     menu_additem( menu, "\ySpecial day 2", "2" )     menu_additem( menu, "\ySpecial day 3", "3" )         menu_setprop( menu, MPROP_EXITNAME, "\wPrefer not vote" )         menu_display( id, menu, 0 ) } public vote_handler( id, menu, item ) {     if( item == MENU_EXIT )     {         menu_destroy( menu )         return PLUGIN_HANDLED;     }         if( !vote_active )         return PLUGIN_HANDLED;         new data[ 6 ], name[ 64 ], access, callback;     menu_item_getinfo( menu, item, access, data, 5, name, 63, callback )         switch( str_to_num( data ) )     {         case 1: voteday[ 0 ] ++;         case 2: voteday[ 1 ] ++;         case 3: voteday[ 2 ] ++;     }         menu_destroy( menu )     return PLUGIN_HANDLED; } public vote_end( id ) {     vote_active = false;     // I want get here the variable "voteday" with more votes to start the day.     // But I want this so optimized. }

Someone can help me? Thanks for your time.

Last edited by monster321; 04-11-2015 at 13:16.
monster321 is offline
Send a message via MSN to monster321 Send a message via Skype™ to monster321
 



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 22:54.


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