Raised This Month: $51 Target: $400
 12% 

Give_item won't work


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
f0rhead
Junior Member
Join Date: Jun 2012
Old 08-17-2012 , 19:38   Give_item won't work
Reply With Quote #1

In the written code below I have this error where I type "give_item(id, "weapon_**")" or "strip_user_weapons(id)" It says Undefined symbol

My question is why?

PHP Code:
#include <amxmodx>
#include <colorchat>
#include <cstrike>

new const PLUGIN[] = "DaysMenu"
new const VERSION[] = "0.1"
new const AUTHOR[] = "f0rhead"

new const g_Prefix[] = "^4[] Jailbreak Shop:^3"

new g_iCurrentGame

enum
{
    
GAME_OFF,
    
GAME_FREE,
    
GAME_DODGE
    
}

new const 
g_Dodgeball[ ] = "models/DaysMenu/v_dodgeball.mdl";

new const 
g_Dodgeball2[ ] = "models/DaysMenu/p_dodgeball.mdl";

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say /dm""DaysMenu")
}

public 
plugin_precache()
{
    
precache_model(g_Dodgeball);
    
precache_model(g_Dodgeball2)
}

public 
DaysMenu(id)
{
    if(!
is_user_alive(id))
    return;
    
    if(
get_user_flags(id) & ADMIN_CFG)
    {
        new 
menu menu_create("/ ^n /dDaysMenu ""menu_handler");

        
menu_additem(menu"\wFreeday""1"0);
        
        
menu_additem(menu"\wDodgeball^n""2"0);
        
        
        
menu_setprop(menuMPROP_EXITMEXIT_ALL);
        
        
menu_display(idmenu0)
    }
    else
    {
        
ColorChat(idGREY"^%s Only ^4Admins^3 can open this menu."g_Prefix)
    }
}

public 
menu_handler(idmenuitem)

{
    if (
item == MENU_EXIT)
    {
        
menu_destroy(menu)
        return 
PLUGIN_HANDLED
    
}
    
    new 
data[6], iName[64]
    new 
accescallback
    menu_item_getinfo
(menuitemaccesdata,5iName63callback)
         
    new 
key str_to_num(data)
                
    switch(
key)
    { 
            case 
1Free(id)
            case 
2Dodge(id)
        }
        
    return 
PLUGIN_HANDLED
}

public 
Free(id)
{
     
strip_user_weapons(id)
     
give_item(id)
}

public 
Dodge(id)
{
    
        
g_iCurrentGame GAME_DODGE

        
new iPlayers[32]
        new 
iNum
        
new id
    
        get_players
iPlayersiNum"a" )

        for( new 
0iNumi++ )

        {
                
id iPlayers[i]
            
                
ColorChat(0GREY"Dodge is ON")            
                
strip_user_weaponsid )
              
                if (
cs_get_user_team(id) == CS_TEAM_CT)
                {

                
give_item(id"weapon_hegrenade")

                
cs_set_user_bpammoidCSW_HEGRENADE200 )                     
                } 
                else if (
cs_get_user_team(id) == CS_TEAM_T)
                {
                
give_item(id"weapon_hegrenade")
                
cs_set_user_bpammoidCSW_HEGRENADE200 )        
        }
}


Last edited by f0rhead; 08-17-2012 at 19:38.
f0rhead is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-17-2012 , 19:46   Re: Give_item won't work
Reply With Quote #2

Include fun.inc
__________________
fysiks is offline
f0rhead
Junior Member
Join Date: Jun 2012
Old 08-17-2012 , 20:11   Re: Give_item won't work
Reply With Quote #3

Quote:
Originally Posted by fysiks View Post
Include fun.inc
Oh, Thanks...
f0rhead is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-17-2012 , 21:14   Re: Give_item won't work
Reply With Quote #4

The next time you see an error like that you can first check here to see if it is a function that exists (it will tell you which include it is in). If it's not in there, check for case and spelling errors.
__________________

Last edited by fysiks; 08-17-2012 at 21:14.
fysiks 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 15:28.


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