Hi.I am a scriper begginer.I got a problem with a VipMenu For HNS plugin.So please Help me and tell me what's wrong.And please make it call Only 1 Time per Round.Thanks!
http://www.fileshare.ro/e30327428 Link For sma.
Or Here's the Code:
P.S: It's in romanian.
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <hamsandwich>
#include <engine>
#include <colorchat>
#define PLUGIN "MeniuVipHns"
#define VERSION "1.0"
#define AUTHOR "LordTrick"
new const DGLW4[ ] = "weapon_deagle"
new const SMKW4[ ] = "weapon_smokegrenade"
new const FLSH4[ ] = "weapon_flashbang"
new const HESH4[ ] = "weapon_hegrenade"
new const AWPW4[ ] = "weapon_awp"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say_team /vipmenula", "vip_menu")
}
public vip_menu(id)
{
if(cs_get_user_team(id) == CS_TEAM_T)
{
new menu = menu_create("\w[VIP]Alege Ce Vrei!", "vip_menu_t")
menu_additem(menu, "Viata 200", "1", ADMIN_LEVEL_H)
menu_additem(menu, "Deagle 1 Glont", "2", ADMIN_LEVEL_H)
menu_additem(menu, "Smoke+Flash+He", "3", ADMIN_LEVEL_H)
menu_additem(menu, "GodMode 5 Secunde", "4", ADMIN_LEVEL_H)
menu_additem(menu, "Viteza 400 5 Secunde", "5", ADMIN_LEVEL_H)
}
else if(cs_get_user_team(id) == CS_TEAM_CT)
{
new menu = menu_create("\w[VIP]Alege Ce Vrei!", "vip_menu_ct")
menu_additem(menu, "Deagle 2 Gloante", "1", ADMIN_LEVEL_H)
menu_additem(menu, "AWP 1 Glont", "2", ADMIN_LEVEL_H)
menu_additem(menu, "Smoke+Flash+He", "3", ADMIN_LEVEL_H)
menu_additem(menu, "GodMode 10 Secunde", "4", ADMIN_LEVEL_H)
menu_additem(menu, "Gravitatie 10 Secunde", "5", ADMIN_LEVEL_H)
}
}
public vip_menu_t(id, menu, item)
{
if( item == MENU_EXIT )
{
menu_destroy(menu);
return PLUGIN_HANDLED;
}
new data[6], szName[64];
new access, callback;
menu_item_getinfo(menu, item, access, data,charsmax(data), szName,charsmax(szName), callback);
new key = str_to_num(data);
switch(key)
{
case 1:
{
if(get_user_flags(id) & ADMIN_LEVEL_H)
{
new szAuthName[33]
get_user_name(id,szAuthName,32)
set_user_health(id, 200)
ColorChat(id, RED, "^x01 Vip-ul ^x03 %s ^x01 A cumparat viata!",szAuthName)
}
}
else ColorChat(id, RED, "^x01 Trebuie sa fi ^x03 Vip ^x01 Ca sa folosesti aceasta comanda!")
}
case 2:
{
if(get_user_flags(id) & ADMIN_LEVEL_H)
{
new szAuthName[33]
get_user_name(id,szAuthName,32)
give_item(id,DGLW4);
new gL_DGLW4 = find_ent_by_owner(-1,DGLW4,id);
cs_set_weapon_ammo(gL_DGLW4, 1);
ColorChat(0, RED, "^x01 VIP-ul ^x03 %s ^x01 A cumparat un ^x04 Deagle!")
}
else ColorChat(id, RED, "^x04 Trebuie sa fi ^x03 VIP ^x04 Ca sa poti folosi meniul!")
}
case 3:
{
if(get_user_flags(id) & ADMIN_LEVEL_H)
{
new szAuthName[33]
get_user_name(id,szAuthName,32)
give_item(id,SMKW4);
give_item(id,FLSH4);
give_item(id,HESH4);
new gL_SMKW4 = find_ent_by_owner(-1,SMKW4,id);
new gL_FLSH4 = find_ent_by_owner(-1,FLSH4,id);
new gL_HESH4 = find_ent_by_owner(-1,HESH4,id);
cs_set_weapon_ammo(gL_SMKW4, 1);
cs_set_weapon_ammo(gL_FLSH4, 1);
cs_set_weapon_ammo(gL_HESH4, 1);
ColorChat(0, RED, "^x01 VIP-ul ^x03 %s ^x01 A cumparat pachetul de grenazi!",szAuthName)
}
else ColorChat(id, RED, "^x04 Trebuie sa fi ^x03 VIP ^x04 Ca sa poti folosi meniul!")
}
case 4:
{
if(get_user_flags(id) & ADMIN_LEVEL_H)
{
new szAuthName[33]
get_user_name(id,szAuthName,32)
set_user_godmode(id, 1)
set_task(5.0, "opreste_godmode", 1);
ColorChat(0, RED, "^x01 VIP-ul ^x03 %s ^x01 A cumparat ^x04 Gravitatie!",szAuthName)
}
else ColorChat(id, RED, "^x04 Trebuie sa fi ^x03 VIP ^x04 Ca sa poti folosi meniul!")
}
case 5:
{
if(get_user_flags(id) & ADMIN_LEVEL_H)
{
new szAuthName[33]
get_user_name(id,szAuthName,32)
set_user_maxspeed(id, 400.0)
set_task(5.0, "opreste_viteza", 1);
ColorChat(0, RED, "^x01 VIP-ul ^x03 %s ^x01 A cumparat viteza!",szAuthName)
}
else ColorChat(id, RED, "^x04 Trebuie sa fi ^x03 VIP ^x04 Ca sa poti folosi meniul!")
}
}
menu destroy(menu);
return PLUGIN_HANDLED;
}
public vip_menu_ct(id, menu, item)
{
if( item == MENU_EXIT )
{
menu_destroy(menu);
return PLUGIN_HANDLED;
}
new data[6], szName[64];
new access, callback;
menu_item_getinfo(menu, item, access, data,charsmax(data), szName,charsmax(szName), callback);
new key = str_to_num(data);
switch(key)
{
case 1:
{
if(get_user_flags(id) & ADMIN_LEVEL_H)
{
new szAuthName[33]
get_user_name(id,szAuthName,32)
give_item(id,DGLW4);
new gL_DGLW4 = find_ent_by_owner(-1,DGLW4,id);
cs_set_weapon_ammo(gL_DGLW4, 2);
ColorChat(0, RED, "^x01 VIP-ul ^x03 %s ^x01 A cumparat un ^x04 Deagle!",szAuthName)
}
else ColorChat(id, RED, "^x04 Trebuie sa fi ^x03 VIP ^x04 Ca sa poti folosi meniul!")
}
case 2:
{
if(get_user_flags(id) & ADMIN_LEVEL_H)
{
new szAuthName[33]
get_user_name(id,szAuthName,32)
give_item(id,AWPW4);
new gL_AWPW4 = find_ent_by_owner(-1,AWPW4,id);
cs_set_weapon_ammo(gL_AWPW4, 1);
ColorChat(0, RED, "^x01 VIP-ul ^x03 %s ^x01 A cumparat un ^x04 AWP!",szAuthName)
}
else ColorChat(id, RED, "^x04 Trebuie sa fi ^x03 VIP ^x04 Ca sa poti folosi meniul!")
}
case 3:
{
if(get_user_flags(id) & ADMIN_LEVEL_H)
{
new szAuthName[33]
get_user_name(id,szAuthName,32)
give_item(id,SMKW4);
give_item(id,FLSH4);
give_item(id,HESH4);
new gL_SMKW4 = find_ent_by_owner(-1,SMKW4,id);
new gL_FLSH4 = find_ent_by_owner(-1,FLSH4,id);
new gL_HESH4 = find_ent_by_owner(-1,HESH4,id);
cs_set_weapon_ammo(gL_SMKW4, 1)
cs_set_weapon_ammo(gL_FLSH4, 2)
cs_set_weapon_ammo(gL_HESH4, 1)
ColorChat(0, RED, "^x01 VIP-ul ^x03 %s ^x01 A cumparat pachetul de grenazi!",szAuthName)
}
else ColorChat(id, RED, "^x04 Trebuie sa fi ^x03 VIP ^x04 Ca sa poti folosi meniul!")
}
case 4:
{
if(get_user_flags(id) & ADMIN_LEVEL_H)
{
new szAuthName[33]
get_user_name(id,szAuthName,32)
set_user_godmode(id, 1)
set_task(10.0, "opreste_godmode", 1)
ColorChat(0, RED, "^x01 VIP-ul ^x03 %s ^x01 A cumparat ^x04 GodMode!",szAuthName)
}
else ColorChat(id, RED, "^x04 Trebuie sa fi ^x03 VIP ^x01 Ca sa poti folosi meniul!")
}
case 5:
{
if(get_user_flags(id) & ADMIN_LEVEL_H)
{
new szAuthName[33]
get_user_name(id,szAuthName,32)
set_user_gravity(id,0.
set_task(10.0, "opreste_gravitatia", 1)
ColorChat(0, RED, "^x01 VIP-ul ^x03 %s ^x01 A cumparat ^x04 Gravitatie!",szAuthName)
}
else ColorChat(id, RED, "^x04 Trebuie sa fi ^x03 VIP ^x04 Ca sa poti folosi meniul!")
}
}
menu_destroy(menu);
return PLUGIN_HANDLED;
}
public opreste_godmode(id)
{
set_user_godmode(id, 0)
ColorChat(id, RED, "^x01 Gata Cu GodMod-ul!Revii la cea normala!")
}
public opreste_viteza(id)
{
set_user_maxspeed(id, 1.0)
ColorChat(id, RED, "^x01 Gata Cu Viteza!Revii la cea normala!")
}
public opreste_gravitatia(id)
{
set_user_gravity(id, 1.0)
ColorChat(id, RED, "^x01 Gata Cu Gravitatia!Revii la cea normala!")
}