Raised This Month: $ Target: $400
 0% 

Plugin work, Does not show anything


Post New Thread Reply   
 
Thread Tools Display Modes
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
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 01-21-2014 , 06:15   Re: Plugin work, Does not show anything
Reply With Quote #2

The function needs to be public.
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
Snitch
Veteran Member
Join Date: Sep 2013
Location: Kazakhstan
Old 01-21-2014 , 06:19   Re: Plugin work, Does not show anything
Reply With Quote #3

Quote:
Originally Posted by hornet View Post
The function needs to be public.
ahh Thanks for it. i edit my Thread check it please

what about that:
Quote:
new const LEVELS[21] =
no work for me

Last edited by Snitch; 01-21-2014 at 06:27.
Snitch is offline
Send a message via Skype™ to Snitch
Snitch
Veteran Member
Join Date: Sep 2013
Location: Kazakhstan
Old 05-17-2014 , 08:29   Re: Plugin work, Does not show anything
Reply With Quote #4

bump?
Snitch is offline
Send a message via Skype™ to Snitch
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 05-17-2014 , 09:15   Re: Plugin work, Does not show anything
Reply With Quote #5

What is it that isn't working?
I don't want to install the plugin to find that out.
__________________
Black Rose is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 05-17-2014 , 09:26   Re: Plugin work, Does not show anything
Reply With Quote #6

Show debug log:
-Add debug in plugins.ini right after plugin name: if the plugin is called name will be name debug.

Then look in server's console and post here the debug log.
HamletEagle is offline
Snitch
Veteran Member
Join Date: Sep 2013
Location: Kazakhstan
Old 11-23-2014 , 16:45   Re: Plugin work, Does not show anything
Reply With Quote #7

bump
Snitch is offline
Send a message via Skype™ to Snitch
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 11-23-2014 , 21:02   Re: Plugin work, Does not show anything
Reply With Quote #8

Please show the full code and the errors that you get?
zmd94 is offline
Snitch
Veteran Member
Join Date: Sep 2013
Location: Kazakhstan
Old 11-24-2014 , 09:48   Re: Plugin work, Does not show anything
Reply With Quote #9

Quote:
Originally Posted by zmd94 View Post
Please show the full code and the errors that you get?
this is my full code.

just the menu not open to me.

i just want when u lvl up u can get [take] a hat for your level.
but if u not Lv 10, so u can't bought it.

and i guess i missed exp to level.
so i dunno.
Snitch is offline
Send a message via Skype™ to Snitch
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 11-25-2014 , 03:12   Re: Plugin work, Does not show anything
Reply With Quote #10

Where is the part of code that use to save the experiences?
zmd94 is offline
Reply



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