JB Vip Plugin

J

JoaoVieira

Guest
#1
When i say /vmenu it shows i dont have vip but actually i had all flags

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <cstrike>
#include <fun>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

new bool:gMenu[32]
new const
PREFIX[] = { "!g[SMART TEAM PORTUGAL]!n" };

public
plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
RegisterHam(Ham_Spawn, "player", "player_spawn", 1)
register_clcmd("say vmenu", "cmdVmenu");
register_clcmd("say /vmenu", "cmdVmenu");
register_clcmd("say_team vmenu", "cmdVmenu");

}
public
player_spawn(id) gMenu[id] = false

public cmdVmenu(id)
{
if(
gMenu[id])
{
client_printc(id, "%s Tu ja usas-te o !gVIP Menu!n esta ronda. So consegues usar na proxima ronda outravez.", PREFIX);
}

else
{
client_printc(id, "%s So os !gVIP's!n e que conseguem usar este !gmenu vip!n", PREFIX);
return
PLUGIN_HANDLED;
}
if(
cs_get_user_team(id) == CS_TEAM_CT)
{
client_printc(id, "%s So podes usar este !gMenu Vip!n se fores !tPrisioneiro!n!", PREFIX);
return
PLUGIN_HANDLED;
}

return
PLUGIN_HANDLED;
}
public
vip_menu(id)
{
if(
gMenu[id])
return
PLUGIN_HANDLED
if(get_user_flags(id) & ADMIN_RESERVATION && cs_get_user_team(id) == CS_TEAM_T )
{
new
Menu = menu_create( "\r[SMART TEAM PORTUGAL]\yVIP Menu", "vip_Handler" );
menu_additem( Menu, "Glock com 3 Balas", "0" );
menu_additem( Menu, "50 HP & 100 Armor", "1" );
menu_additem( Menu, "He grenade", "2" );
menu_additem( Menu, "Flashbang", "3" );
menu_display( id, Menu, 0 );

}
return
PLUGIN_HANDLED
}
public
vip_Handler( id, Menu, iItem)
{
if(
iItem == MENU_EXIT )
{
menu_destroy( Menu );
return
PLUGIN_HANDLED;
}
new
szData[ 6 ];
new
iAccess, hCallback;

menu_item_getinfo( Menu, iItem, iAccess, szData, 5, _, _, hCallback );

switch(
str_to_num( szData ) )
{
case
0:
{
give_item(id,"weapon_glock18")
cs_set_user_bpammo( id, CSW_GLOCK18, 2 );
}
case
1:
{
set_user_armor(id,200)
set_user_health(id,200)
}
case
2: give_item(id,"weapon_hegrenade")
case
3: give_item(id,"weapon_flashbang")
}
return
PLUGIN_HANDLED;
}

stock client_printc(const id, const input[], any:...)
{
new
count = 1, players[32];
static
msg[191];
vformat(msg, 190, input, 3);

replace_all(msg, 190, "!g", "^x04"); // Green Color
replace_all(msg, 190, "!n", "^x01"); // Default Color
replace_all(msg, 190, "!t", "^x03"); // Team Color

if (id) players[0] = id; else get_players(players, count, "ch");
{
for (new
i = 0; i < count; i++)
{
if (
is_user_connected(players[i]))
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
write_byte(players[i]);
write_string(msg);
message_end();
}
}
}
}
WHATS WRONG?
 
   
   
   
Top