AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   add a Limitations (https://forums.alliedmods.net/showthread.php?t=326592)

Thew_ConFiger 08-07-2020 03:52

add a Limitations
 
solved

OciXCrom 08-07-2020 06:36

Re: add a Limitations
 
Where did you set "VipUsed" to 1?

OciXCrom 08-07-2020 09:43

Re: add a Limitations
 
Post the full code you tried.

Thew_ConFiger 08-07-2020 10:34

Re: add a Limitations
 
solved

Black Rose 08-07-2020 10:49

Re: add a Limitations
 
If you only want to affect this menu option:
Code:
    switch(item)     {         case 0:     {     set_user_health(id, get_user_health(id) + 250);     }     VipUsed[id] = 1     }
-->
Code:
    switch(item)     {         case 0:     {     set_user_health(id, get_user_health(id) + 250);     VipUsed[id] = 1     }     }

If you have more menu options but only one can be selected:
Code:
    switch(item)     {         case 0:     {     set_user_health(id, get_user_health(id) + 250);     }     VipUsed[id] = 1     }
-->
Code:
    switch(item)     {         case 0:     {     set_user_health(id, get_user_health(id) + 250);     }     }     VipUsed[id] = 1

But since you refuse to share full code, who knows...
Trust me, nobody wants to steal it.

Black Rose 08-07-2020 11:54

Re: add a Limitations
 
Do you want a set amount of rounds like:

1-3, one use
4-6, one use
used round 3, ready on round 4.

or a cooldown like: used round 2, ready 3 rounds later at round 5.

?

Thew_ConFiger 08-07-2020 11:56

Re: add a Limitations
 
i want cooldown : player used round 2 ready round 5

Black Rose 08-07-2020 12:17

Re: add a Limitations
 
Then I would do this:
Code:
VipUsed[id] = 3; // On use // ... if ( VipUsed[id] )     VipUsed[id]--; // On round end // ...     else if ( VipUsed[id] )     {         client_printc(id, "%s You Already used !gVIP Menu!n this round. Please wait till next round", PREFIX);     }

Thew_ConFiger 08-07-2020 12:20

Re: add a Limitations
 
can you show this on menu ? edit my last menu

Black Rose 08-07-2020 12:35

Re: add a Limitations
 
Code:
VipUsed[id] = 1;
-->
Code:
VipUsed[id] = 3;





Code:
    VipUsed[id] = 0; // I'm guessing since you haven't shared this code
-->
Code:
if ( VipUsed[id] )     VipUsed[id]--;





Code:
    else if ( VipUsed[id] == 0 )     {         client_printc(id, "%s You Already used !gVIP Menu!n this round. Please wait till next round", PREFIX);     }
-->
Code:
    else if ( VipUsed[id] )     {         client_printc(id, "%s You Already used !gVIP Menu!n this round. Please wait till next round", PREFIX);     }


All times are GMT -4. The time now is 13:45.

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