Raised This Month: $ Target: $400
 0% 

Putting together a plugin? (VIPMenu)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SozzZod
Junior Member
Join Date: Oct 2009
Old 07-24-2010 , 13:02   Putting together a plugin? (VIPMenu)
Reply With Quote #1

Hello!,

So, i have searching for a VIP menu plugin. I found one, but its not exactly the one i want.
The code:
PHP Code:
#include <amxmodx>
#include <fun>
new vip_menu

public plugin_init()
{
 
register_clcmd"say /vipmenu","VIPMenu");
}
 
public 
VIPMenu(id)
{
 
vip_menu menu_create("\rVip meniu:""menu_handler");
 
menu_additem(vip_menu"\wMaza gravitacija""1"0);
 
menu_additem(vip_menu"\wGive USP""2"0);
 
menu_setprop(vip_menuMPROP_EXITMEXIT_ALL);
}
 
public 
menu_handler(idmenuitem)
{
 if( 
item == MENU_EXIT )
 {
  
menu_destroy(menu);
  return 
PLUGIN_HANDLED;
 }
 new 
data[6], iName[64];
 new 
accesscallback;
 
 
menu_item_getinfo(menuitemaccessdata,5iName63callback);
 new 
key str_to_num(data);
 switch(
key)
 {
  case 
1:
  {
   
set_user_health(id150); //Sets health of id to 150
   
set_user_armor(id200); //Sets armor of id to 200
  
}
 
  case 
2:
  {
   
give_item(id"weapon_usp"); //Gives id a USP
   
give_item(id"ammo_45acp"); //Gives id USP ammo
  
}  
 }
 
menu_destroy(menu);
 return 
PLUGIN_HANDLED;

I changed the plugin and got this:


PHP Code:
#include <amxmodx>
#include <fun>
new vip_menu

if( !( get_user_flagsid ) & ADMIN_LEVEL_B ) ) {
     return;   
//So, if the person who writes /vipmenu doesnt have B flag,
}               //Should it automatically close or you cant choose anything?

public plugin_init()
{
 
register_clcmd"say /vipmenu","VIPMenu");
}
 
public 
VIPMenu(id)
{
 
vip_menu menu_create("\rVip meniu:""menu_handler");
 
menu_additem(vip_menu"\wMaza gravitacija""1"0);
 
menu_additem(vip_menu"\wGive Deagle""2"0);
 
menu_setprop(vip_menuMPROP_EXITMEXIT_ALL);
}
 
public 
menu_handler(idmenuitem)
{
 if( 
item == MENU_EXIT )
 {
  
menu_destroy(menu);
  return 
PLUGIN_HANDLED;
 }
 new 
data[6], iName[64];
 new 
accesscallback;
 
 
menu_item_getinfo(menuitemaccessdata,5iName63callback);
 new 
key str_to_num(data);
 switch(
key)
 {
  case 
1:
  {
   
set_user_health(id150); //Sets health of id to 150
   
set_user_armor(id200); //Sets armor of id to 200
  
}
 
  case 
2:
  {
   
give_item(id"weapon_deagle");
   
give_item(id"ammo_50ae"); // How can i change it, so it gives only 1 bullet?
  
}
  case 
3:
 {
   
give_item(id"weapon_flashbang") ;
   
give_item(id"weapon_flashbang") ;
   
give_item(id"weapon_smokegrenade") ;
   
give_item(id"weapon_hegrenade") ;       //I tried to make it myself.
  
}  
  case 
4:
  {
  } 
 }
 
menu_destroy(menu);
 return 
PLUGIN_HANDLED;

I would like 2 more options...
3)All grenades SB, 2x FB, HE
4)Speed for 5 seconds (increases about 70 or 90)
And you could use the menu once every 100 sec or 120 sec.

PS. I haven't tried this plugin even once, so i dont know does it work. (Going to try it if i get to other computer)
PS2.How can i modify the falling damage? I'd like to decrease it by 35% for VIPs.

Feel free to critisize... 'cause its my first time touching a script. If there is something wrong PLEASE tell me =) If you changed something then tell me what, 'cause if you do all for me i wouldn't learn anything!

Thanks,

Syrup =333333
SozzZod is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 07-24-2010 , 13:18   Re: Putting together a plugin? (VIPMenu)
Reply With Quote #2

You have to put the if statement inside of the VIP menu fuction and then return PLUGIN_HANDLED. Oh in the createmenu it says vipmeniu? Also for the third case make a menu item for it the same way to make it for the deagle and stuff.
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
SozzZod
Junior Member
Join Date: Oct 2009
Old 07-24-2010 , 13:30   Re: Putting together a plugin? (VIPMenu)
Reply With Quote #3

Quote:
Originally Posted by nikhilgupta345 View Post
You have to put the if statement inside of the VIP menu fuction and then return PLUGIN_HANDLED. Oh in the createmenu it says vipmeniu?
Ughmm... could you give me an example? To me, it is in the VIP menu... Whate H... i will give it a try...:
PHP Code:
new vip_menu

public plugin_init()
{
 
register_clcmd"say /vipmenu","VIPMenu");
}

if( !( 
get_user_flagsid ) & ADMIN_LEVEL_B ) ) {
     return;

Quote:
Originally Posted by nikhilgupta345 View Post
Also for the third case make a menu item for it the same way to make it for the deagle and stuff.
Hmm... i think i tried it already XP look at the second PHP.
SozzZod is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 07-24-2010 , 14:01   Re: Putting together a plugin? (VIPMenu)
Reply With Quote #4

Oh make a new menu item for the grenades. The if plugin has to be like this:
Code:
public VIPMenu(id)
{
// if statement here
VIP_menu=blablabla
}

Last edited by nikhilgupta345; 07-24-2010 at 14:05.
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
SozzZod
Junior Member
Join Date: Oct 2009
Old 07-24-2010 , 14:19   Re: Putting together a plugin? (VIPMenu)
Reply With Quote #5

PHP Code:
public VIPMenu(id)
{
 
vip_menu menu_create("\rVip menu:""menu_handler");
 
menu_additem(vip_menu"\wHealth And Armor""1"0);
 
menu_additem(vip_menu"\wGive Deagle""2"0);
 
menu_additem(vip_menu"\wGrenades""3"0); //is it right?
 
menu_setprop(vip_menuMPROP_EXITMEXIT_ALL);

SozzZod is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 07-24-2010 , 14:33   Re: Putting together a plugin? (VIPMenu)
Reply With Quote #6

Yea should be. Did u add the if statement?
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 07-24-2010 , 14:36   Re: Putting together a plugin? (VIPMenu)
Reply With Quote #7

Yea should be. Did u add the if statement?
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
Old 07-24-2010, 13:19
nikhilgupta345
This message has been deleted by nikhilgupta345.
SozzZod
Junior Member
Join Date: Oct 2009
Old 07-24-2010 , 16:56   Re: Putting together a plugin? (VIPMenu)
Reply With Quote #9

hmmm... since i'm gonna make it for HNS, gravity is bad, you can use shortcuts and go to places where other people cant... And you cant use lj stats and so =(
-Oh, how can i set an interval between using the menu again.
-If i find out how to set the interval, then i guess i will be able to figure out how to set the speed for 5 seconds only =).
SozzZod is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 07-24-2010 , 17:23   Re: Putting together a plugin? (VIPMenu)
Reply With Quote #10

I'm pretty sure you would have to use set_task. Check the rollthedice plugin, it's basically the same thing. I'm not hundred percent sure how
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
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 00:09.


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