Raised This Month: $ Target: $400
 0% 

Check if player used menu 3 times? Possible?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Evaldas.Grigas
Senior Member
Join Date: Sep 2011
Location: Lithuania
Old 10-30-2011 , 10:53   Check if player used menu 3 times? Possible?
Reply With Quote #1

I know hot check if player used menu once, but is it possible to check if he used 3 times?
__________________
Please enter this website everyday: http://forums.alliedmods.net/showthread.php?t=169067
Evaldas.Grigas is offline
Send a message via Skype™ to Evaldas.Grigas
egbertjan
Senior Member
Join Date: Mar 2007
Location: The Netherlands
Old 10-30-2011 , 11:00   Re: Check if player used menu 3 times? Possible?
Reply With Quote #2

For now you could try to add a 2nd check and a 3rd check with a bool untill a better answer comes.
egbertjan is offline
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 10-30-2011 , 11:02   Re: Check if player used menu 3 times? Possible?
Reply With Quote #3

make a variable , when the player open the menu add a +1 , check if the thirt open and close it.
__________________
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
Evaldas.Grigas
Senior Member
Join Date: Sep 2011
Location: Lithuania
Old 10-30-2011 , 11:05   Re: Check if player used menu 3 times? Possible?
Reply With Quote #4

Examples please?
__________________
Please enter this website everyday: http://forums.alliedmods.net/showthread.php?t=169067
Evaldas.Grigas is offline
Send a message via Skype™ to Evaldas.Grigas
Erox902
Veteran Member
Join Date: Jun 2009
Location: Never Never Land
Old 10-30-2011 , 13:02   Re: Check if player used menu 3 times? Possible?
Reply With Quote #5

If you need a total example off how to add + 1 to a variable you should post in request instead of scripting help.
PHP Code:
public examplemenu(id)
{
    if ( 
gVariable[id] < )
    {
        
gVariable[id]++

        new 
menu menu_create....
        .......
        ....... 
Erox902 is offline
Evaldas.Grigas
Senior Member
Join Date: Sep 2011
Location: Lithuania
Old 10-30-2011 , 13:35   Re: Check if player used menu 3 times? Possible?
Reply With Quote #6

Will test it. Thanks.
EDIT: I have to add?
PHP Code:
 new gVariable[what
__________________
Please enter this website everyday: http://forums.alliedmods.net/showthread.php?t=169067

Last edited by Evaldas.Grigas; 10-30-2011 at 13:36.
Evaldas.Grigas is offline
Send a message via Skype™ to Evaldas.Grigas
poliisi299
Senior Member
Join Date: May 2011
Old 10-30-2011 , 13:38   Re: Check if player used menu 3 times? Possible?
Reply With Quote #7

why all help you ?, and no help me ?? (
poliisi299 is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 10-30-2011 , 13:48   Re: Check if player used menu 3 times? Possible?
Reply With Quote #8

Quote:
Originally Posted by Evaldas.Grigas View Post
Will test it. Thanks.
EDIT: I have to add?
PHP Code:
 new gVariable[what
new gVariable[33]

33 = MaxPlayers + 1

Max Players = 32 for a CS server.

IDs start at 1, so to be able to use the id of the person that has 32, you have to make the array have 33 slots.
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
Evaldas.Grigas
Senior Member
Join Date: Sep 2011
Location: Lithuania
Old 10-30-2011 , 13:54   Re: Check if player used menu 3 times? Possible?
Reply With Quote #9

It works perfectly, but one warning
Code:
public cmdvipmenu(id) 
{
    round++;
    if(gbUsed[id] < 3)
    {
        if (is_user_alive(id) && get_user_flags(id) & ADMIN_LEVEL_H )
        {
            if(round > 0)
            {
                Showrod(id)
            }
        }
    }
    return PLUGIN_HANDLED
}
I made bigger where warning is "Tag mismatch"
I use it like a bool:
PHP Code:
new bool:gbUsed[id
__________________
Please enter this website everyday: http://forums.alliedmods.net/showthread.php?t=169067

Last edited by Evaldas.Grigas; 10-30-2011 at 14:11.
Evaldas.Grigas is offline
Send a message via Skype™ to Evaldas.Grigas
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-30-2011 , 14:29   Re: Check if player used menu 3 times? Possible?
Reply With Quote #10

Quote:
Originally Posted by Evaldas.Grigas View Post
It works perfectly, but one warning
Code:
public cmdvipmenu(id) 
{
    round++;
    if(gbUsed[id] < 3)
    {
        if (is_user_alive(id) && get_user_flags(id) & ADMIN_LEVEL_H )
        {
            if(round > 0)
            {
                Showrod(id)
            }
        }
    }
    return PLUGIN_HANDLED
}
I made bigger where warning is "Tag mismatch"
I use it like a bool:
PHP Code:
new bool:gbUsed[id
You can't label something bool that is going to be used to count. Bool implies true or false ONLY.
__________________
fysiks 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 14:28.


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