Raised This Month: $ Target: $400
 0% 

Restricting an item on shop to one per map.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Kreation
Veteran Member
Join Date: Jan 2010
Location: Illinois
Old 03-18-2010 , 18:03   Restricting an item on shop to one per map.
Reply With Quote #1

So as the title says how would I make it so that an item
on a shop for example could be restricted to only
using it once per map..?
__________________
Hi.

Last edited by Kreation; 03-21-2010 at 10:21.
Kreation is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 03-18-2010 , 18:38   Re: Restricting an item on shop to one per map.
Reply With Quote #2

Code:
#define MAX_PLAYERS 32 new bool:b_Used[MAX_PLAYERS+1] public menufunction( id ) {     // ...         if( !b_Used[id] )     {         menu_additem( menu, "Item", "1", 0 )     } } public handler( id, menu, item ) {     // ...         switch( key )     {         case 1:         {             // ...                         b_Used[id] = true         }     } }
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
Kreation
Veteran Member
Join Date: Jan 2010
Location: Illinois
Old 03-18-2010 , 19:37   Re: Restricting an item on shop to one per map.
Reply With Quote #3

That is for once per map? I didn't know that.
__________________
Hi.
Kreation is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 03-18-2010 , 19:38   Re: Restricting an item on shop to one per map.
Reply With Quote #4

Quote:
Originally Posted by Kreation View Post
That is for once per map? I didn't know that.
All variables reset to their original state when the map starts (since each plugin reloads), and a bool's default value is false. So yeah.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
Reply


Thread Tools
Display Modes

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:38.


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