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

Event Round end


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BeeFighter
Member
Join Date: Feb 2012
Old 02-19-2012 , 05:43   Event Round end
Reply With Quote #1

PHP Code:
register_logevent("EventRoundEnd"2"1=Round_End"

PHP Code:
public EventRoundEnd(id)
{
    
IsCommander[id] = false

After round end I can still enter this menu:

PHP Code:
public commander(id)
{
        if(
IsCommander[id] == true)
    {
        new 
menu menu_create("\wCommander Menu:^nVersion:\r 0.14^n\wAuthor: \rPancakez""commander_handler")
        
menu_additem(menu"\rDay Menu^n""1"0)
        
menu_additem(menu"Open Cells""2"0)
        
menu_additem(menu"Give M4 Set""3"0)
        
menu_setprop(menuMPROP_EXITMEXIT_ALL);
        
menu_display(idmenu0);
    }
    else 
client_print(idprint_chat"You are not the commander!")

BeeFighter is offline
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 02-19-2012 , 05:52   Re: Event Round end
Reply With Quote #2

Doesn't have params EventRoundEnd, you should make a loop thought connected players.
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
BeeFighter
Member
Join Date: Feb 2012
Old 02-19-2012 , 06:03   Re: Event Round end
Reply With Quote #3

Quote:
Originally Posted by lucas_7_94 View Post
Doesn't have params EventRoundEnd, you should make a loop thought connected players.
Thanks, Ex1ne is helping me over steam with looping

EDIT:
ex1ne told me to loop like this, Yet it aint working.. ^^ I've never looped before:/

PHP Code:
public EventRoundEnd(id)
{
    new 
iPlayers[32], iNumiPid
    get_players
(iPlayersiNum)

    for(new 
iiNumi++)
    {
        
IsCommander[iPid] = false
    
}


Last edited by BeeFighter; 02-19-2012 at 06:10.
BeeFighter is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 02-19-2012 , 06:11   Re: Event Round end
Reply With Quote #4

arrayset( IsCommander, 0, sizeof IsCommander );
__________________

Last edited by xPaw; 02-19-2012 at 06:11.
xPaw is offline
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 02-19-2012 , 06:12   Re: Event Round end
Reply With Quote #5

Code:
new g_Max /* in plugin_init */ g_Max = get_maxplayers() /*Looping*/ for( new i = 1 ; i <= g_Max ; i++ ) {             if( !is_user_connected(i) )                     continue;                           // do stuff }

Or, xPaw method.
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.

Last edited by lucas_7_94; 02-19-2012 at 06:24.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
BeeFighter
Member
Join Date: Feb 2012
Old 02-19-2012 , 06:13   Re: Event Round end
Reply With Quote #6

Quote:
Originally Posted by xPaw View Post
arrayset( IsCommander, 0, sizeof IsCommander );
This is just confusing me. Mind explaining it?

Thanks^^

EDIT:
Lucas, It isn't working for me.. I wonder what's wrong with it.:

PHP Code:
public EventRoundEnd(id)
{
    new 
g_Max
    
    g_Max 
get_maxplayers()

    for( new 
<= g_Max i++ )
    {
        if( !
is_user_connected(id) )
            continue;
             
        
IsCommander[id] = false
    
}


Last edited by BeeFighter; 02-19-2012 at 06:17.
BeeFighter is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 02-19-2012 , 06:21   Re: Event Round end
Reply With Quote #7

Quote:
Originally Posted by BeeFighter View Post
This is just confusing me. Mind explaining it?
Instead of looping, just call this function.
And EndRound event doesn't have any params, remove id.
__________________
xPaw is offline
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 02-19-2012 , 06:24   Re: Event Round end
Reply With Quote #8

You're wrong , the public doesnt have any params , dont have any id.

You should make the variable outside any public.
Set g_max the maxplayers of server in PLUGIN_INIT (its a public, you should have it).

Code:
public EventRoundEnd(id) {     for( new i = 1 ; i <= g_Max ; i++ )     {         if( !is_user_connected(i) )             continue;                       IsCommander[i] = false     } }
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
BeeFighter
Member
Join Date: Feb 2012
Old 02-19-2012 , 06:25   Re: Event Round end
Reply With Quote #9

It's working, thanks xPaw and lucas for the massive help^^
BeeFighter is offline
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 02-19-2012 , 07:10   Re: Event Round end
Reply With Quote #10

I am not sure to understand what you are trying to do but, I think you want to allow the menu only at the first spawn's player ?

Also, xPaw's way is better. (using arrayset)
__________________
You can do anything you set your mind to, man.


Last edited by Devil259; 02-19-2012 at 07:10.
Devil259 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 15:26.


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