Raised This Month: $ Target: $400
 0% 

Plugin work, Does not show anything


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Snitch
Veteran Member
Join Date: Sep 2013
Location: Kazakhstan
Old 01-21-2014 , 06:12   Plugin work, Does not show anything
Reply With Quote #1

That Only Open the menu - /hats - when i press 1/2/3/4 nothing show, must be a level..

but /level other commands nothing working
PHP Code:
/* Plugin generated by AMXX-Studio */
 
#include <amxmodx>
#include <amxmisc>
#include <nvault>
#include <cstrike>
#include <fun>
 
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"
 
new const gszdevil[] = "models/player/amxx/devil.mdl";  
new const 
gszafro[] = "models/player/amxx/afro.mdl";  
new const 
gszbeer[] = "models/player/amxx/beer.mdl";   
new const 
gszheadphones[] = "models/player/amxx/headphones.mdl";  
 
new const 
LEVELS[4] =
{
    
0,
    
10,
    
20,
    
40
    
    
    
}
 
new 
PlayerXP[33], PlayerLevel[33]
new 
Xp_Kill,XP_Hs,SaveXP,XP_Round
new g_vault
 
public plugin_init() {
       
        
g_vault nvault_open("HatSystem")
       
        
//Event
        
register_event("DeathMsg""eDeath""a")
       
        
//Is Saving on?
        
SaveXP register_cvar("SaveXP","1")
       
        
register_logevent"Event_RoundEnd"2"1=Round_End" );
       
        
//Xp/Kill
        
Xp_Kill=register_cvar("XP_per_kill""6")
       
        
//HsBonus
        
XP_Hs=register_cvar("XP_hs_bonus","6")
        
XP_Round=register_cvar("XP_Round","10")
       
        
//Rewards
        
register_clcmd"say /hats","Hats_Handler");
        
register_clcmd"say_tean /hats","Hats_Handler");
       
        
//Checking Points/Level
    
register_clcmd("say /level""ShowHud")
    
register_clcmd("say /mylevel""ShowHud")
}
 
public 
eDeath()
{
    new 
attacker read_data)
    new 
headshot read_data)
       
        if( !( 
<= attacker <= 32 )
        || !
is_user_aliveattacker ) )
        {
                return;
        }
       
        if(
headshot)
        {
                
PlayerXP[attacker] += get_pcvar_num(Xp_Kill)
                
client_print(attackerprint_chat"You got bonus %i for killing with a HeadShot!"get_pcvar_num(  XP_Hs ))
        }
       
        
PlayerXP[attacker] += get_pcvar_num(Xp_Kill)
       
        while(
PlayerXP[attacker] >= LEVELS[PlayerLevel[attacker]])
        { 
// this will create the Congratulations message.
                
client_print(attackerprint_chat"[%s] Congratulations! You are a level %i!"PlayerLevel[attacker]);
                
// Add his/her level
                
PlayerLevel[attacker]++
        }
        
// shows his level on a hud message
        
ShowHud(attacker)
}

// /Ps command.
public ShowHud(id)
{
        
client_print(idprint_chat" Level: %i | XP: %i"PlayerLevel[id],PlayerXP[id])
}
 
//Bonus When round ends-------------------------------------------------------------------------
public Event_RoundEnd( )
{
        new 
szPlayers32 ], iPlayerCountiNumid;
        
get_playersszPlayersiPlayerCount"e""TERRORIST" );
       
        for( 
iNum 0iNum iPlayerCountiNum++ )
        {
                
id szPlayersiNum ];
               
                if( 
is_user_aliveid ) )
                {
                        
PlayerXPid ] += get_pcvar_numXP_Round );
                        
client_print(idprint_chat"You got %i for survived the round!"get_pcvar_numXP_Round ))
                       
                        while(
PlayerXP[id] >= LEVELS[PlayerLevel[id]])
                        { 
// this will create the Congratulations message.
                                
client_print(idprint_chat"[%s] Congratulations! You are a level %i!"PlayerLevel[id]);
                                
// Add his/her level
                                
PlayerLevel[id] += 1
                        
}
                }
        }
}
 
 
//Rewards-------------------------------------------------------------------------
 
public plugin_precache()
{
        
precache_model(gszdevil)
        
precache_model(gszafro)
        
precache_model(gszbeer)
        
precache_model(gszheadphones)
}
 
 
public 
Hats_Handler(id)
{
    new 
menu menu_create("\r[AMXX] \wTest Mod:""menu_handler");
 
    
menu_additem(menu"Devil Hat \d- \r[ \wLevel \d- \y5 \r]""1");
    
menu_additem(menu"Afro Hat \d- \r[ \wLevel \d- \y10 \r]""2");
    
menu_additem(menu"Beer Hat \d- \r[ \wLevel \d- \y15 \r]""3");
    
menu_additem(menu"Headphones Hat \d- \r[ \wLevel \d- \y20 \r]""4");
    
menu_additem(menu"\wReset\w/\wRemove My Hat""5"0);
 
    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
 
    
menu_display(idmenu0);
    
    return 
1;
}
 
public 
menu_handler(idmenuitem)
{
    if( 
item == MENU_EXIT )
    {
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;
    }
       
    new 
data[6], iName[64];
    new 
accesscallback;
       
    
menu_item_getinfo(menuitemaccessdata,5iName63callback);
       
    switch(
data[0])
    {
    case 
0:
    {
    if(
PlayerLevel[id]<=5)
    {
    
client_print(idprint_chat"You Need to be level 5 for this!")
    }
                       
    if(
PlayerLevel[id]>=5)
    {
    if(
cs_get_user_team(id)==CS_TEAM_CT)
    {
    
cs_reset_user_modelid )
    
cs_set_user_modelid"devil")
    }
    else
    {
    
cs_reset_user_modelid )
    
cs_set_user_modelid"devil")
    }
    }
}
    case 
1:
    {    
    if(
PlayerLevel[id]<=10)
    {
    
client_print(idprint_chat"You Need to be level 10 for this!")
    }
            
    if(
PlayerLevel[id]>=10)
    {
    if(
cs_get_user_team(id)==CS_TEAM_CT)
    {
    
cs_reset_user_modelid )
    
cs_set_user_modelid"afro")
    }
    else
    {
    
cs_reset_user_modelid )
    
cs_set_user_modelid"afro")  
    }
    }
}
        
    case 
3:
    {
    if(
PlayerLevel[id]<=15)
    {
    
client_print(idprint_chat"You Need to be level 15 for this!")
    }
            
    if(
PlayerLevel[id]>=15)
    {
    if(
cs_get_user_team(id)==CS_TEAM_CT)
    {
    
cs_reset_user_modelid )
    
cs_set_user_modelid"beer")
    }
    else
    {
    
cs_reset_user_modelid )
    
cs_set_user_modelid"beer")  
    }
    }    
}
    case 
4:
    {
    if(
PlayerLevel[id]<=20)
    {
    
client_print(idprint_chat"You Need to be level 20 for this!")
    }
            
    if(
PlayerLevel[id]>=20)
    {
                
    if(
cs_get_user_team(id)==CS_TEAM_CT)
    {
    
cs_reset_user_modelid )
    
cs_set_user_modelid"headphones")
    }
    else
    {
    
cs_reset_user_modelid )
    
cs_set_user_modelid"headphones")
    }
    }
}
                       
    case 
5:
    {
    
cs_reset_user_modelid )
    }
}
    
    
menu_destroy(menu)
    return 
PLUGIN_HANDLED;


Last edited by Snitch; 01-21-2014 at 06:40. Reason: edit
Snitch is offline
Send a message via Skype™ to Snitch
 



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 10:08.


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