Junior Member
|
06-24-2012
, 08:28
Need help in ipmenu for hns.
|
#1
|
I want to add a weapon chance with 1ammo like usp/p228/dual berettas/glock/deagle.(it will pick one and give the weapon to vip).but dont know how /: im starter scipter, and i dont even know how to change ammo, becoz when i add a weapon_usp it gives the usp 12 ammo.
This is my code where i need help: PHP Code:
PHP Code:
#include <amxmodx> #include <fun> #include <cstrike> #include <engine>
#define PLUGIN "HNS VIPMenu" #define VERSION "1.0" #define AUTHOR "iPro"
new bool:has_used[33]
public plugin_init() { register_clcmd( "say /vipmenu", "VIPMenu" ); register_clcmd( "say_team /vipmenu", "VIPMenu" ); register_logevent("event_new_round", 2, "1=Round_Start") }
public VIPMenu( id ) { if(!has_used[id]) { if(get_user_flags(id) & ADMIN_LEVEL_H) { new vip_menu = menu_create( "\VIP Menu", "menu_handler" ); menu_additem( vip_menu, "\ 150 HP", "1", 0 ); menu_additem( vip_menu, "\ Granaadid", "2", 0 ); menu_additem( vip_menu, "\ Weapon", "3", 0); menu_additem( vip_menu, "\ Kiirus", "4", 0); menu_additem( vip_menu, "\ Kilp", "5", 0); menu_setprop( vip_menu, MPROP_EXIT, MEXIT_ALL ); menu_display( id, vip_menu, 0 ); } else { client_print(id, print_chat, "[EstFinHNS] You need to be a vip in order to use this cmd!") } } else { client_print(id, print_chat, "[EstFinHNS] You already used vipmenu this round!") } }
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: { if( is_user_alive( id ) ) { set_user_health( id, 150 ); //Sets health of id to 150 } } case 2: { if( is_user_alive( id ) ) { give_item( id, "weapon_hegrenade" ) } } case 3: { if( is_user_alive( id ) ) { give_item( id, "weapon_usp" ); } } case 4: { if(is_user_alive(id)) { set_user_maxspeed(id, 320.0); } } case 5: { if(is_user_alive(id)) { give_item( id, "weapon_flashgrenade" ); } } } has_used[id] = true; menu_destroy( menu ); return PLUGIN_HANDLED; }
public event_new_round() arrayset(has_used, false, 33)
BTW! When i write /vipmenu then it doesn't show me first letters like instead of Weapons, eapons and so on...
Last edited by iPro; 06-24-2012 at 08:55.
|
|