Raised This Month: $ Target: $400
 0% 

[Help] Menu Problem


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
2reason2kill
Senior Member
Join Date: Feb 2011
Old 06-23-2011 , 08:28   [Help] Menu Problem
Reply With Quote #1

I Don't Know Why But my menus Dosnt show Up When someone type The Command to it.

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>
#include <hamsandwich>
#include <Colorchat>
#include <engine>
#include <fakemeta>
#include <hamsandwich>
#include <fakemeta_util>



//Define
#define IsPlayer(%1) ( 1 <= %1 <= g_iMaxPlayers )
#define fm_DispatchSpawn(%1) dllfunc(DLLFunc_Spawn, %1)
#define A "2reason2kill"
#define V "1.0"
#define P "vampire mod"


//Boolean
new bool:g_bBoght[33][33]
new 
bool:idk[33]

//prefix etc

new PlayerClass[33]
new 
PREFIX[] = "[Vampire Mod]^x01:"
new g_iMaxPlayers
// Class things
enum
{
    
CLASS_Classic 0,// Hp 750, Speed 400, Gravity 500, Claws, damage half
    
CLASS_Bloodsucker,// Hp 400, Speed 500,Gravity 800, Bloody knife,damage full
    
CLASS_Blademaster,//Hp 605, Speed 300, Gravity 300, Long sword,damage half
    
CLASS_Bloody,//hp 505, Speed 700, Gravity 800, Claim, Claws,
    
CLASS_nightmare,//hp 405, Speed 500,gravity 600,Claws, invible
    
MAXCLASSES


new const 
CLASSES[MAXCLASSES] [] = {
    
"Clasic Vampire",
    
"Bloodsucker",
    
"Blademaster",
    
"Bloody",
    
"NightMare"

//Cvar's


new BloodyHp,Nightmarehp,BloodsuckerhpBlademasterhp,Clasichp,invisbletime,silver_lighet_cost,Shotghun_cost,nightvison_cost,grenadepacket_cost,revive_cost,anti_deagle_cost,m249_cost,spy_cost,ratio_shield_cost,Clasic_Gravity,bloodsucker_gravity,blademaster_gravity,Bloody_gravity,nightmare_gravity


//shop item

//Ct
enum {
    
    
silver_lighet,
    
Shotghun,
    
nightvison,
    
grenade_packet,
    
Revive,
    
m249
}

//T
enum {
    
    
anti_deagle,
    
ratio_shield,
    
Spy
    
}

public 
plugin_init() {
    
register_plugin(PVA)
    
    
//Cvar's
    /* Hp Cvar */
    
BloodyHp register_cvar("vm_bloody_hp","250")// Bloody Hp
    
Nightmarehp register_cvar("vm_nightmare_hp","530")// NM Hp
    
Bloodsuckerhp register_cvar("vm_bloodsucker_hp","150")// BS hp
    
Blademasterhp register_cvar("vm_blademaster_hp","300")//bm Hp
    
Clasichp register_cvar("vm_Clasic_hp","350")//clasic hp
    /* Time Cvar */
    
invisbletime register_cvar("vm_Invisble_time","15.0")//invisble Time
    /* Cost Cvar */
    
silver_lighet_cost register_cvar("silver_lighet_cost","16000")
    
Shotghun_cost register_cvar("Shotghun_cost","16000")
    
nightvison_cost register_cvar("nightvison_cost","16000")
    
grenadepacket_cost register_cvar("grenadepacket_cost","16000")
    
revive_cost register_cvar("revive_cost","16000")
    
anti_deagle_cost register_cvar("anti_deagle_cost","16000")
    
m249_cost register_cvar("m249_cost","16000")
    
spy_cost register_cvar("vm_spy","16000")
    
ratio_shield_cost register_cvar("vm_ratioS_cost","16000")
    
/* Gravity Cvar */
    
Clasic_Gravity register_cvar("vm_clasic_gravity","500")
    
bloodsucker_gravity register_cvar("vm_bloodsucker_gravity","800")
    
blademaster_gravity register_cvar("vm_blademaster_gravity","300")
    
Bloody_gravity register_cvar("vm_bloody_gravity","800")
    
nightmare_gravity register_cvar("vm_nightmare_gravity","600")
    
    
    
//Round Start & Round end

    
    //forward and hook's
    
RegisterHamHam_TakeDamage "player" "fwTakeDamage" )
    
RegisterHam(Ham_Spawn"player""Player_Spawn_Post"1);
    
g_iMaxPlayers get_maxplayers()
    
register_event("Damage""on_damage""b""2!0""3=0""4!0")
    
register_event("CurWeapon""CheckSpeed""be");
    
    
    
//commands
    
register_clcmd("say /shop","showmenu");
    
register_clcmd("say_team /shop","showmenu");
    
register_clcmd("say /Help","Showhelp");
    
register_clcmd("say /class","changeclass");
    
    
    
    
    
    
}


public 
showmenu(id)
{
    if(
is_user_alive(id))
    {
        new 
ShopItem[64];
        
        switch(
cs_get_user_team(id))
        {
            case 
CS_TEAM_T
            {
                
Shop menu_create("\y [\rVampire Shop\y]\y:","vampireshop");
                
formatex(Itemcharsmax(Item), "\wAnti Deagle\y[\r %s $\y]"get_pcvar_num(anti_deagle_cost));
                
menu_additem(Shop,Item"1");
                
formatex(Itemcharsmax(Item), "\wRatio Shield!\y[\r %s $\y]"get_pcvar_num(ratio_shield_cost));
                
menu_additem(Shop,Item"2");
                
formatex(Itemcharsmax(Item), "\wChamelon\y[\r %s $\y]"get_pcvar_num(spy_cost));
                
menu_additem(Shop,Item"3");
            }
            
            case 
CS_TEAM_CT:
            {
                
Shop menu_create("\y [\rHumen Shop\y]\y:","CsShop");
                
formatex(Itemcharsmax(Item), "\wSilver Light \y[\r %d $\y]"get_pcvar_num(silver_lighet_cost));
                
menu_additem(Shop,Item"1");
                
format(Item,sizeof(Item)-1"\wShotty\y[\r %d $\y]"get_pcvar_num(Shotghun_cost));
                
menu_additem(Shop,Item"2");
                
format(Item,sizeof(Item)-1"\wnightvision\y[\r %d $\y]"get_pcvar_num(nightvison_cost));
                
menu_additem(Shop,Item"3");
                
format(Item,sizeof(Item)-1"\wGreNade Packet\y[\r %d $\y]"get_pcvar_num(grenadepacket_cost));
                
menu_additem(Shop,Item"4");
                
format(Item,sizeof(Item)-1"\wMachinGun Guy!\y[\r %d $\y]"get_pcvar_num(m249_cost));
                
menu_additem(Shop,Item"5");
            }
        }
        
        
menu_setprop(ShopMPROP_PERPAGE0);
        
menu_display(idShop);
    }
}  
public 
CsShop (idShopCTitem)
{
    new 
data[6], iName[64]
    new 
accesscallback
    menu_item_getinfo
(ShopCTitemaccessdata,5iName63callback)
    
    new 
name [33]
    
get_user_name(idname32)
    new 
key str_to_num(data)
    new 
money cs_get_user_money(id)
    
    switch(
key)
    {
    case 
1:
    {
        if(
g_bBoght[id][silver_lighet])
        {
        
ColorChat(idGREEN,"%s You Cant Buy This Item 2 Time's!",PREFIX)
        }
        else
        {
        new 
cost get_pcvar_num(silver_lighet_cost);
        
        if(
money >= cost)
        {
            
cs_set_weapon_ammo(give_item(id"weapon_deagle"),1)
            
g_bBoght[id][silver_lighet] = true
            cs_set_user_bpammo
(idCSW_DEAGLE1)
            
cs_set_user_money(idmoney -cost)
            
set_hudmessage(02550, -1.0, -1.0)
            
show_hudmessage(0"%s Just Bought a Silver light^nVampires Watch Out!")
            
            
ColorChat(idGREEN,"%s You Just Bought a^x04 silver Light^x01!"PREFIX);
        }
        }
    }
    case 
2:
    {
        if(
g_bBoght[id][Shotghun])
        {
        
ColorChat(idGREEN,"%s You Can't Buy This ^x04Item^x01 2^x04 Time's^x01!",PREFIX)
        }
        else
        {
        new 
cost get_pcvar_num(Shotghun_cost);
        
        if(
money >= cost)
        {
            
give_item(id"weapon_m3")
            
cs_set_user_bpammo(idCSW_M3250)
            
cs_set_user_money(idmoney -cost)
            
g_bBoght[id][Shotghun] = true;
            
ColorChat(id,GREEN,"%s You Just Bought a^x04 Shotty^x01!",PREFIX)
        }
        }
    }
    case 
3:
    {
        if(
g_bBoght[id][nightvison])
        {
        
ColorChat(id,GREEN,"%s You^x04 Already^x01 This Item!",PREFIX)
        }
        else
        {
        new 
cost get_pcvar_num(nightvison_cost);
        
        if(
money >= cost)
        {
            
give_item(id,"item_nightvision")
            
g_bBoght[id][nightvison] = true;
            
cs_set_user_money(id,money -cost)
        }
        }
    }
    case 
4:
    {
        if(
g_bBoght[id][grenade_packet])
        {
        
ColorChat(idGREEN,"%s You^x04 Already^x01 have This^x04 Item^x01!",PREFIX)
        }
        else
        {
        new 
cost get_pcvar_num(grenadepacket_cost);
        
        if(
money >= cost)
        {
            
give_item(id"weapon_flashbang")
            
give_item(id"weapon_hegrenade")
            
give_item(id"weapon_smokegrenade")
            
g_bBoght[id][grenade_packet] = true;
            
cs_set_user_money(idmoney -cost)
        }
        }
    }
    
    case 
5:
    {
        if(
g_bBoght[id][m249])
        {
        
ColorChat(id,GREEN,"%s You Aready Bought Or have this ^x04Item^01!",PREFIX)
        }
        else
        {
        new 
cost get_pcvar_num(m249_cost);
        
        if(
money >= cost)
        {
            
give_item(id,"weapon_m249")
            
set_hudmessage(02550, -1.0, -1.0)
            
show_hudmessage(0"%s Have a Maching Gun!^nWatch Out from him!",name)
            
g_bBoght[id][m249] = true;
            
ColorChat(id,GREEN,"%s You Just Bought A machin Gun!",PREFIX)
            
cs_set_user_money(id,money -cost)
            
        }
        }
    }
    }
}

public 
vampireshop (idShopTitem)
{
    new 
data[6], iName[64]
    new 
accesscallback
    menu_item_getinfo
(ShopTitemaccessdata,5iName63callback)
    
    new 
key str_to_num(data)
    new 
money cs_get_user_money(id)
    
    switch(
key)
    {
    case 
1:
    {
        if(
g_bBoght[id][anti_deagle])
        {
        
ColorChat(idGREEN"%s You Only Can buy this item ^x041 time^x01!",PREFIX)
        }
        else
        {
        new 
cost get_pcvar_num(anti_deagle_cost)
        
        if(
money >= cost)
        {
        
        
            
g_bBoght[id][anti_deagle] = true;
            
idk[id] = true;
            
cs_set_user_money(idmoney-cost)
            
ColorChat(idGREEN"%s You Just Bought^x04 Anti Deagle^x01!",PREFIX)
        }
        }
    }
    case 
2:
    {
        if(
g_bBoght[id][ratio_shield])
        {
        
ColorChat(id,GREEN"%s You Can't Buy This item 2 Times!",PREFIX)
        }
        else
        {
        new 
cost get_pcvar_num(ratio_shield_cost);
        
        if(
money >= cost)
        {
            
give_item(id,"weapon_shield");
            
g_bBoght[id][ratio_shield] = true;
            
cs_set_user_money(idmoney-cost)
            
ColorChat(idGREEN"%s You just Bought a ^x04Riot Shield^x01!",PREFIX)
        }
        }
    }
    case 
3:
    {
        if(
g_bBoght[id][Spy])
        {
        
ColorChat(idGREEN," %s You aready look like an enemy!",PREFIX)
        }
        else
        {
        new 
cost get_pcvar_num(spy_cost)
        new 
money get_pcvar_num(spy_cost);
        new 
rand random_num(1,6)
        
        if(
money >=cost)
        {
            
g_bBoght[id][Spy] = true;
            
cs_set_user_money(id,money-cost)
            
ColorChat(idGREEN"%s You look like an ^x04enemy^x01!",PREFIX)
            switch(
rand)
            {
            case 
1:
            {
                
cs_set_user_model(id,"sas")
            }
            case 
2:
            {
                
cs_set_user_model(id,"urban")
            }
            case 
3:
            {
                
cs_set_user_model(id,"gsg9")
            }
            case 
4:
            {
                
cs_set_user_model(id"gign")
            }
            case 
5:
            {
                
cs_set_user_model(id"vip")
            }
            }
        }
        }
    }
    }
}
public 
fwTakeDamagevictim inflictor attacker Float:damage damage_bits )
{
    if( 
idk[victim] && IsPlayerattacker ) && is_user_aliveattacker ) && inflictor == attacker && ( get_user_weapon(attacker) == CSW_DEAGLE ) )
    {
        return 
HAM_SUPERCEDE;
    }
    
    return 
HAM_IGNORED;
}  
public 
client_connect(id)
{
    
    
g_bBoght[id][silver_lighet] = false;
    
g_bBoght[id][Shotghun] = false;
    
g_bBoght[id][nightvison] = false;
    
g_bBoght[id][grenade_packet] = false;
    
g_bBoght[id][m249] = false;
    
g_bBoght[id][anti_deagle] = false;
    
g_bBoght[id][ratio_shield] = false;
    
g_bBoght[id][Spy] = false;
    
idk[id] = false;
}
public 
client_disconnect(id)
{
    
g_bBoght[id][silver_lighet] = false;
    
g_bBoght[id][Shotghun] = false;
    
g_bBoght[id][nightvison] = false;
    
g_bBoght[id][grenade_packet] = false;
    
g_bBoght[id][m249] = false;
    
g_bBoght[id][anti_deagle] = false;
    
g_bBoght[id][ratio_shield] = false;
    
g_bBoght[id][Spy] = false;
    
idk[id] = false;
}

public 
Player_Spawn_Post(id)
{
    
    
    
    
//Colorchat
    
ColorChat(0,GREEN,"%s Type /shop To open the Shop",PREFIX)
    
ColorChat(0,GREEN,"%s Type /help To see how To play",PREFIX)
    
//boolean for roundstart
    
g_bBoght[id][silver_lighet] = false;
    
g_bBoght[id][Shotghun] = false;
    
g_bBoght[id][nightvison] = false;
    
g_bBoght[id][grenade_packet] = false;
    
g_bBoght[id][m249] = false;
    
g_bBoght[id][anti_deagle] = false;
    
g_bBoght[id][ratio_shield] = false;
    
g_bBoght[id][Spy] = false;
    
idk[id] = false;
    
    
}

public 
changeclass(id)
{
    if(
cs_get_user_team(id) == CS_TEAM_T)
    {
        
Classmenu(id)
    }
    else
    {
        if(
cs_get_user_team(id) == CS_TEAM_CT)
        
ColorChat(id,GREEN,"%s You Must be a vampire To chosse Class",PREFIX)
    }
}
public 
Classmenu(id)
{
    new 
cm,Item[64];
    
    
    
           
cm menu_create("\y[\rVampire Class\y]\y:","Classhandle");
                
formatex(Itemcharsmax(Item), "\wClasic Vampire \y[\rHp: %d||Gravity: %d\y]",get_pcvar_num(Clasichp),get_pcvar_num(Clasic_Gravity));
           
menu_additem(cm,Item"1");
                
formatex(Itemcharsmax(Item), "\wBloodSucker \y[\rHp: %d||Gravity: %d\y]",get_pcvar_num(Bloodsuckerhp),get_pcvar_num(bloodsucker_gravity));
           
menu_additem(cm,Item"2");
           
formatex(Item,charsmax(Item),"\wBladeMaster \y[\rHp: %d||Gravity: %d\y]",get_pcvar_num(Blademasterhp),get_pcvar_num(blademaster_gravity));
           
menu_additem(cm,Item"3");
           
formatex(Item,charsmax(Item),"\wBloody \y[\rHp: %d||Gravity: %d\y]",get_pcvar_num(BloodyHp),get_pcvar_num(Bloody_gravity));
           
menu_additem(cm,Item"4");
           
formatex(Item,charsmax(Item),"\wNightMare \y[\rHp: %d||Gravity: %d\y}]",get_pcvar_num(Nightmarehp),get_pcvar_num(nightmare_gravity));
           
menu_additem(cm,Item"5");
           
menu_setprop(cmMPROP_EXIT MEXIT_ALL);
           
menu_display(id cm 0);
          }
        
        
       
public 
Class_Handle(id menu item)  
{
    
    if(
item == MENU_EXIT
    
menu_destroy(menu);

    new 
szCommand[6] , szName[64];
    new 
access callback;

    
menu_item_getinfo(menu item access szCommand szName 63 callback);

    new 
str_to_num(szCommand);
    if(
PlayerClass[id] != i
    {
        
PlayerClass[id] = i;
    
        
client_printidprint_chat"%s You are now a %s"PREFIXCLASSES[i]);
    

    } 
    else
    {
        
client_printidprint_chat"%s You are already a %s"PREFIXCLASSES[i]);
    }
    
}

public 
SkillsToclass(id)
{
    if(
is_user_alive(id))
    {    
        if(
PlayerClass[id] == CLASS_Classic)
        {
            
set_user_health(id,get_pcvar_num(Clasichp));
            }
        }
    } 
2reason2kill is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:25.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode