| Versus1994 |
06-05-2014 12:23 |
VIPmenu jump out. HELP please :/
Hey guys!
I need some help with making this VIPMENU jump out automaticly after 10 seconds when every round beginins only for VIPS. ( 10 seconds after the round starts! )
I really need this :// Could someone help?
Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#define PLUGIN "HnS - VIP"
#define VERSION "2.0"
new bool:jaUsou[ 33 ]
public plugin_init()
{
register_plugin( PLUGIN, VERSION, "pacheco" )
register_logevent( "logevent_round_start", 2, "1=Round_Start" )
register_clcmd( "say /vipmenu","cmdVipMenu" )
}
public logevent_round_start()
arrayset( jaUsou, false, 33 );
public cmdVipMenu(id)
{
switch ( jaUsou[id] )
{
case true:
{
client_print( id, print_center, "You have already used the menu this round." )
return PLUGIN_CONTINUE;
}
case false:
{
switch ( cs_get_user_team(id) )
{
case CS_TEAM_CT: ctVipMenu(id);
case CS_TEAM_T: ttVipMenu(id);
default:
{
client_print( id, print_center, "You can't use the menu if you haven't chosen a team" )
return PLUGIN_CONTINUE;
}
}
jaUsou[id] = true;
}
}
return PLUGIN_HANDLED;
}
public ttVipMenu(id)
{
new menu = menu_create( "\r[ \yHNS VIP - Terrorist Menu \r]", "menu_handler" );
menu_additem( menu,"USP \d(2 bullets)","1", ADMIN_RESERVATION )
menu_additem( menu,"Invisibility \d(10sec)","2", ADMIN_RESERVATION )
menu_additem( menu,"Granades \d(He,Sg,2xF)","3", ADMIN_RESERVATION )
menu_additem( menu,"120HP 120 AP","4", ADMIN_RESERVATION )
menu_setprop( menu, MPROP_EXIT, MEXIT_ALL );
menu_display( id, menu, 0 );
}
public ctVipMenu(id)
{
new menu = menu_create( "\r[ \yHNS VIP - CT Menu \r]", "menu_handler2" );
menu_additem( menu,"USP \d(1 bullets)","1", ADMIN_RESERVATION )
menu_additem( menu,"Granade Smoke","2", ADMIN_RESERVATION )
menu_additem( menu,"120HP 120 AP","3", ADMIN_RESERVATION )
menu_setprop( menu, MPROP_EXIT, MEXIT_ALL );
menu_display( id, menu, 0 );
}
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:
{
new iWeapon = give_item( id, "weapon_usp" )
cs_set_weapon_ammo( iWeapon, 2 )
client_print( id, print_chat, "You selected: Item one" )
}
case 2:
{
set_user_rendering( id, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 15 );
set_task( 10.0, "Remover", id )
client_print( id, print_chat, "You selected: Item two" )
}
case 3:
{
give_item( id, "weapon_hegrenade" )
give_item( id, "weapon_flashbang" )
give_item( id, "weapon_flashbang" )
give_item( id, "weapon_smokegrenade" );
client_print( id, print_chat, "You selected: Item three" )
}
case 4:
{
set_user_armor(id, 120)
set_user_health(id, 120)
client_print( id, print_chat, "You selected: Item four" )
}
}
menu_destroy(menu);
return PLUGIN_HANDLED;
}
public menu_handler2(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:
{
new iWeapon = give_item( id, "weapon_usp" )
cs_set_weapon_ammo( iWeapon, 1 )
client_print( id, print_chat, "You selected: Item one" )
}
case 2:
{
give_item( id, "weapon_smokegrenade" );
client_print( id, print_chat, "You selected: Item two" )
}
case 3:
{
set_user_armor(id, 120)
set_user_health(id, 120)
client_print( id, print_chat, "You selected: Item three" )
}
}
menu_destroy(menu);
return PLUGIN_HANDLED;
}
public Remover(id)
{
set_user_rendering( id, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 255 );
client_print( id, print_center, "You're visible now." )
}
|