Thread: limit help
View Single Post
QuickDroLLL
Senior Member
Join Date: Dec 2021
Location: AMX Mod X Land
Old 08-16-2022 , 07:05   Re: limit help
Reply With Quote #3

Quote:
Originally Posted by Bugsy View Post
Create an array sized using MAX_PLAYERS + 1
Each time the menu is used by the player, increment it by one.
When you go to show the map, first check that they are below the count.
All variables are automatically reset to 0 on map change.

PHP Code:
const MAX_MENU 2;
new 
g_MenuUsedMAX_PLAYERS ];

//your menu command
if ( g_MenuUsedid ] < MAX_MENU )
{
    
//menu code
    
g_MenuUsedid ]++;
    
client_printid print_chat "* Cool gun, buddy. %d/%d" g_MenuUsedid ] , MAX_MENU );
}
else
{
    
client_printid print_chat "* You already used the menu %d times" MAX_MENU );

Thank you.
QuickDroLLL is offline