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

Dont compile in amx 1.8.2


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
wicho
Veteran Member
Join Date: Feb 2012
Location: GuateAmala
Old 07-23-2020 , 21:22   Dont compile in amx 1.8.2
Reply With Quote #1

Hi everyone, well I have this code which is a sprite menu the problem is that when I compile I get this error:

Error: Argument does not have a default value (argument 3) on line 42

is this line:

menu_item_getinfo(menu, item, _, szKey, charsmax(szKey))

It seems that in version 1.8.3 it compiles well, my question is how can I make it compile and work well in version 1.8.2? ... Thanks in advance

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <engine>
#include <hamsandwich>

#include <emotions>
#include <emotions_control>

#define PLUGIN_NAME "Emotions: Sprite Up"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR "Denzer"

// Emotion sprite up scale
const Float:EMOTION_SPRITE_UP_SCALE 0.15

// Emotion sprite up classname
new const EMOTION_SPRITE_UP_CLASSNAME[] = "emotion_up"

public plugin_init()
{
         
register_plugin(PLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR)
     
    
RegisterHam(Ham_ThinkEMOTION_SPRITE_UP_CLASSNAME"ThinkRemove"true)
}

public 
client_disconnected(id)
{
         new 
iEnt 32+1

         
while ((iEnt find_ent_by_class(iEntEMOTION_SPRITE_UP_CLASSNAME)))
         {
        if (
pev(iEntpev_owner) != id)
                           continue

        
set_pev(iEntpev_flagsFL_KILLME)
         }
}

public 
emotions_menu_handler(idmenuitem)
{
         new 
szKey[MAX_EMOTION_KEY_LENGTH]; menu_item_getinfo(menuitem_szKeycharsmax(szKey))

         new 
index emotions_emotion_find_index(szKey)

         if (
index == -1)
         {
                  return 
PLUGIN_HANDLED
         
}

         new 
eTempEmotion[EmotionData_s]; emotions_emotion_getinfo(indexeTempEmotion)

         new 
iEnt create_entity("info_target")

         if (!
pev_valid(iEnt))
         {
                  return 
PLUGIN_HANDLED
         
}

         
engfunc(EngFunc_SetModeliEnteTempEmotion[EMOTION_SPRITE_UP])
    
set_pev(iEntpev_classnameEMOTION_SPRITE_UP_CLASSNAME)
    
set_pev(iEntpev_movetypeMOVETYPE_FOLLOW)
    
set_pev(iEntpev_aimentid)
    
set_pev(iEntpev_ownerid)
    
set_pev(iEntpev_scaleEMOTION_SPRITE_UP_SCALE)

         if (
eTempEmotion[EMOTION_SPRITE_UP_FRAME] != -1)
         {
         
set_pev(iEntpev_framefloat(eTempEmotion[EMOTION_SPRITE_UP_FRAME]))
         }

    
set_pev(iEntpev_nextthinkget_gametime() + emotions_get_emotion_delay() - 0.5)

         return 
PLUGIN_CONTINUE
}

public 
ThinkRemove(iEnt)
{
         if (!
pev_valid(iEnt))
         {
                  return
         }

    
set_pev(iEntpev_flagsFL_KILLME)

wicho is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-23-2020 , 22:02   Re: Dont compile in amx 1.8.2
Reply With Quote #2

The third parameter for that function doesn't have a default value in AMX Mod X 1.8.2. You need to provide a valid variable.

Here is the function prototype for AMX Mod X 1.8.2. Default values were added 5 years later as shown here.
__________________

Last edited by fysiks; 07-23-2020 at 22:10.
fysiks is offline
wicho
Veteran Member
Join Date: Feb 2012
Location: GuateAmala
Old 08-03-2020 , 01:07   Re: Dont compile in amx 1.8.2
Reply With Quote #3

Its this ok?

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <engine>
#include <hamsandwich>

#include <emotions>
#include <emotions_control>

#define PLUGIN_NAME "Emotions: Sprite Up"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR "Denzer"

// Emotion sprite up scale
const Float:EMOTION_SPRITE_UP_SCALE 0.15

// Emotion sprite up classname
new const EMOTION_SPRITE_UP_CLASSNAME[] = "emotion_up"

public plugin_init()
{
         
register_plugin(PLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR)
     
    
RegisterHam(Ham_ThinkEMOTION_SPRITE_UP_CLASSNAME"ThinkRemove"true)
}

public 
client_disconnected(id)
{
         new 
iEnt 32+1

         
while ((iEnt find_ent_by_class(iEntEMOTION_SPRITE_UP_CLASSNAME)))
         {
        if (
pev(iEntpev_owner) != id)
                           continue

        
set_pev(iEntpev_flagsFL_KILLME)
         }
}

public 
emotions_menu_handler(idmenuitem)
{
    new 
data[6
         new 
accesscallback 
         
new szKey[MAX_EMOTION_KEY_LENGTH]; menu_item_getinfo(menuitemaccessdatacharsmax(data), szKeycharsmax(szKey), callback)

         new 
index emotions_emotion_find_index(szKey)

         if (
index == -1)
         {
                  return 
PLUGIN_HANDLED
         
}

         new 
eTempEmotion[EmotionData_s]; emotions_emotion_getinfo(indexeTempEmotion)

         new 
iEnt create_entity("info_target")

         if (!
pev_valid(iEnt))
         {
                  return 
PLUGIN_HANDLED
         
}

         
engfunc(EngFunc_SetModeliEnteTempEmotion[EMOTION_SPRITE_UP])
    
set_pev(iEntpev_classnameEMOTION_SPRITE_UP_CLASSNAME)
    
set_pev(iEntpev_movetypeMOVETYPE_FOLLOW)
    
set_pev(iEntpev_aimentid)
    
set_pev(iEntpev_ownerid)
    
set_pev(iEntpev_scaleEMOTION_SPRITE_UP_SCALE)

         if (
eTempEmotion[EMOTION_SPRITE_UP_FRAME] != -1)
         {
         
set_pev(iEntpev_framefloat(eTempEmotion[EMOTION_SPRITE_UP_FRAME]))
         }

    
set_pev(iEntpev_nextthinkget_gametime() + emotions_get_emotion_delay() - 0.5)

         return 
PLUGIN_CONTINUE
}

public 
ThinkRemove(iEnt)
{
         if (!
pev_valid(iEnt))
         {
                  return
         }

    
set_pev(iEntpev_flagsFL_KILLME)

wicho is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-03-2020 , 01:44   Re: Dont compile in amx 1.8.2
Reply With Quote #4

Does it work?
__________________
fysiks is offline
Old 08-03-2020, 02:18
Black Rose
This message has been deleted by Black Rose. Reason: nvm
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 23:49.


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