Raised This Month: $ Target: $400
 0% 

what's wrong here?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
groofshark
Member
Join Date: Jul 2013
Old 05-19-2015 , 19:46   what's wrong here?
Reply With Quote #1

PHP Code:
#define PLUGIN "Pro Shop"
#define VERSION "0.0.1"
#define AUTHOR "groofshark"

#include <amxmodx>
#include <hamsandwich>

#define MAX_PLAYERS 32
#define MAX_ITEMS    2

enum ( <<=)
{
    
ExtraHP 1
    
ExtraArmor,
    
SilentFootsteps
}
new 
g_pItems[MAX_PLAYERS 1]
#define ActivatePlayerItem(%1, %2)    ( g_pItems[%1] |= %2 )
#define DeactivatePlayerItem(%1, %2)    ( g_pItems[%1] &= ~%2 )
new g_pItemsCounter[MAX_PLAYERS 1]
#define ResetPlayerItemCounter(%1)    ( g_pItemsCounter[%1] = 0 )

enum _:UniqueMenuOptions
{
    
_Items,
    
_ItemsStatus
}
new 
g_bUnique[MAX_PLAYERS 1][UniqueMenuOptions]
#define UniqueMenuOptions(%1, %2)    ( %1 & (1<<%2) )
#define ActivateUMO(%1, %2)    ( %1 |= (1<<%2) )
#define DeactivateUMO(%1, %2)    ( %1 &= ~(1<<%2) )

public plugin_init()
{
    
register_pluginPLUGINVERSIONAUTHOR )
    
    
RegisterHam(Ham_Spawn"player""CBase_Player_Spawn_P"true)
    
    
register_clcmd("say /shop""ClCmd_Shop")
        
register_clcmd("say_team /shop""ClCmd_Shop")
}

public 
CBase_Player_Spawn_P(id)
{
    if( 
is_user_alive(id) )
    {
        
ResetPlayerItemCounter(id)

        
ActivatePlayerItem(idExtraHP)
        
ActivatePlayerItem(idExtraArmor)
        
ActivatePlayerItem(idSilentFootsteps)

        switch( 
UniqueMenuOptions(id_Items) )
        {
            case 
1..3DeactivateUMO(id_ItemsStatus)
        }
    }
}    

public 
ClCmd_Shop(id)
{
        new 
szTemp[500 char]
        
formatex(szTempcharsmax(szTemp), "\r[Shop] \yItems Menu")
         
        new 
iMenu menu_create(szTemp"Items_Menu_Handler")
        new 
iCallback menu_makecallback("Items_Menu_Callback")
        
        
formatex(szTempcharsmax(szTemp), "Extra HP")
        
menu_additem(iMenuszTemp"1")
        
        
formatex(szTempcharsmax(szTemp), "Extra AP")
        
menu_additem(iMenuszTemp"2")
    
        
formatex(szTempcharsmax(szTemp), "Silent Footsteps")
        
menu_additem(iMenuszTemp"3")
        
        
menu_display(idiMenu)
}

public 
Items_Menu_Handler(idiMenuiItem
{    
        if( 
iItem == MENU_EXIT 
        {
            
menu_destroy(iMenu)
            return 
PLUGIN_HANDLED
        
}
        
      switch(
iItem
        {
        case 
0// Option #1 from menu
        
{
            
ActivatePlayerItem(idExtraHP)
            if( 
g_Items[id] & ExtraHP )
            {
                
set_user_health(idget_user_health(iPlayer) + 50)
            }
        }
         case 
1// Option #2 from menu
        
{
            
ActivatePlayerItem(idExtraAP)
            if( 
g_Items[id] & ExtraArmor )
            {
                
set_user_armor(id100)
            }
        }
        case 
2// Option #3 from menu
        
{    
            
ActivatePlayerItem(idSilentFootsteps)
            if( 
g_Items[id] & SilentFootsteps )
            {
                
set_user_footsteps(id1)
            }
            
            }
        }    
    }
    
    return 
PLUGIN_HANDLED

groofshark is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-19-2015 , 19:49   Re: what's wrong here?
Reply With Quote #2

You have to tell us what is wrong before anybody can help you.
__________________
fysiks is offline
tousif
AlliedModders Donor
Join Date: Nov 2014
Location: India
Old 05-20-2015 , 05:27   Re: what's wrong here?
Reply With Quote #3

Post the error's plzz
tousif is offline
groofshark
Member
Join Date: Jul 2013
Old 05-20-2015 , 09:12   Re: what's wrong here?
Reply With Quote #4

Just it can't compile...

undefined symbol ActivatePlayerItem and 1-2 other mistakes, try it
groofshark is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-20-2015 , 18:59   Re: what's wrong here?
Reply With Quote #5

Simply look for the lines that is shows in the compile errors. Read the error and it generally tells you exactly what is wrong. In the case of the one you posted, that variable is not defined you either need to define it or determine if it's spelled wrong.
__________________
fysiks is offline
Reply


Thread Tools
Display Modes

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 20:04.


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