AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Lock Menu (https://forums.alliedmods.net/showthread.php?t=167796)

BlinkHardeR 09-20-2011 09:50

Lock Menu
 
I need the code to so you can use 1 item and then its locked till i guess 300 seconds..

Fedde 09-20-2011 10:56

Re: Lock Menu
 
Wrong section.

drekes 09-20-2011 11:25

Re: Lock Menu
 
Make a global Float variable
Set it to get_gametime() + 300.0 when you use it
Check if the variable > get_gametime() & stop if it's false.

BlinkHardeR 09-20-2011 12:52

Re: Lock Menu
 
can't you just give me the code cuz i dont understand veribals and stuff... [In English]

Erox902 09-20-2011 13:17

Re: Lock Menu
 
He basically just did.
PHP Code:

new Float:gfVariable[33/MAX_PLAYERS+1]    //this is your variable 

PHP Code:

public handleMenublabla(idmenuitem)
{
     
blablabla...

     switch(
key)
     {
          case 
1:
          {
                if (
gfVariable[id] < get_gametime())
                {
                      
blablabla
                      gfVariable
[id] = get_gametime()+300.0
                  
}
                  else {
                       
blabla 



All times are GMT -4. The time now is 19:33.

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