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

API Scripting Help ZP admin menu limit time


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
HiDeath
Senior Member
Join Date: Aug 2018
Location: Tunisia
Old 03-31-2019 , 04:49   ZP admin menu limit time
Reply With Quote #1

Hi there , could anyone set a limit for admin menu use , so admin can use it once every 10 minutes

i did try myself , but nothing seems to work ( idk why tho )

the main idea that i did use a variable menu_available[id]=0

and a function to reset menu available


Code:
reset_menu_available(id) {
menu_available[id]=0
client_print(id,print_chat,"You can use admin menu again")
}
and added these lines after each cmd ( the working part )

Code:
set_task(600.0,"reset_menu_available",id)
menu_available[id]++
client_print(id,print_chat,"You can use admin menu again in 10 minutes")
and this code at the start of the cmd function

Code:
if(menu_available[id]) {
client_print(id,print_chat,"You can't use admin menu now , please wait")
retun PLUGIN_HANDLED
}
Any help would be appreciated , and thanks in advance

i'll attach the original zombie plague 4.3 fix5 if anyone wanna try
Attached Files
File Type: sma Get Plugin or Get Source (zombie_plague40 (11).sma - 333 views - 344.0 KB)
HiDeath 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 08:27.


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