AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved Use menu once per round (https://forums.alliedmods.net/showthread.php?t=330030)

Destroyer8506 01-17-2021 11:34

Use menu once per round
 
Hi.I want to add sth to menu that players can use menu once per round
if players used menu they can't use it again
Tell me if you need more details. Thanks

lexzor 01-17-2021 11:39

Re: Use menu once per round
 
you have to create a global boolean.
then create a conditional statement: if boolean is true, player can't use menu, if boolean is false player can use menu.

make that boolean to be true after player use menu.

this is a scripting help section, people are helping you to learn not making plugins for you. good luck

LondoN 01-17-2021 18:26

Re: Use menu once per round
 
just pre-create the menu in plugin handler, make a boolean and when /shop /menu is hook make something:

Code:

if(!g_iUsed[id]) menu_display(id, MenuID, 0)
also in handler pui g_iUsed[id] = true
on ham spawn: g_iUsed[id] = false

Destroyer8506 01-18-2021 00:45

Re: Use menu once per round
 
Quote:

Originally Posted by LondoN (Post 2733017)
just pre-create the menu in plugin handler, make a boolean and when /shop /menu is hook make something:

Code:

if(!g_iUsed[id]) menu_display(id, MenuID, 0)
also in handler pui g_iUsed[id] = true
on ham spawn: g_iUsed[id] = false

I Fixed It. Thanks :wink:


All times are GMT -4. The time now is 17:35.

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