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

Vip Menu


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Condition-Zero        Category:   Fun Stuff        Approver:   ConnorMcLeod (74)
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 12-27-2010 , 04:01   Vip Menu
Reply With Quote #1

VIP Menu
Version 0.0.4


Description:
This plugin is made to give the VIP a menu to choose a pistol other then the USP. It also gives them x amount of ammo for the pistol. For use on AS maps. (i.e. as_oilrig)

Tested in CZ.
For cz bot support you need the rage module found here
and the cz bot addon found here


If you compile and use this without rage you will get an error in console saying could not hook entity czbot.. it works with out it.. but wont support cz bots.

Cvars
:

  • vip_enabled - Turns the plugin on and off. (default: 1)
  • vip_ammo - Amount of ammo to give for the pistol.(default: 200)
Credits:
  • Apollyon - For testing.
Change log:

0.0.1
Initial Release
0.0.2
Removed menu_item_getinfo
Made the menu look better (capitals then convert to lower case before the give)
Global Menu

0.0.3

Added bot support (Gets random weapon from the weapons list)
Cleaned up some code and added comments

0.0.4

Fixed runtime error for index out of bounds
Attached Files
File Type: sma Get Plugin or Get Source (VIP_Menu.sma - 5271 views - 1.9 KB)

Last edited by Doc-Holiday; 04-17-2012 at 23:48.
Doc-Holiday is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-27-2010 , 04:56   Re: Vip Menu
Reply With Quote #2

You usage of menus is incorrect :

Either you make the menu global (recommended), either you have to destroy it in callback.

Also, you don't need to store that info and to retrieve it to get the "key" pressed, item just do the same and is already an integer.
This way you don't need menu_item_getinfo in callback, you directly use item value.

Also, you could check if map is a vip map.
What about supercede the buy menu instead of forcing the menu to open ?

What about seeing further ?
http://forums.alliedmods.net/showthread.php?p=233877
http://forums.alliedmods.net/showthread.php?p=847019
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 12-27-2010 at 04:59.
ConnorMcLeod is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 12-28-2010 , 00:56   Re: Vip Menu
Reply With Quote #3

Hopefully thats what your talking about making it global? Im not really sure what you mean by its not global.. The g_VipMenu was a global variable.

also removed the stuff you asked.
Doc-Holiday is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-28-2010 , 01:09   Re: Vip Menu
Reply With Quote #4

Your menu will continue to grow longer and longer. For a menu to be "global" you need to build the menu once then only display it when you need to show the menu.
__________________
fysiks is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 12-28-2010 , 01:45   Re: Vip Menu
Reply With Quote #5

Quote:
Originally Posted by fysiks View Post
Your menu will continue to grow longer and longer. For a menu to be "global" you need to build the menu once then only display it when you need to show the menu.
Ah.. So thats why i kept getting multiple pages?
Doc-Holiday is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-28-2010 , 04:14   Re: Vip Menu
Reply With Quote #6

PHP Code:
    new szNum[3]; 
This param is not used anymore since you use iItem in callback and that it is an optional param.
You can do
PHP Code:
menu_additemg_vipmenug_WeaponDesc[i]) 
PHP Code:
        menu_setpropg_vipmenu MPROP_EXIT MEXIT_NEVER ); 
This should also move to plugin_init.

PHP Code:
    format(VipWepsizeof(VipWep), "weapon_%s"g_WeaponDesc[iItem]); 
Use formatex there, you don't use VipWe in format args.

Also enum is not needed :
PHP Code:
/*enum _:PISTOLS
{
    usp,
    glock,
    deagle,
    p228,
    elite,
    fiveseven
}*/

new const g_WeaponDesc[/* PISTOLS */] [] = 
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 12-28-2010 at 04:22.
ConnorMcLeod is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 12-28-2010 , 14:04   Re: Vip Menu
Reply With Quote #7

There we go.
Doc-Holiday is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-28-2010 , 14:59   Re: Vip Menu
Reply With Quote #8

By security, it would be better to inverse those 2 checks :

PHP Code:
    if(cs_get_user_vip(id) && is_user_alive(id)) 

You need to increase VipWep size by 1.



You COULD do tolower( VipWep[7] )


I think that's all
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
r4ndomz
Senior Member
Join Date: Jul 2009
Location: The Hood
Old 12-28-2010 , 16:23   Re: Vip Menu
Reply With Quote #9

Interesting idea. Maybe let them choose and ak47 too?
__________________
HideNSeek bug fixed here:http://forums.alliedmods.net/showpos...&postcount=951

PM me if you want a nice HideNSeek shop
NEED PLUGIN TESTERS PM ME
r4ndomz is offline
Send a message via Skype™ to r4ndomz
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 12-29-2010 , 01:43   Re: Vip Menu
Reply With Quote #10

Quote:
Originally Posted by r4ndomz View Post
Interesting idea. Maybe let them choose and ak47 too?
Giving the Ak takes a way from the game play of the as style maps though?

How ever eventually i want to create a text file that reads to add them to menus.
Doc-Holiday 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 20:34.


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