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_menu, MPROP_EXIT, MEXIT_ALL);
}
public menu_handler(id, menu, item)
{
if( item == MENU_EXIT )
{
menu_destroy(menu);
return PLUGIN_HANDLED;
}
new data[6], iName[64];
new access, callback;
menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);
new key = str_to_num(data);
switch(key)
{
case 1:
{
set_user_health(id, 150); //Sets health of id to 150
set_user_armor(id, 200); //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_flags( id ) & 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_menu, MPROP_EXIT, MEXIT_ALL);
}
public menu_handler(id, menu, item)
{
if( item == MENU_EXIT )
{
menu_destroy(menu);
return PLUGIN_HANDLED;
}
new data[6], iName[64];
new access, callback;
menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);
new key = str_to_num(data);
switch(key)
{
case 1:
{
set_user_health(id, 150); //Sets health of id to 150
set_user_armor(id, 200); //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